diff --git a/.gitignore b/.gitignore index cf77e45959..a3f3fcfdfe 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ CTest*.cmake # Target program /ApplicationCode/ResInsight +/.project diff --git a/ApplicationCode/Adm/ResInsightLicenseText.txt b/ApplicationCode/Adm/ResInsightLicenseText.txt index 318e0411bc..c0ae6a92be 100644 --- a/ApplicationCode/Adm/ResInsightLicenseText.txt +++ b/ApplicationCode/Adm/ResInsightLicenseText.txt @@ -1,17 +1,35 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. -// \ No newline at end of file +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. +// +//################################################################################################## diff --git a/ApplicationCode/Application/RiaApplication.cpp b/ApplicationCode/Application/RiaApplication.cpp index 8352237d53..512499ed5a 100644 --- a/ApplicationCode/Application/RiaApplication.cpp +++ b/ApplicationCode/Application/RiaApplication.cpp @@ -123,7 +123,7 @@ RiaApplication::RiaApplication(int& argc, char** argv) //cvf::Trace::enable(false); m_preferences = new RiaPreferences; - readPreferences(); + readFieldsFromApplicationStore(m_preferences); applyPreferences(); if (useShaders()) @@ -143,12 +143,12 @@ RiaApplication::RiaApplication(int& argc, char** argv) m_socketServer = new RiaSocketServer( this); m_workerProcess = NULL; - - m_startupDefaultDirectory = QDir::homePath(); - #ifdef WIN32 - //m_startupDefaultDirectory += "/My Documents/"; + m_startupDefaultDirectory = QDir::homePath(); +#else + m_startupDefaultDirectory = QDir::currentPath(); #endif + setDefaultFileDialogDirectory("MULTICASEIMPORT", "/"); // The creation of a font is time consuming, so make sure you really need your own font @@ -287,7 +287,7 @@ bool RiaApplication::loadProject(const QString& projectFileName) // VL check regarding specific order mentioned in comment above... m_preferences->lastUsedProjectFileName = projectFileName; - writePreferences(); + writeFieldsToApplicationStore(m_preferences); for (size_t oilFieldIdx = 0; oilFieldIdx < m_project->oilFields().size(); oilFieldIdx++) { @@ -444,9 +444,9 @@ bool RiaApplication::saveProjectPromptForFileName() startPath = app->defaultFileDialogDirectory("BINARY_GRID"); } - startPath += "/ResInsightProject.rip"; + startPath += "/ResInsightProject.rsp"; - QString fileName = QFileDialog::getSaveFileName(NULL, tr("Save File"), startPath, tr("Project Files (*.rip *.xml)")); + QString fileName = QFileDialog::getSaveFileName(NULL, tr("Save File"), startPath, tr("Project Files (*.rsp);;All files(*.*)")); if (fileName.isEmpty()) { return false; @@ -472,7 +472,7 @@ bool RiaApplication::saveProjectAs(const QString& fileName) m_project->writeFile(); m_preferences->lastUsedProjectFileName = fileName; - writePreferences(); + writeFieldsToApplicationStore(m_preferences); return true; } @@ -597,13 +597,12 @@ bool RiaApplication::openEclipseCase(const QString& caseName, const QString& cas //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RiaApplication::openInputEclipseCase(const QString& caseName, const QStringList& caseFileNames) +bool RiaApplication::openInputEclipseCaseFromFileNames(const QStringList& fileNames) { RimInputCase* rimInputReservoir = new RimInputCase(); m_project->assignCaseIdToCase(rimInputReservoir); - rimInputReservoir->caseUserDescription = caseName; - rimInputReservoir->openDataFileSet(caseFileNames); + rimInputReservoir->openDataFileSet(fileNames); RimAnalysisModels* analysisModels = m_project->activeOilField() ? m_project->activeOilField()->analysisModels() : NULL; if (analysisModels == NULL) return false; @@ -662,7 +661,7 @@ void RiaApplication::createLargeResultsMockModel() //-------------------------------------------------------------------------------------------------- void RiaApplication::createInputMockModel() { - openInputEclipseCase("Input Mock Debug Model Simple", QStringList("Input Mock Debug Model Simple")); + openInputEclipseCaseFromFileNames(QStringList("Input Mock Debug Model Simple")); } //-------------------------------------------------------------------------------------------------- @@ -695,7 +694,7 @@ void RiaApplication::setActiveReservoirView(RimReservoirView* rv) void RiaApplication::setUseShaders(bool enable) { m_preferences->useShaders = enable; - writePreferences(); + writeFieldsToApplicationStore(m_preferences); } //-------------------------------------------------------------------------------------------------- @@ -727,7 +726,7 @@ RiaApplication::RINavigationPolicy RiaApplication::navigationPolicy() const void RiaApplication::setShowPerformanceInfo(bool enable) { m_preferences->showHud = enable; - writePreferences(); + writeFieldsToApplicationStore(m_preferences); } @@ -870,15 +869,7 @@ bool RiaApplication::parseArguments() if (isRunRegressionTest) { - RiuMainWindow* mainWnd = RiuMainWindow::instance(); - if (mainWnd) - { - mainWnd->hideAllDockWindows(); - - runRegressionTest(regressionTestPath); - - mainWnd->loadWinGeoAndDockToolBarLayout(); - } + executeRegressionTests(regressionTestPath); return false; } @@ -1028,7 +1019,7 @@ bool RiaApplication::launchProcess(const QString& program, const QStringList& ar // Set the LD_LIBRARY_PATH to make the octave plugins find the embedded Qt - QProcessEnvironment penv = m_workerProcess->processEnvironment(); + QProcessEnvironment penv = QProcessEnvironment::systemEnvironment(); QString ldPath = penv.value("LD_LIBRARY_PATH", ""); if (ldPath == "") ldPath = QApplication::applicationDirPath(); @@ -1080,12 +1071,12 @@ bool RiaApplication::launchProcessForMultipleCases(const QString& program, const //-------------------------------------------------------------------------------------------------- /// Read fields of a Pdm object using QSettings //-------------------------------------------------------------------------------------------------- -void RiaApplication::readPreferences() +void RiaApplication::readFieldsFromApplicationStore(caf::PdmObject* object) { QSettings settings; std::vector fields; - m_preferences->fields(fields); + object->fields(fields); size_t i; for (i = 0; i < fields.size(); i++) { @@ -1102,12 +1093,14 @@ void RiaApplication::readPreferences() //-------------------------------------------------------------------------------------------------- /// Write fields of a Pdm object using QSettings //-------------------------------------------------------------------------------------------------- -void RiaApplication::writePreferences() +void RiaApplication::writeFieldsToApplicationStore(const caf::PdmObject* object) { + CVF_ASSERT(object); + QSettings settings; std::vector fields; - m_preferences->fields(fields); + object->fields(fields); size_t i; for (i = 0; i < fields.size(); i++) @@ -1384,7 +1377,11 @@ void RiaApplication::runRegressionTest(const QString& testRootPath) imageCompareReporter.addImageDirectoryComparisonSet(testFolderName.toStdString(), reportBaseFolderName.toStdString(), reportGeneratedFolderName.toStdString(), reportDiffFolderName.toStdString()); } - imageCompareReporter.generateHTMLReport(testDir.filePath(RegTestNames::reportFileName).toStdString()); + QString htmlReportFileName = testDir.filePath(RegTestNames::reportFileName); + imageCompareReporter.generateHTMLReport(htmlReportFileName.toStdString()); + + // Open HTML report + QDesktopServices::openUrl(htmlReportFileName); // Generate diff images this->preferences()->resetToDefaults(); @@ -1403,6 +1400,8 @@ void RiaApplication::runRegressionTest(const QString& testRootPath) } m_commandQueueLock.unlock(); + regressionTestSetFixedSizeForAllViews(); + saveSnapshotForAllViews(generatedFolderName); QDir baseDir(testCaseFolder.filePath(baseFolderName)); @@ -1769,3 +1768,52 @@ void RiaApplication::executeCommandObjects() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaApplication::executeRegressionTests(const QString& regressionTestPath) +{ + RiuMainWindow* mainWnd = RiuMainWindow::instance(); + if (mainWnd) + { + mainWnd->hideAllDockWindows(); + + mainWnd->setDefaultWindowSize(); + runRegressionTest(regressionTestPath); + + mainWnd->loadWinGeoAndDockToolBarLayout(); + } +} + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaApplication::regressionTestSetFixedSizeForAllViews() +{ + RiuMainWindow* mainWnd = RiuMainWindow::instance(); + if (!mainWnd) return; + + if (m_project.isNull()) return; + + std::vector projectCases; + m_project->allCases(projectCases); + + for (size_t i = 0; i < projectCases.size(); i++) + { + RimCase* ri = projectCases[i]; + if (!ri) continue; + + for (size_t j = 0; j < ri->reservoirViews().size(); j++) + { + RimReservoirView* riv = ri->reservoirViews()[j]; + + if (riv && riv->viewer()) + { + // This size is set to match the regression test reference images + riv->viewer()->setFixedSize(1000, 745); + } + } + } +} + diff --git a/ApplicationCode/Application/RiaApplication.h b/ApplicationCode/Application/RiaApplication.h index cb6a484c4f..39744c7da1 100644 --- a/ApplicationCode/Application/RiaApplication.h +++ b/ApplicationCode/Application/RiaApplication.h @@ -67,6 +67,8 @@ class RiaApplication : public QApplication bool parseArguments(); + void executeRegressionTests(const QString& regressionTestPath); + void setActiveReservoirView(RimReservoirView*); RimReservoirView* activeReservoirView(); const RimReservoirView* activeReservoirView() const; @@ -86,7 +88,7 @@ class RiaApplication : public QApplication bool openEclipseCaseFromFile(const QString& fileName); bool openEclipseCase(const QString& caseName, const QString& caseFileName); bool addEclipseCases(const QStringList& fileNames); - bool openInputEclipseCase(const QString& caseName, const QStringList& caseFileNames); + bool openInputEclipseCaseFromFileNames(const QStringList& fileNames); bool loadLastUsedProject(); QString currentProjectFileName() const; @@ -103,6 +105,7 @@ class RiaApplication : public QApplication void saveSnapshotForAllViews(const QString& snapshotFolderName); void runRegressionTest(const QString& testRootPath); void updateRegressionTest(const QString& testRootPath ); + void regressionTestSetFixedSizeForAllViews(); void processNonGuiEvents(); @@ -124,8 +127,8 @@ class RiaApplication : public QApplication void terminateProcess(); RiaPreferences* preferences(); - void readPreferences(); - void writePreferences(); + void readFieldsFromApplicationStore(caf::PdmObject* object); + void writeFieldsToApplicationStore(const caf::PdmObject* object); void applyPreferences(); cvf::Font* standardFont(); diff --git a/ApplicationCode/Application/RiaImageFileCompare.cpp b/ApplicationCode/Application/RiaImageFileCompare.cpp index d184e97c4a..fa66a6eb12 100644 --- a/ApplicationCode/Application/RiaImageFileCompare.cpp +++ b/ApplicationCode/Application/RiaImageFileCompare.cpp @@ -1,150 +1,156 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS -// -// ResInsight is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at -// for more details. -// -///////////////////////////////////////////////////////////////////////////////// - -#include "RiaImageFileCompare.h" -#include - - -//================================================================================================== -// -// -// -//================================================================================================== - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RiaImageFileCompare::RiaImageFileCompare(QString compareExecutable) -: m_compareExecutable(compareExecutable) -{ - reset(); -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RiaImageFileCompare::~RiaImageFileCompare() -{ -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiaImageFileCompare::reset() -{ - m_imagesEqual = false; - m_lastError = IC_NO_ERROR; - m_errorMsg = ""; - m_errorDetails = ""; -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RiaImageFileCompare::runComparison(QString imgFileName, QString refFileName, QString diffFileName) -{ - reset(); - - if (m_compareExecutable.isEmpty()) - { - m_lastError = SEVERE_ERROR; - m_errorMsg = "Cannot compare images, no compare executable set"; - return false; - } - - - //QString args = QString("-fuzz 2% -lowlight-color white -metric ae \"%1\" \"%2\" \"%3\"").arg(imgFileName).arg(refFileName).arg((diffFileName)); - QString args = QString("-lowlight-color white -metric ae \"%1\" \"%2\" \"%3\"").arg(imgFileName).arg(refFileName).arg((diffFileName)); - QString completeCommand = QString("\"%1\" %2").arg(m_compareExecutable).arg(args); - - // Launch process and wait - QProcess proc; - proc.start(completeCommand); - proc.waitForFinished(30000); - - QProcess::ProcessError procError = proc.error(); - if (procError != QProcess::UnknownError) - { - m_lastError = SEVERE_ERROR; - m_errorMsg = "Error running compare tool process"; - m_errorDetails = completeCommand; - return false; - } - - QByteArray stdErr = proc.readAllStandardError(); - int procExitCode = proc.exitCode(); - if (procExitCode == 0) - { - // Strip out whitespace and look for 0 (as in zero pixel differences) - stdErr = stdErr.simplified(); - if (!stdErr.isEmpty() && stdErr[0] == '0') - { - m_imagesEqual = true; - } - - return true; - } - else - { - // Report non-severe error - m_lastError = IC_ERROR; - m_errorMsg = "Error running compare tool process"; - m_errorDetails = stdErr; - - return false; - } -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RiaImageFileCompare::imagesEqual() const -{ - return m_imagesEqual; -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RiaImageFileCompare::ErrorType RiaImageFileCompare::error() const -{ - return m_lastError; -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RiaImageFileCompare::errorMessage() const -{ - return m_errorMsg; -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RiaImageFileCompare::errorDetails() const -{ - return m_errorDetails; -} +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RiaImageFileCompare.h" +#include + + +//================================================================================================== +// +// +// +//================================================================================================== + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaImageFileCompare::RiaImageFileCompare(QString compareExecutable) +: m_compareExecutable(compareExecutable) +{ + reset(); +} + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaImageFileCompare::~RiaImageFileCompare() +{ +} + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaImageFileCompare::reset() +{ + m_imagesEqual = false; + m_lastError = IC_NO_ERROR; + m_errorMsg = ""; + m_errorDetails = ""; +} + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiaImageFileCompare::runComparison(QString imgFileName, QString refFileName, QString diffFileName) +{ + reset(); + + if (m_compareExecutable.isEmpty()) + { + m_lastError = SEVERE_ERROR; + m_errorMsg = "Cannot compare images, no compare executable set"; + return false; + } + + + //QString args = QString("-fuzz 2% -lowlight-color white -metric ae \"%1\" \"%2\" \"%3\"").arg(imgFileName).arg(refFileName).arg((diffFileName)); + // The ImageMagick compare tool on RedHat 5 does not support the lowlight-color options + // Use GCC version as a crude mechanism for disabling use of this option on RedHat5 +#if (__GNUC__ == 4 && __GNUC_MINOR__ <= 1) + QString args = QString("-metric ae \"%1\" \"%2\" \"%3\"").arg(imgFileName).arg(refFileName).arg((diffFileName)); +#else + QString args = QString("-lowlight-color white -metric ae \"%1\" \"%2\" \"%3\"").arg(imgFileName).arg(refFileName).arg((diffFileName)); +#endif + QString completeCommand = QString("\"%1\" %2").arg(m_compareExecutable).arg(args); + + // Launch process and wait + QProcess proc; + proc.start(completeCommand); + proc.waitForFinished(30000); + + QProcess::ProcessError procError = proc.error(); + if (procError != QProcess::UnknownError) + { + m_lastError = SEVERE_ERROR; + m_errorMsg = "Error running compare tool process"; + m_errorDetails = completeCommand; + return false; + } + + QByteArray stdErr = proc.readAllStandardError(); + int procExitCode = proc.exitCode(); + if (procExitCode == 0) + { + // Strip out whitespace and look for 0 (as in zero pixel differences) + stdErr = stdErr.simplified(); + if (!stdErr.isEmpty() && stdErr[0] == '0') + { + m_imagesEqual = true; + } + + return true; + } + else + { + // Report non-severe error + m_lastError = IC_ERROR; + m_errorMsg = "Error running compare tool process"; + m_errorDetails = stdErr; + + return false; + } +} + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiaImageFileCompare::imagesEqual() const +{ + return m_imagesEqual; +} + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaImageFileCompare::ErrorType RiaImageFileCompare::error() const +{ + return m_lastError; +} + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaImageFileCompare::errorMessage() const +{ + return m_errorMsg; +} + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaImageFileCompare::errorDetails() const +{ + return m_errorDetails; +} diff --git a/ApplicationCode/Application/RiaPreferences.cpp b/ApplicationCode/Application/RiaPreferences.cpp index 3677e139d1..19454642f1 100644 --- a/ApplicationCode/Application/RiaPreferences.cpp +++ b/ApplicationCode/Application/RiaPreferences.cpp @@ -44,6 +44,7 @@ RiaPreferences::RiaPreferences(void) CAF_PDM_InitField(&defaultGridLines, "defaultGridLines", true, "Gridlines", "", "", ""); CAF_PDM_InitField(&defaultGridLineColors, "defaultGridLineColors", cvf::Color3f(0.92f, 0.92f, 0.92f), "Mesh color", "", "", ""); CAF_PDM_InitField(&defaultFaultGridLineColors, "defaultFaultGridLineColors", cvf::Color3f(0.08f, 0.08f, 0.08f), "Mesh color along faults", "", "", ""); + CAF_PDM_InitField(&defaultWellLabelColor, "defaultWellLableColor", cvf::Color3f(0.92f, 0.92f, 0.92f), "Well label color", "", "The default well label color in new views", ""); CAF_PDM_InitField(&defaultViewerBackgroundColor, "defaultViewerBackgroundColor", cvf::Color3f(0.69f, 0.77f, 0.87f), "Viewer background", "", "The viewer background color for new views", ""); @@ -102,7 +103,7 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& defaultSettingsGroup->add(&defaultGridLines); defaultSettingsGroup->add(&defaultGridLineColors); defaultSettingsGroup->add(&defaultFaultGridLineColors); - + defaultSettingsGroup->add(&defaultWellLabelColor); caf::PdmUiGroup* autoComputeGroup = uiOrdering.addNewGroup("Compute when loading new case"); autoComputeGroup->add(&autocomputeSOIL); diff --git a/ApplicationCode/Application/RiaPreferences.h b/ApplicationCode/Application/RiaPreferences.h index 6bc116f740..0f87fecc17 100644 --- a/ApplicationCode/Application/RiaPreferences.h +++ b/ApplicationCode/Application/RiaPreferences.h @@ -48,6 +48,7 @@ class RiaPreferences : public caf::PdmObject caf::PdmField defaultGridLineColors; caf::PdmField defaultFaultGridLineColors; caf::PdmField defaultViewerBackgroundColor; + caf::PdmField defaultWellLabelColor; caf::PdmField useShaders; caf::PdmField showHud; diff --git a/ApplicationCode/Application/RiaRegressionTest.cpp b/ApplicationCode/Application/RiaRegressionTest.cpp new file mode 100644 index 0000000000..9dc8c27f1d --- /dev/null +++ b/ApplicationCode/Application/RiaRegressionTest.cpp @@ -0,0 +1,60 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RiaRegressionTest.h" +#include "cafPdmUiFilePathEditor.h" + + +CAF_PDM_SOURCE_INIT(RiaRegressionTest, "RiaRegressionTest"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaRegressionTest::RiaRegressionTest(void) +{ + CAF_PDM_InitFieldNoDefault(&applicationWorkingFolder, "workingFolder", "Application Working Folder", "", "", ""); + applicationWorkingFolder.setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName()); + + CAF_PDM_InitFieldNoDefault(®ressionTestFolder, "regressionTestFolder", "Regression Test Folder", "", "", ""); + regressionTestFolder.setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName()); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaRegressionTest::~RiaRegressionTest(void) +{ + +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaRegressionTest::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) +{ + if (field == &applicationWorkingFolder || field == ®ressionTestFolder) + { + caf::PdmUiFilePathEditorAttribute* myAttr = static_cast(attribute); + if (myAttr) + { + myAttr->m_selectDirectory = true; + } + } +} + + diff --git a/ApplicationCode/Application/RiaRegressionTest.h b/ApplicationCode/Application/RiaRegressionTest.h new file mode 100644 index 0000000000..daa941dc61 --- /dev/null +++ b/ApplicationCode/Application/RiaRegressionTest.h @@ -0,0 +1,43 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + + +#include "cafPdmObject.h" +#include "cafPdmField.h" +#include "cafAppEnum.h" + + +class RiaRegressionTest : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; + +public: + RiaRegressionTest(void); + virtual ~RiaRegressionTest(void); + +public: + caf::PdmField applicationWorkingFolder; + caf::PdmField regressionTestFolder; + +protected: + virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute); + + +}; diff --git a/ApplicationCode/CMakeLists.txt b/ApplicationCode/CMakeLists.txt index 2d1900e2c0..be82147d67 100644 --- a/ApplicationCode/CMakeLists.txt +++ b/ApplicationCode/CMakeLists.txt @@ -36,6 +36,7 @@ set( APPLICATION_FILES Application/RiaPreferences.cpp Application/RiaImageFileCompare.cpp Application/RiaImageCompareReporter.cpp + Application/RiaRegressionTest.cpp ) set( USER_INTERFACE_FILES @@ -151,6 +152,7 @@ list( REMOVE_ITEM RAW_SOURCES Application/RiaImageFileCompare.cpp Application/RiaImageCompareReporter.cpp + Application/RiaRegressionTest.cpp FileInterface/RifEclipseInputFileTools.cpp FileInterface/RifEclipseOutputFileTools.cpp @@ -213,6 +215,7 @@ set( EXE_FILES ${WIN_RESOURCE} ${HEADER_FILES} ${REFERENCED_CMAKE_FILES} + ../ResInsightVersion.cmake ) add_executable( ResInsight ${EXE_FILES} ) diff --git a/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt b/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt index 685c558d68..475f353da7 100644 --- a/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt +++ b/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt @@ -15,9 +15,9 @@ include_directories( ${ResInsight_SOURCE_DIR}/ApplicationCode/ProjectDataModel ${ResInsight_SOURCE_DIR}/ThirdParty - ${ResInsight_SOURCE_DIR}/cafProjectDataModel + ${ResInsight_SOURCE_DIR}/Fwk/AppFwk/cafProjectDataModel - ${ResInsight_SOURCE_DIR}/CommonCode + ${ResInsight_SOURCE_DIR}/Fwk/AppFwk/CommonCode #Remove when RigStatistics is out ${ResInsight_SOURCE_DIR}/ApplicationCode/ModelVisualization @@ -47,7 +47,7 @@ source_group( "ReservoirDataModel" FILES ${CODE_SOURCE_FILES} ) set( CPP_SOURCES ${CPP_SOURCES} - ${ResInsight_SOURCE_DIR}/cafUserInterface/cafProgressInfo.cpp + ${ResInsight_SOURCE_DIR}/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp ) source_group( "Headers" FILES ${CODE_HEADER_FILES} ) diff --git a/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp b/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp index 2475babcae..ee46809f05 100644 --- a/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp +++ b/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp @@ -22,6 +22,7 @@ #include "ecl_file.h" #include "ecl_kw_magic.h" #include "ecl_grid.h" +#include "ecl_rsthead.h" #include #include @@ -91,25 +92,25 @@ void RifEclipseOutputFileTools::timeSteps(ecl_file_type* ecl_file, std::vector(floorDayValue)); + double dayFraction = dayValue - floorDayValue; int seconds = static_cast(dayFraction * 24.0 * 60.0 * 60.0); QTime time(0, 0); time = time.addSecs(seconds); - QDate reportDate = simulationStart; - reportDate = reportDate.addDays(static_cast(floorDayValue)); + reportDateTime.setTime(time); - QDateTime reportDateTime(reportDate, time); if (std::find(timeStepsFound.begin(), timeStepsFound.end(), reportDateTime) == timeStepsFound.end()) { timeStepsFound.push_back(reportDateTime); @@ -124,14 +125,10 @@ void RifEclipseOutputFileTools::timeSteps(ecl_file_type* ecl_file, std::vectorsetDrawBorder(false); drawableText->setDrawBackground(false); drawableText->setVerticalAlignment(cvf::TextDrawer::CENTER); - drawableText->setTextColor(cvf::Color3f(0.92f, 0.92f, 0.92f)); + drawableText->setTextColor(m_rimReservoirView->wellCollection()->wellLabelColor()); cvf::String cvfString = cvfqt::Utils::fromQString(well->name()); diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp index bfa7056413..a7b125e481 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -197,8 +197,7 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl drawableText->setDrawBorder(false); drawableText->setDrawBackground(false); drawableText->setVerticalAlignment(cvf::TextDrawer::CENTER); - //drawableText->setTextColor(cvf::Color3f(0.08f, 0.08f, 0.08f)); - drawableText->setTextColor(cvf::Color3f(0.92f, 0.92f, 0.92f)); + drawableText->setTextColor(m_wellPathCollection->wellPathLabelColor()); cvf::String cvfString = cvfqt::Utils::fromQString(m_rimWellPath->name()); diff --git a/ApplicationCode/ProjectDataModel/RimAnalysisModels.cpp b/ApplicationCode/ProjectDataModel/RimAnalysisModels.cpp index 165c76da7e..f148ec18da 100644 --- a/ApplicationCode/ProjectDataModel/RimAnalysisModels.cpp +++ b/ApplicationCode/ProjectDataModel/RimAnalysisModels.cpp @@ -27,7 +27,6 @@ #include "RimIdenticalGridCaseGroup.h" #include "RiaApplication.h" -#include "RiaVersionInfo.h" #include "RigGridManager.h" #include "RigCaseData.h" diff --git a/ApplicationCode/ProjectDataModel/RimCase.cpp b/ApplicationCode/ProjectDataModel/RimCase.cpp index 5185feb536..5c80453584 100644 --- a/ApplicationCode/ProjectDataModel/RimCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimCase.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "RifReaderEclipseOutput.h" #include "RifReaderMockModel.h" @@ -399,7 +400,7 @@ RimReservoirCellResultsStorage* RimCase::results(RifReaderInterface::PorosityMod //-------------------------------------------------------------------------------------------------- /// Relocate the supplied file name, based on the search path as follows: /// fileName, newProjectPath/fileNameWoPath, relocatedPath/fileNameWoPath -/// If the file is not found in any of the positions, the fileName is returned unchanged +/// If the file is not found in any of the positions, the fileName is returned but converted to Qt Style path separators: "/" /// /// The relocatedPath is found in this way: /// use the start of newProjectPath @@ -407,11 +408,33 @@ RimReservoirCellResultsStorage* RimCase::results(RifReaderInterface::PorosityMod /// such that the common start of oldProjectPath and m_gridFileName is removed from m_gridFileName /// and replaced with the start of newProjectPath up to where newProjectPath starts to be equal to oldProjectPath //-------------------------------------------------------------------------------------------------- -QString RimCase::relocateFile(const QString& fileName, const QString& newProjectPath, const QString& oldProjectPath, +QString RimCase::relocateFile(const QString& orgFileName, const QString& orgNewProjectPath, const QString& orgOldProjectPath, bool* foundFile, std::vector* searchedPaths) { if (foundFile) *foundFile = true; - + + // Make sure we have a Qt formatted path ( using "/" not "\") + QString fileName = QDir::fromNativeSeparators(orgFileName); + QString newProjectPath = QDir::fromNativeSeparators(orgNewProjectPath); + QString oldProjectPath = QDir::fromNativeSeparators(orgOldProjectPath); + + // If we from a file or whatever gets a real windows path on linux, we need to manually convert it + // because Qt will not. QDir::fromNativeSeparators does nothing on linux. + + bool isWindowsPath = false; + if (orgFileName.count("/")) isWindowsPath = false; // "/" are not allowed in a windows path + else if (orgFileName.count("\\") + && !QFile::exists(orgFileName)) // To make sure we do not convert single linux files containing "\" + { + isWindowsPath = true; + } + + if (isWindowsPath) + { + // Windows absolute path detected. transform. + fileName.replace(QString("\\"), QString("/")); + } + if (searchedPaths) searchedPaths->push_back(fileName); if (QFile::exists(fileName)) { diff --git a/ApplicationCode/ProjectDataModel/RimInputCase.cpp b/ApplicationCode/ProjectDataModel/RimInputCase.cpp index c12eae1f24..42a130e15b 100644 --- a/ApplicationCode/ProjectDataModel/RimInputCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimInputCase.cpp @@ -75,16 +75,22 @@ RimInputCase::~RimInputCase() /// Open the supplied file set. If no grid data has been read, it will first find the possible /// grid data among the files then read all supported properties from the files matching the grid //-------------------------------------------------------------------------------------------------- -void RimInputCase::openDataFileSet(const QStringList& filenames) +void RimInputCase::openDataFileSet(const QStringList& fileNames) { - if (filenames.contains("Input Mock Debug Model")) + if (fileNames.contains("Input Mock Debug Model Simple")) { - cvf::ref readerInterface = this->createMockModel(filenames[0]); + cvf::ref readerInterface = this->createMockModel(fileNames[0]); results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p()); results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p()); reservoirData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->computeDerivedData(); reservoirData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->computeDerivedData(); + + QFileInfo gridFileName(fileNames[0]); + QString caseName = gridFileName.completeBaseName(); + this->caseUserDescription = caseName; + + computeCachedData(); return; } @@ -97,11 +103,16 @@ void RimInputCase::openDataFileSet(const QStringList& filenames) // First find and read the grid data if (this->reservoirData()->mainGrid()->gridPointDimensions() == cvf::Vec3st(0,0,0)) { - for (int i = 0; i < filenames.size(); i++) + for (int i = 0; i < fileNames.size(); i++) { - if (RifEclipseInputFileTools::openGridFile(filenames[i], this->reservoirData())) + if (RifEclipseInputFileTools::openGridFile(fileNames[i], this->reservoirData())) { - m_gridFileName = filenames[i]; + m_gridFileName = fileNames[i]; + + QFileInfo gridFileName(fileNames[i]); + QString caseName = gridFileName.completeBaseName(); + + this->caseUserDescription = caseName; this->reservoirData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis); @@ -119,13 +130,13 @@ void RimInputCase::openDataFileSet(const QStringList& filenames) // Then read the properties possibly in the grid file QStringList filesToRead; - for (int i = 0; i < filenames.size(); i++) + for (int i = 0; i < fileNames.size(); i++) { size_t j; bool exist = false; for (j = 0; j < m_additionalFileNames().size(); j++) { - if (m_additionalFileNames()[j] == filenames[i]) + if (m_additionalFileNames()[j] == fileNames[i]) { exist = true; } @@ -133,7 +144,7 @@ void RimInputCase::openDataFileSet(const QStringList& filenames) if (!exist) { - filesToRead.push_back(filenames[i]); + filesToRead.push_back(fileNames[i]); } } @@ -171,7 +182,7 @@ bool RimInputCase::openEclipseGridFile() { cvf::ref readerInterface; - if (m_gridFileName().contains("Input Mock Debug Model")) + if (m_gridFileName().contains("Input Mock Debug Model Simple")) { readerInterface = this->createMockModel(this->m_gridFileName()); } diff --git a/ApplicationCode/ProjectDataModel/RimInputCase.h b/ApplicationCode/ProjectDataModel/RimInputCase.h index c421eb009b..7415796cdc 100644 --- a/ApplicationCode/ProjectDataModel/RimInputCase.h +++ b/ApplicationCode/ProjectDataModel/RimInputCase.h @@ -46,7 +46,7 @@ class RimInputCase : public RimCase caf::PdmField m_inputPropertyCollection; // File open methods - void openDataFileSet(const QStringList& filenames); + void openDataFileSet(const QStringList& fileNames); void loadAndSyncronizeInputProperties(); void removeProperty(RimInputProperty* inputProperty); diff --git a/ApplicationCode/ProjectDataModel/RimLegendConfig.cpp b/ApplicationCode/ProjectDataModel/RimLegendConfig.cpp index b6cd9bc1ff..b71d66fd4b 100644 --- a/ApplicationCode/ProjectDataModel/RimLegendConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimLegendConfig.cpp @@ -61,6 +61,8 @@ namespace caf { addItem(RimLegendConfig::OPPOSITE_NORMAL,"OPPOSITE_NORMAL", "Full color, Blue on top"); addItem(RimLegendConfig::WHITE_PINK, "WHITE_PIMK", "White to pink"); addItem(RimLegendConfig::PINK_WHITE, "PINK_WHITE", "Pink to white"); + addItem(RimLegendConfig::BLUE_WHITE_RED, "BLUE_WHITE_RED", "Blue, white, red"); + addItem(RimLegendConfig::RED_WHITE_BLUE, "RED_WHITE_BLUE", "Red, white, blue"); addItem(RimLegendConfig::WHITE_BLACK, "WHITE_BLACK", "White to black"); addItem(RimLegendConfig::BLACK_WHITE, "BLACK_WHITE", "Black to white"); setDefault(RimLegendConfig::NORMAL); @@ -104,13 +106,13 @@ RimLegendConfig::RimLegendConfig() m_localAutoNegClosestToZero(0) { CAF_PDM_InitObject("Legend Definition", ":/Legend.png", "", ""); - CAF_PDM_InitField(&m_numLevels, "NumberOfLevels", 8, "Number of levels", "", "",""); - CAF_PDM_InitField(&m_precision, "Precision", 2, "Precision", "", "",""); - CAF_PDM_InitField(&m_tickNumberFormat, "TickNumberFormat", caf::AppEnum(FIXED), "Precision", "", "",""); + CAF_PDM_InitField(&m_numLevels, "NumberOfLevels", 8, "Number of levels", "", "A hint on how many tick marks you whish.",""); + CAF_PDM_InitField(&m_precision, "Precision", 4, "Significant digits", "", "The number of significant digits displayed in the legend numbers",""); + CAF_PDM_InitField(&m_tickNumberFormat, "TickNumberFormat", caf::AppEnum(FIXED), "Number format", "", "",""); - CAF_PDM_InitField(&m_colorRangeMode, "ColorRangeMode", ColorRangeEnum(NORMAL) , "Color range", "", "", ""); + CAF_PDM_InitField(&m_colorRangeMode, "ColorRangeMode", ColorRangeEnum(NORMAL) , "Colors", "", "", ""); CAF_PDM_InitField(&m_mappingMode, "MappingMode", MappingEnum(LINEAR_CONTINUOUS) , "Mapping", "", "", ""); - CAF_PDM_InitField(&m_rangeMode, "RangeType", caf::AppEnum(AUTOMATIC_ALLTIMESTEPS), "Legend range type", "", "Switches between automatic and user defined range on the legend", ""); + CAF_PDM_InitField(&m_rangeMode, "RangeType", caf::AppEnum(AUTOMATIC_ALLTIMESTEPS), "Range type", "", "Switches between automatic and user defined range on the legend", ""); CAF_PDM_InitField(&m_userDefinedMaxValue, "UserDefinedMax", 1.0, "Max", "", "Min value of the legend", ""); CAF_PDM_InitField(&m_userDefinedMinValue, "UserDefinedMin", 0.0, "Min", "", "Max value of the legend", ""); CAF_PDM_InitField(&resultVariableName, "ResultVariableUsage", QString(""), "", "", "", ""); @@ -155,11 +157,11 @@ void RimLegendConfig::fieldChangedByUi(const caf::PdmFieldHandle* changedField, { if (m_userDefinedMaxValue == m_userDefinedMaxValue.defaultValue() && m_globalAutoMax != cvf::UNDEFINED_DOUBLE) { - m_userDefinedMaxValue = adjust(m_globalAutoMax, m_precision); + m_userDefinedMaxValue = roundToNumSignificantDigits(m_globalAutoMax, m_precision); } if (m_userDefinedMinValue == m_userDefinedMinValue.defaultValue() && m_globalAutoMin != cvf::UNDEFINED_DOUBLE) { - m_userDefinedMinValue = adjust(m_globalAutoMin, m_precision); + m_userDefinedMinValue = roundToNumSignificantDigits(m_globalAutoMin, m_precision); } } @@ -184,24 +186,24 @@ void RimLegendConfig::updateLegend() if (m_rangeMode == AUTOMATIC_ALLTIMESTEPS) { - adjustedMin = adjust(m_globalAutoMin, m_precision); - adjustedMax = adjust(m_globalAutoMax, m_precision); + adjustedMin = roundToNumSignificantDigits(m_globalAutoMin, m_precision); + adjustedMax = roundToNumSignificantDigits(m_globalAutoMax, m_precision); posClosestToZero = m_globalAutoPosClosestToZero; negClosestToZero = m_globalAutoNegClosestToZero; } else if (m_rangeMode == AUTOMATIC_CURRENT_TIMESTEP) { - adjustedMin = adjust(m_localAutoMin, m_precision); - adjustedMax = adjust(m_localAutoMax, m_precision); + adjustedMin = roundToNumSignificantDigits(m_localAutoMin, m_precision); + adjustedMax = roundToNumSignificantDigits(m_localAutoMax, m_precision); posClosestToZero = m_localAutoPosClosestToZero; negClosestToZero = m_localAutoNegClosestToZero; } else { - adjustedMin = adjust(m_userDefinedMinValue, m_precision); - adjustedMax = adjust(m_userDefinedMaxValue, m_precision); + adjustedMin = roundToNumSignificantDigits(m_userDefinedMinValue, m_precision); + adjustedMax = roundToNumSignificantDigits(m_userDefinedMaxValue, m_precision); posClosestToZero = m_globalAutoPosClosestToZero; negClosestToZero = m_globalAutoNegClosestToZero; @@ -277,7 +279,8 @@ void RimLegendConfig::updateLegend() legendColors.add(cvf::Color3ub( 0, 127, 255)); legendColors.add(cvf::Color3ub( 0, 0, 255)); } - break; case BLACK_WHITE: + break; + case BLACK_WHITE: case WHITE_BLACK: { legendColors.reserve(2); @@ -309,6 +312,25 @@ void RimLegendConfig::updateLegend() } } break; + case BLUE_WHITE_RED: + case RED_WHITE_BLUE: + { + legendColors.reserve(3); + if (m_colorRangeMode() == BLUE_WHITE_RED) + { + legendColors.add(cvf::Color3ub::BLUE); + legendColors.add(cvf::Color3ub::WHITE); + legendColors.add(cvf::Color3ub::RED); + } + else + { + legendColors.add(cvf::Color3ub::RED); + legendColors.add(cvf::Color3ub::WHITE); + legendColors.add(cvf::Color3ub::BLUE); + } + } + break; + } m_linDiscreteScalarMapper->setColors(legendColors); @@ -340,11 +362,35 @@ void RimLegendConfig::updateLegend() } m_legend->setScalarMapper(m_currentScalarMapper.p()); - m_legend->setTickPrecision(m_precision()); + double decadesInRange = 0; + + if (m_mappingMode == LOG10_CONTINUOUS || m_mappingMode == LOG10_DISCRETE) + { + // For log mapping, use the min value as reference for num valid digits + decadesInRange = cvf::Math::abs(adjustedMin) < cvf::Math::abs(adjustedMax) ? cvf::Math::abs(adjustedMin) : cvf::Math::abs(adjustedMax); + decadesInRange = log10(decadesInRange); + } + else + { + // For linear mapping, use the max value as reference for num valid digits + double absRange = CVF_MAX(cvf::Math::abs(adjustedMax), cvf::Math::abs(adjustedMin)); + decadesInRange = log10(absRange); + } + + decadesInRange = cvf::Math::ceil(decadesInRange); + // Using Fixed format NumberFormatType nft = m_tickNumberFormat(); m_legend->setTickFormat((cvf::OverlayScalarMapperLegend::NumberFormat)nft); + // Set the fixed number of digits after the decimal point to the number needed to show all the significant digits. + int numDecimalDigits = m_precision(); + if (nft != SCIENTIFIC) + { + numDecimalDigits -= static_cast(decadesInRange); + } + m_legend->setTickPrecision(cvf::Math::clamp(numDecimalDigits, 0, 20)); + if (m_globalAutoMax != cvf::UNDEFINED_DOUBLE ) { @@ -370,13 +416,45 @@ void RimLegendConfig::updateLegend() //-------------------------------------------------------------------------------------------------- void RimLegendConfig::setAutomaticRanges(double globalMin, double globalMax, double localMin, double localMax) { - m_globalAutoMin = adjust(globalMin, m_precision); - m_globalAutoMax = adjust(globalMax, m_precision); + double candidateGlobalAutoMin = roundToNumSignificantDigits(globalMin, m_precision); + double candidateGlobalAutoMax = roundToNumSignificantDigits(globalMax, m_precision); - m_localAutoMin = adjust(localMin, m_precision); - m_localAutoMax = adjust(localMax, m_precision); + double candidateLocalAutoMin = roundToNumSignificantDigits(localMin, m_precision); + double candidateLocalAutoMax = roundToNumSignificantDigits(localMax, m_precision); - updateLegend(); + bool needsUpdate = false; + const double epsilon = std::numeric_limits::epsilon(); + + if (cvf::Math::abs(candidateGlobalAutoMax - m_globalAutoMax) > epsilon) + { + needsUpdate = true; + } + + if (cvf::Math::abs(candidateGlobalAutoMin - m_globalAutoMin) > epsilon) + { + needsUpdate = true; + } + + if (cvf::Math::abs(candidateLocalAutoMax - m_localAutoMax) > epsilon) + { + needsUpdate = true; + } + + if (cvf::Math::abs(candidateLocalAutoMin - m_localAutoMin) > epsilon) + { + needsUpdate = true; + } + + if (needsUpdate) + { + m_globalAutoMin = candidateGlobalAutoMin; + m_globalAutoMax = candidateGlobalAutoMax; + + m_localAutoMin = candidateLocalAutoMin; + m_localAutoMax = candidateLocalAutoMax; + + updateLegend(); + } } //-------------------------------------------------------------------------------------------------- @@ -485,9 +563,9 @@ void RimLegendConfig::recreateLegend() } //-------------------------------------------------------------------------------------------------- -/// Adjust double value to given precision +/// Rounding the double value to given number of significant digits //-------------------------------------------------------------------------------------------------- -double RimLegendConfig::adjust(double domainValue, double precision) +double RimLegendConfig::roundToNumSignificantDigits(double domainValue, double numSignificantDigits) { double absDomainValue = cvf::Math::abs(domainValue); if (absDomainValue == 0.0) @@ -498,11 +576,13 @@ double RimLegendConfig::adjust(double domainValue, double precision) double logDecValue = log10(absDomainValue); logDecValue = cvf::Math::ceil(logDecValue); - double factor = pow(10.0, precision - logDecValue); + double factor = pow(10.0, numSignificantDigits - logDecValue); double tmp = domainValue * factor; double integerPart; - modf(tmp, &integerPart); + double fraction = modf(tmp, &integerPart); + + if (cvf::Math::abs(fraction)>= 0.5) (integerPart >= 0) ? integerPart++: integerPart-- ; double newDomainValue = integerPart / factor; @@ -514,16 +594,57 @@ double RimLegendConfig::adjust(double domainValue, double precision) //-------------------------------------------------------------------------------------------------- void RimLegendConfig::setClosestToZeroValues(double globalPosClosestToZero, double globalNegClosestToZero, double localPosClosestToZero, double localNegClosestToZero) { - m_globalAutoPosClosestToZero = globalPosClosestToZero; - m_globalAutoNegClosestToZero = globalNegClosestToZero; - m_localAutoPosClosestToZero = localPosClosestToZero; - m_localAutoNegClosestToZero = localNegClosestToZero; + bool needsUpdate = false; + const double epsilon = std::numeric_limits::epsilon(); + + if (cvf::Math::abs(globalPosClosestToZero - m_globalAutoPosClosestToZero) > epsilon) + { + needsUpdate = true; + } + if (cvf::Math::abs(globalNegClosestToZero - m_globalAutoNegClosestToZero) > epsilon) + { + needsUpdate = true; + } + if (cvf::Math::abs(localPosClosestToZero - m_localAutoPosClosestToZero) > epsilon) + { + needsUpdate = true; + } + if (cvf::Math::abs(localNegClosestToZero - m_localAutoNegClosestToZero) > epsilon) + { + needsUpdate = true; + } + + if (needsUpdate) + { + m_globalAutoPosClosestToZero = globalPosClosestToZero; + m_globalAutoNegClosestToZero = globalNegClosestToZero; + m_localAutoPosClosestToZero = localPosClosestToZero; + m_localAutoNegClosestToZero = localNegClosestToZero; - if (m_globalAutoPosClosestToZero == HUGE_VAL) m_globalAutoPosClosestToZero = 0; - if (m_globalAutoNegClosestToZero == -HUGE_VAL) m_globalAutoNegClosestToZero = 0; - if (m_localAutoPosClosestToZero == HUGE_VAL) m_localAutoPosClosestToZero = 0; - if (m_localAutoNegClosestToZero == -HUGE_VAL) m_localAutoNegClosestToZero = 0; + if (m_globalAutoPosClosestToZero == HUGE_VAL) m_globalAutoPosClosestToZero = 0; + if (m_globalAutoNegClosestToZero == -HUGE_VAL) m_globalAutoNegClosestToZero = 0; + if (m_localAutoPosClosestToZero == HUGE_VAL) m_localAutoPosClosestToZero = 0; + if (m_localAutoNegClosestToZero == -HUGE_VAL) m_localAutoNegClosestToZero = 0; - updateLegend(); + updateLegend(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimLegendConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) +{ + caf::PdmUiOrdering * formatGr = uiOrdering.addNewGroup("Format"); + formatGr->add(&m_numLevels); + formatGr->add(&m_precision); + formatGr->add(&m_tickNumberFormat); + formatGr->add(&m_colorRangeMode); + + caf::PdmUiOrdering * mappingGr = uiOrdering.addNewGroup("Mapping"); + mappingGr->add(&m_mappingMode); + mappingGr->add(&m_rangeMode); + mappingGr->add(&m_userDefinedMaxValue); + mappingGr->add(&m_userDefinedMinValue); } diff --git a/ApplicationCode/ProjectDataModel/RimLegendConfig.h b/ApplicationCode/ProjectDataModel/RimLegendConfig.h index 40975643ec..f031c1e66d 100644 --- a/ApplicationCode/ProjectDataModel/RimLegendConfig.h +++ b/ApplicationCode/ProjectDataModel/RimLegendConfig.h @@ -68,7 +68,9 @@ class RimLegendConfig: public caf::PdmObject WHITE_PINK, PINK_WHITE, WHITE_BLACK, - BLACK_WHITE + BLACK_WHITE, + BLUE_WHITE_RED, + RED_WHITE_BLUE }; typedef caf::AppEnum ColorRangeEnum; @@ -90,17 +92,20 @@ class RimLegendConfig: public caf::PdmObject void setPosition(cvf::Vec2ui position); cvf::ScalarMapper* scalarMapper() { return m_currentScalarMapper.p(); } - cvf::OverlayScalarMapperLegend* legend() { return m_legend.p(); } - void updateLegend(); + cvf::OverlayScalarMapperLegend* legend() { return m_legend.p(); } protected: virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); virtual void initAfterRead(); + virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ); private: + void updateLegend(); void updateFieldVisibility(); cvf::ref interpolateColorArray(const cvf::Color3ubArray& colorArray, cvf::uint targetColorCount); - double adjust(double value, double precision); - + double roundToNumSignificantDigits(double value, double precision); + + + private: caf::PdmPointer m_reservoirView; @@ -110,7 +115,7 @@ class RimLegendConfig: public caf::PdmObject cvf::ref m_linSmoothScalarMapper; cvf::ref m_currentScalarMapper; - cvf::ref m_legend; + cvf::ref m_legend; double m_globalAutoMax; double m_globalAutoMin; diff --git a/ApplicationCode/ProjectDataModel/RimOilField.cpp b/ApplicationCode/ProjectDataModel/RimOilField.cpp index 81b2ee3639..8f078071de 100644 --- a/ApplicationCode/ProjectDataModel/RimOilField.cpp +++ b/ApplicationCode/ProjectDataModel/RimOilField.cpp @@ -25,7 +25,6 @@ #include "RimIdenticalGridCaseGroup.h" #include "RiaApplication.h" -#include "RiaVersionInfo.h" #include "RigGridManager.h" #include "RigCaseData.h" diff --git a/ApplicationCode/ProjectDataModel/RimProject.cpp b/ApplicationCode/ProjectDataModel/RimProject.cpp index 347e80e75d..4a281d795c 100644 --- a/ApplicationCode/ProjectDataModel/RimProject.cpp +++ b/ApplicationCode/ProjectDataModel/RimProject.cpp @@ -74,6 +74,7 @@ RimProject::RimProject(void) CAF_PDM_InitFieldNoDefault(&wellPathImport, "WellPathImport", "WellPathImport", "", "", ""); wellPathImport = new RimWellPathImport(); wellPathImport.setUiHidden(true); + wellPathImport.setUiChildrenHidden(true); CAF_PDM_InitFieldNoDefault(&commandObjects, "CommandObjects", "CommandObjects", "", "", ""); //wellPathImport.setUiHidden(true); diff --git a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp index 9db070259b..c54598f23c 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirView.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirView.cpp @@ -1090,7 +1090,7 @@ void RimReservoirView::appendCellResultInfo(size_t gridIndex, size_t cellIndex, const RigWellResultPoint* wellResultCell = wellResultFrame.findResultCell(gridIndex, cellIndex); if (wellResultCell) { - resultInfoText->append(QString("Well-cell connection info: Well Name: %1 Branch Id: %2 Segment Id: %3\n").arg(singleWellResultData->m_wellName).arg(wellResultCell->m_ertBranchId +1).arg(wellResultCell->m_ertSegmentId+1)); + resultInfoText->append(QString("Well-cell connection info: Well Name: %1 Branch Id: %2 Segment Id: %3\n").arg(singleWellResultData->m_wellName).arg(wellResultCell->m_ertBranchId).arg(wellResultCell->m_ertSegmentId)); } } } @@ -1431,12 +1431,16 @@ void RimReservoirView::calculateVisibleWellCellsIncFence(cvf::UByteArray* visibl const std::vector< RigWellResultFrame >& wellResFrames = wres->m_wellCellsTimeSteps; for (size_t wfIdx = 0; wfIdx < wellResFrames.size(); ++wfIdx) { - // Add the wellhead cell - + // Add the wellhead cell if it is active if (wellResFrames[wfIdx].m_wellHead.m_gridIndex == grid->gridIndex()) { size_t gridCellIndex = wellResFrames[wfIdx].m_wellHead.m_gridCellIndex; - (*visibleCells)[gridCellIndex] = true; + size_t globalGridCellIndex = grid->globalGridCellIndex(gridCellIndex); + + if (activeCellInfo->isActive(globalGridCellIndex)) + { + (*visibleCells)[gridCellIndex] = true; + } } // Add all the cells from the branches diff --git a/ApplicationCode/ProjectDataModel/RimResultCase.cpp b/ApplicationCode/ProjectDataModel/RimResultCase.cpp index 97b7adaf4f..b4098e4408 100644 --- a/ApplicationCode/ProjectDataModel/RimResultCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimResultCase.cpp @@ -296,7 +296,12 @@ void RimResultCase::updateFilePathsFromProjectPath(const QString& newProjectPath // Update filename and folder paths when opening project from a different file location caseFileName = relocateFile(caseFileName(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths); - + +#if 0 // Output the search path for debugging + for (size_t i = 0; i < searchedPaths.size(); ++i) + qDebug() << searchedPaths[i]; +#endif + } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimUiTreeModelPdm.cpp b/ApplicationCode/ProjectDataModel/RimUiTreeModelPdm.cpp index 4ffd8b299e..68ec961b7c 100644 --- a/ApplicationCode/ProjectDataModel/RimUiTreeModelPdm.cpp +++ b/ApplicationCode/ProjectDataModel/RimUiTreeModelPdm.cpp @@ -147,11 +147,13 @@ bool RimUiTreeModelPdm::deletePropertyFilter(const QModelIndex& itemIndex) bool wasSomeFilterActive = propertyFilterCollection->hasActiveFilters(); // Remove Ui items pointing at the pdm object to delete - removeRows_special(itemIndex.row(), 1, itemIndex.parent()); + removeRows_special(itemIndex.row(), 1, itemIndex.parent()); // To be deleted propertyFilterCollection->remove(propertyFilter); delete propertyFilter; + // updateUiSubTree(propertyFilterCollection); // To be enabled + if (wasFilterActive) { propertyFilterCollection->reservoirView()->scheduleGeometryRegen(RivReservoirViewPartMgr::PROPERTY_FILTERED); @@ -187,11 +189,13 @@ bool RimUiTreeModelPdm::deleteRangeFilter(const QModelIndex& itemIndex) bool wasSomeFilterActive = rangeFilterCollection->hasActiveFilters(); // Remove Ui items pointing at the pdm object to delete - removeRows_special(itemIndex.row(), 1, itemIndex.parent()); + removeRows_special(itemIndex.row(), 1, itemIndex.parent()); // To be deleted rangeFilterCollection->remove(rangeFilter); delete rangeFilter; + // updateUiSubTree(rangeFilterCollection); // To be enabled + if (wasFilterActive) { rangeFilterCollection->reservoirView()->scheduleGeometryRegen(RivReservoirViewPartMgr::PROPERTY_FILTERED); @@ -221,11 +225,12 @@ bool RimUiTreeModelPdm::deleteReservoirView(const QModelIndex& itemIndex) CVF_ASSERT(reservoirView); // Remove Ui items pointing at the pdm object to delete - removeRows_special(itemIndex.row(), 1, itemIndex.parent()); + removeRows_special(itemIndex.row(), 1, itemIndex.parent()); // To be deleted reservoirView->eclipseCase()->removeReservoirView(reservoirView); delete reservoirView; + // updateUiSubTree(reservoirView->eclipseCase()); // To be enabled clearClipboard(); return true; @@ -591,38 +596,28 @@ RimIdenticalGridCaseGroup* RimUiTreeModelPdm::addCaseGroup(QModelIndex& inserted RimProject* proj = RiaApplication::instance()->project(); CVF_ASSERT(proj); - QModelIndex scriptModelIndex = getModelIndexFromPdmObject(proj->scriptCollection()); - if (!scriptModelIndex.isValid()) return NULL; - - caf::PdmUiTreeItem* currentItem = getTreeItemFromIndex(scriptModelIndex); - if (!currentItem) return NULL; + RimAnalysisModels* analysisModels = proj->activeOilField() ? proj->activeOilField()->analysisModels() : NULL; - QModelIndex rootIndex = scriptModelIndex.parent(); - caf::PdmUiTreeItem* rootTreeItem = currentItem->parent(); + if (analysisModels) + { + RimIdenticalGridCaseGroup* createdObject = new RimIdenticalGridCaseGroup; + proj->assignIdToCaseGroup(createdObject); - // New case group is inserted before the last item, the script item - int position = rootTreeItem->childCount() - 1; + RimCase* createdReservoir = createdObject->createAndAppendStatisticsCase(); + proj->assignCaseIdToCase(createdReservoir); + createdObject->name = QString("Grid Case Group %1").arg(analysisModels->caseGroups().size() + 1); - beginInsertRows(rootIndex, position, position); + analysisModels->caseGroups().push_back(createdObject); - RimIdenticalGridCaseGroup* createdObject = new RimIdenticalGridCaseGroup; - proj->assignIdToCaseGroup(createdObject); + this->updateUiSubTree(analysisModels); + insertedModelIndex = getModelIndexFromPdmObject(createdObject); - RimCase* createdReservoir = createdObject->createAndAppendStatisticsCase(); - proj->assignCaseIdToCase(createdReservoir); - createdObject->name = QString("Grid Case Group %1").arg(position + 1); - RimAnalysisModels* analysisModels = proj->activeOilField() ? proj->activeOilField()->analysisModels() : NULL; - if (analysisModels) + return createdObject; + } + else { - analysisModels->caseGroups().push_back(createdObject); + return NULL; } - - caf::PdmUiTreeItem* childItem = caf::UiTreeItemBuilderPdm::buildViewItems(rootTreeItem, position, createdObject); - endInsertRows(); - - insertedModelIndex = index(position, 0, rootIndex); - - return createdObject; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellCollection.cpp index 4c62e30e96..a71ffa80f2 100644 --- a/ApplicationCode/ProjectDataModel/RimWellCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellCollection.cpp @@ -29,6 +29,8 @@ #include "Rim3dOverlayInfoConfig.h" #include "RimCellEdgeResultSlot.h" +#include "RiaApplication.h" +#include "RiaPreferences.h" namespace caf { @@ -93,6 +95,8 @@ RimWellCollection::RimWellCollection() CAF_PDM_InitField(&showWellLabel, "ShowWellLabel", true, "Show well labels", "", "", ""); CAF_PDM_InitField(&wellHeadScaleFactor, "WellHeadScale", 1.0, "Well head scale", "", "", ""); CAF_PDM_InitField(&wellHeadPosition, "WellHeadPosition", WellHeadPositionEnum(WELLHEAD_POS_TOP_COLUMN), "Well head position", "", "", ""); + cvf::Color3f defWellLabelColor = RiaApplication::instance()->preferences()->defaultWellLabelColor(); + CAF_PDM_InitField(&wellLabelColor, "WellLabelColor", defWellLabelColor, "Well label color", "", "", ""); CAF_PDM_InitField(&wellPipeVisibility, "GlobalWellPipeVisibility", WellVisibilityEnum(PIPES_OPEN_IN_VISIBLE_CELLS), "Global well pipe visibility", "", "", ""); @@ -243,7 +247,8 @@ void RimWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField || &wellHeadScaleFactor == changedField || &showWellHead == changedField || &isAutoDetectingBranches == changedField - || &wellHeadPosition == changedField) + || &wellHeadPosition == changedField + || &wellLabelColor == changedField) { if (m_reservoirView) { @@ -276,6 +281,7 @@ void RimWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin wellHeadGroup->add(&wellHeadScaleFactor); wellHeadGroup->add(&showWellLabel); wellHeadGroup->add(&wellHeadPosition); + wellHeadGroup->add(&wellLabelColor); caf::PdmUiGroup* wellPipe = uiOrdering.addNewGroup("Well pipe"); wellPipe->add(&wellPipeVisibility); diff --git a/ApplicationCode/ProjectDataModel/RimWellCollection.h b/ApplicationCode/ProjectDataModel/RimWellCollection.h index 7ba1a65227..515574bf41 100644 --- a/ApplicationCode/ProjectDataModel/RimWellCollection.h +++ b/ApplicationCode/ProjectDataModel/RimWellCollection.h @@ -76,6 +76,8 @@ class RimWellCollection : public caf::PdmObject caf::PdmField showWellLabel; + caf::PdmField wellLabelColor; + caf::PdmField isActive; caf::PdmField wellCellsToRangeFilterMode; @@ -91,6 +93,7 @@ class RimWellCollection : public caf::PdmObject caf::PdmField showWellHead; caf::PdmField wellHeadPosition; + caf::PdmField isAutoDetectingBranches; caf::PdmPointersField wells; diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp index ae46561b5d..0a85ecf37b 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp @@ -20,6 +20,7 @@ #include "cafAppEnum.h" #include "cafPdmFieldCvfColor.h" +#include "cafProgressInfo.h" #include "RimWellPathCollection.h" #include "RimWellPath.h" @@ -41,6 +42,9 @@ #include "RimAnalysisModels.h" #include +#include "RiaApplication.h" +#include "RiaPreferences.h" + namespace caf { template<> @@ -64,6 +68,9 @@ RimWellPathCollection::RimWellPathCollection() CAF_PDM_InitField(&showWellPathLabel, "ShowWellPathLabel", true, "Show well path labels", "", "", ""); + cvf::Color3f defWellLabelColor = RiaApplication::instance()->preferences()->defaultWellLabelColor(); + CAF_PDM_InitField(&wellPathLabelColor, "WellPathLabelColor", defWellLabelColor, "Well label color", "", "", ""); + CAF_PDM_InitField(&wellPathVisibility, "GlobalWellPathVisibility", WellVisibilityEnum(ALL_ON), "Global well path visibility", "", "", ""); CAF_PDM_InitField(&wellPathRadiusScaleFactor, "WellPathRadiusScale", 0.1, "Well Path radius scale", "", "", ""); @@ -122,9 +129,14 @@ void RimWellPathCollection::setProject( RimProject* project ) //-------------------------------------------------------------------------------------------------- void RimWellPathCollection::readWellPathFiles() { + caf::ProgressInfo progress(wellPaths.size(), "Reading well paths from file"); + for (size_t wpIdx = 0; wpIdx < wellPaths.size(); wpIdx++) { wellPaths[wpIdx]->readWellPathFile(); + + progress.setProgressDescription(QString("Reading file %1").arg(wellPaths[wpIdx]->name)); + progress.incrementProgress(); } } diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.h b/ApplicationCode/ProjectDataModel/RimWellPathCollection.h index 5aa5c5e773..e8ab58a0b7 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.h +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.h @@ -52,6 +52,7 @@ class RimWellPathCollection : public caf::PdmObject typedef caf::AppEnum WellVisibilityEnum; caf::PdmField showWellPathLabel; + caf::PdmField wellPathLabelColor; caf::PdmField wellPathVisibility; caf::PdmField wellPathRadiusScaleFactor; diff --git a/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt b/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt index 3ed2140ef2..732f0927cf 100644 --- a/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt +++ b/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt @@ -19,9 +19,9 @@ include_directories( ${ResInsight_SOURCE_DIR}/ApplicationCode/ProjectDataModel ${ResInsight_SOURCE_DIR}/ThirdParty - ${ResInsight_SOURCE_DIR}/cafProjectDataModel + ${ResInsight_SOURCE_DIR}/Fwk/AppFwk/cafProjectDataModel - ${ResInsight_SOURCE_DIR}/CommonCode + ${ResInsight_SOURCE_DIR}/Fwk/AppFwk/CommonCode #Remove when RigStatistics is out #${ResInsight_SOURCE_DIR}/ApplicationCode/ModelVisualization @@ -33,7 +33,7 @@ include ("${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists_files.cmake") set( UNIT_TEST_CPP_SOURCES - ${ResInsight_SOURCE_DIR}/cafUserInterface/cafProgressInfo.cpp + ${ResInsight_SOURCE_DIR}/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp main.cpp RigActiveCellInfo-Test.cpp diff --git a/ApplicationCode/ReservoirDataModel/RigCaseData.cpp b/ApplicationCode/ReservoirDataModel/RigCaseData.cpp index 5884f68ebf..c9483020e0 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCaseData.cpp @@ -164,10 +164,15 @@ void RigCaseData::computeWellCellsPrGrid() size_t gridIndex = wellCells.m_wellHead.m_gridIndex; size_t gridCellIndex = wellCells.m_wellHead.m_gridCellIndex; - if (gridIndex != cvf::UNDEFINED_SIZE_T && gridCellIndex != cvf::UNDEFINED_SIZE_T) + if (gridIndex < m_wellCellsInGrid.size() && gridCellIndex < m_wellCellsInGrid[gridIndex]->size()) { - m_wellCellsInGrid[gridIndex]->set(gridCellIndex, true); - m_gridCellToWellIndex[gridIndex]->set(gridCellIndex, static_cast(wIdx)); + size_t globalGridCellIndex = grids[gridIndex]->globalGridCellIndex(gridCellIndex); + if (m_activeCellInfo->isActive(globalGridCellIndex) + || m_fractureActiveCellInfo->isActive(globalGridCellIndex)) + { + m_wellCellsInGrid[gridIndex]->set(gridCellIndex, true); + m_gridCellToWellIndex[gridIndex]->set(gridCellIndex, static_cast(wIdx)); + } } size_t sIdx; diff --git a/ApplicationCode/ReservoirDataModel/RigStatisticsMath.cpp b/ApplicationCode/ReservoirDataModel/RigStatisticsMath.cpp index a6148b98ee..3a7435407c 100644 --- a/ApplicationCode/ReservoirDataModel/RigStatisticsMath.cpp +++ b/ApplicationCode/ReservoirDataModel/RigStatisticsMath.cpp @@ -20,6 +20,8 @@ #include #include #include +#include "cvfBase.h" +#include "cvfMath.h" //-------------------------------------------------------------------------------------------------- /// A function to do basic statistical calculations @@ -103,7 +105,7 @@ std::vector RigStatisticsMath::calculateNearestRankPercentiles(const std { double pVal = HUGE_VAL; - size_t pValIndex = static_cast(sortedValues.size() * fabs(pValPositions[i]) / 100); + size_t pValIndex = static_cast(sortedValues.size() * cvf::Math::abs(pValPositions[i]) / 100); if (pValIndex >= sortedValues.size() ) pValIndex = sortedValues.size() - 1; @@ -142,7 +144,7 @@ std::vector RigStatisticsMath::calculateInterpolatedPercentiles(const st { double pVal = HUGE_VAL; - double doubleIndex = (sortedValues.size() - 1) * fabs(pValPositions[i]) / 100.0; + double doubleIndex = (sortedValues.size() - 1) * cvf::Math::abs(pValPositions[i]) / 100.0; size_t lowerValueIndex = static_cast(floor(doubleIndex)); size_t upperValueIndex = lowerValueIndex + 1; diff --git a/ApplicationCode/RiaMain.cpp b/ApplicationCode/RiaMain.cpp index b930b3449f..7ff10cc256 100644 --- a/ApplicationCode/RiaMain.cpp +++ b/ApplicationCode/RiaMain.cpp @@ -26,15 +26,12 @@ int main(int argc, char *argv[]) RiaApplication app(argc, argv); QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates)); + setlocale(LC_NUMERIC,"C"); RiuMainWindow window; QString platform = cvf::System::is64Bit() ? "(64bit)" : "(32bit)"; window.setWindowTitle("ResInsight " + platform); -#ifdef CVF_LINUX - window.resize(1000, 806); -#else - window.resize(1000, 800); -#endif + window.setDefaultWindowSize(); window.show(); if (app.parseArguments()) diff --git a/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp b/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp index d938825803..2ec5878cb6 100644 --- a/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaGeometryCommands.cpp @@ -18,6 +18,7 @@ #include "RiaStdInclude.h" #include "RiaSocketCommand.h" #include "RiaSocketServer.h" +#include "RiaSocketTools.h" #include "RimReservoirView.h" #include "RimResultSlot.h" @@ -45,20 +46,9 @@ class RiaGetCellCenters : public RiaSocketCommand virtual bool interpretCommand(RiaSocketServer* server, const QList& args, QDataStream& socketStream) { - int argCaseGroupId = -1; - size_t argGridIndex = 0; + RimCase* rimCase = RiaSocketTools::findCaseFromArgs(server, args); + size_t argGridIndex = args[2].toUInt(); - if (args.size() == 2) - { - argGridIndex = args[1].toInt(); - } - else if (args.size() == 3) - { - argCaseGroupId = args[1].toInt(); - argGridIndex = args[2].toUInt(); - } - - RimCase* rimCase = server->findReservoir(argCaseGroupId); if (!rimCase || !rimCase->reservoirData() || (argGridIndex >= rimCase->reservoirData()->gridCount()) ) { // No data available @@ -135,37 +125,10 @@ class RiaGetActiveCellCenters : public RiaSocketCommand virtual bool interpretCommand(RiaSocketServer* server, const QList& args, QDataStream& socketStream) { - int argCaseGroupId = -1; - QString porosityModelName; + RimCase* rimCase = RiaSocketTools::findCaseFromArgs(server, args); - if (args.size() == 2) - { - bool numberConversionOk = false; - int tmpValue = args[1].toInt(&numberConversionOk); - if (numberConversionOk) - { - argCaseGroupId = tmpValue; - } - else - { - porosityModelName = args[1]; - } - } - else if (args.size() == 3) - { - bool numberConversionOk = false; - int tmpValue = args[1].toInt(&numberConversionOk); - if (numberConversionOk) - { - argCaseGroupId = args[1].toUInt(); - porosityModelName = args[2]; - } - else - { - argCaseGroupId = args[2].toUInt(); - porosityModelName = args[1]; - } - } + QString porosityModelName; + porosityModelName = args[2]; RifReaderInterface::PorosityModelResultType porosityModelEnum = RifReaderInterface::MATRIX_RESULTS; if (porosityModelName.toUpper() == "FRACTURE") @@ -173,7 +136,6 @@ class RiaGetActiveCellCenters : public RiaSocketCommand porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS; } - RimCase* rimCase = server->findReservoir(argCaseGroupId); if (!rimCase || !rimCase->reservoirData()) { // No data available @@ -240,20 +202,9 @@ class RiaGetCellCorners : public RiaSocketCommand virtual bool interpretCommand(RiaSocketServer* server, const QList& args, QDataStream& socketStream) { - int argCaseGroupId = -1; - size_t argGridIndex = 0; + RimCase* rimCase = RiaSocketTools::findCaseFromArgs(server, args); + size_t argGridIndex = args[2].toUInt(); - if (args.size() == 2) - { - argGridIndex = args[1].toInt(); - } - else if (args.size() == 3) - { - argCaseGroupId = args[1].toInt(); - argGridIndex = args[2].toUInt(); - } - - RimCase* rimCase = server->findReservoir(argCaseGroupId); if (!rimCase || !rimCase->reservoirData() || (argGridIndex >= rimCase->reservoirData()->gridCount()) ) { // No data available @@ -335,37 +286,10 @@ class RiaGetActiveCellCorners : public RiaSocketCommand virtual bool interpretCommand(RiaSocketServer* server, const QList& args, QDataStream& socketStream) { - int argCaseGroupId = -1; - QString porosityModelName; + RimCase* rimCase = RiaSocketTools::findCaseFromArgs(server, args); - if (args.size() == 2) - { - bool numberConversionOk = false; - int tmpValue = args[1].toInt(&numberConversionOk); - if (numberConversionOk) - { - argCaseGroupId = tmpValue; - } - else - { - porosityModelName = args[1]; - } - } - else if (args.size() == 3) - { - bool numberConversionOk = false; - int tmpValue = args[1].toInt(&numberConversionOk); - if (numberConversionOk) - { - argCaseGroupId = args[1].toUInt(); - porosityModelName = args[2]; - } - else - { - argCaseGroupId = args[2].toUInt(); - porosityModelName = args[1]; - } - } + QString porosityModelName; + porosityModelName = args[2]; RifReaderInterface::PorosityModelResultType porosityModelEnum = RifReaderInterface::MATRIX_RESULTS; if (porosityModelName.toUpper() == "FRACTURE") @@ -373,7 +297,6 @@ class RiaGetActiveCellCorners : public RiaSocketCommand porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS; } - RimCase* rimCase = server->findReservoir(argCaseGroupId); if (!rimCase || !rimCase->reservoirData() ) { // No data available diff --git a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp index 60a32e837f..40dc5d2efd 100644 --- a/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaPropertyDataCommands.cpp @@ -21,6 +21,7 @@ #include "RiaSocketTools.h" #include "RiuMainWindow.h" +#include "RiuProcessMonitor.h" #include "RigCaseData.h" #include "RigCaseCellResultsData.h" @@ -483,20 +484,17 @@ class RiaSetActiveCellProperty: public RiaSocketCommand if (m_invalidActiveCellCountDetected) return true; - if (!currentClient->bytesAvailable()) return false; + // If nothing should be read, or we already have read everything, do nothing - QDataStream socketStream(currentClient); - socketStream.setVersion(riOctavePlugin::qtDataStreamVersion); + if ((m_timeStepCountToRead == 0) || (m_currentTimeStepNumberToRead >= m_timeStepCountToRead) ) return true; + + if (!currentClient->bytesAvailable()) return false; if (m_timeStepCountToRead != m_requestedTimesteps.size()) { CVF_ASSERT(false); } - // If nothing should be read, or we already have read everything, do nothing - - if ((m_timeStepCountToRead == 0) || (m_currentTimeStepNumberToRead >= m_timeStepCountToRead) ) return true; - // Check if a complete timestep is available, return and whait for readyRead() if not if (currentClient->bytesAvailable() < (int)m_bytesPerTimeStepToRead) return false; @@ -542,6 +540,9 @@ class RiaSetActiveCellProperty: public RiaSocketCommand internalMatrixData = readBuffer.data(); } + QDataStream socketStream(currentClient); + socketStream.setVersion(riOctavePlugin::qtDataStreamVersion); + // Read available complete timestepdata while ((currentClient->bytesAvailable() >= (int)m_bytesPerTimeStepToRead) && (m_currentTimeStepNumberToRead < m_timeStepCountToRead)) @@ -656,6 +657,7 @@ class RiaSetActiveCellProperty: public RiaSocketCommand static bool RiaSetActiveCellProperty_init = RiaSocketCommandFactory::instance()->registerCreator(RiaSetActiveCellProperty::commandName()); + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -705,7 +707,10 @@ class RiaSetGridProperty : public RiaSocketCommand // Read header - if (server->currentClient()->bytesAvailable() < (int)sizeof(quint64)*5) return true; + if (server->currentClient()->bytesAvailable() < (int)sizeof(quint64)*5) + { + return true; + } quint64 cellCountI = 0; quint64 cellCountJ = 0; @@ -729,6 +734,8 @@ class RiaSetGridProperty : public RiaSocketCommand { server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Zero data to read for ") + ":\"" + m_currentReservoir->caseUserDescription() + "\"\n"); + + return true; } @@ -791,6 +798,7 @@ class RiaSetGridProperty : public RiaSocketCommand if (timeStepReadError) { server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: riGetActiveCellProperty : \n") + RiaSocketServer::tr("An error occured while interpreting the requested timesteps.")); + return true; } } @@ -826,12 +834,17 @@ class RiaSetGridProperty : public RiaSocketCommand virtual bool interpretMore(RiaSocketServer* server, QTcpSocket* currentClient) { - if (m_invalidDataDetected) return true; - if (!currentClient->bytesAvailable()) return false; + if (m_invalidDataDetected){ + RiuMainWindow::instance()->processMonitor()->addStringToLog("[ResInsight SocketServer] > True \n"); + return true; + } - QDataStream socketStream(currentClient); - socketStream.setVersion(riOctavePlugin::qtDataStreamVersion); + // If nothing should be read, or we already have read everything, do nothing + + if ((m_timeStepCountToRead == 0) || (m_currentTimeStepNumberToRead >= m_timeStepCountToRead) ) return true; + + if (!currentClient->bytesAvailable()) return false; RigGridBase* grid = m_currentReservoir->reservoirData()->grid(m_currentGridIndex); if (!grid) @@ -840,19 +853,7 @@ class RiaSetGridProperty : public RiaSocketCommand RiaSocketServer::tr("No grid found") + ":\"" + m_currentReservoir->caseUserDescription() + "\"\n"); m_invalidDataDetected = true; - currentClient->abort(); - - return true; - } - - // Do nothing if we have not enough data - if (m_timeStepCountToRead == 0 || m_bytesPerTimeStepToRead == 0) - { - server->errorMessageDialog()->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + - RiaSocketServer::tr("Zero data to read for ") + ":\"" + m_currentReservoir->caseUserDescription() + "\"\n"); - - m_invalidDataDetected = true; - currentClient->abort(); + currentClient->abort(); // Hmmm... should we not let the server handle this ? return true; } @@ -862,11 +863,7 @@ class RiaSetGridProperty : public RiaSocketCommand CVF_ASSERT(false); } - // If nothing should be read, or we already have read everything, do nothing - - if ((m_timeStepCountToRead == 0) || (m_currentTimeStepNumberToRead >= m_timeStepCountToRead) ) return true; - - // Check if a complete timestep is available, return and whait for readyRead() if not + // Check if a complete timestep is available, return and wait for readyRead() if not if (currentClient->bytesAvailable() < (int)m_bytesPerTimeStepToRead) return false; size_t cellCountFromOctave = m_bytesPerTimeStepToRead / sizeof(double); @@ -878,7 +875,6 @@ class RiaSetGridProperty : public RiaSocketCommand m_invalidDataDetected = true; currentClient->abort(); - return true; } @@ -895,7 +891,7 @@ class RiaSetGridProperty : public RiaSocketCommand m_scalarResultsToAdd->at(tsId).resize(totalNumberOfCellsIncludingLgrCells, HUGE_VAL); } - if ((currentClient->bytesAvailable() >= (int)m_bytesPerTimeStepToRead) && (m_currentTimeStepNumberToRead < m_timeStepCountToRead)) + while ((currentClient->bytesAvailable() >= (int)m_bytesPerTimeStepToRead) && (m_currentTimeStepNumberToRead < m_timeStepCountToRead)) { // Read a single time step with data @@ -904,7 +900,9 @@ class RiaSetGridProperty : public RiaSocketCommand qint64 bytesRead = currentClient->read((char*)(doubleValues.data()), m_bytesPerTimeStepToRead); size_t doubleValueIndex = 0; - cvf::ref cellCenterDataAccessObject = m_currentReservoir->reservoirData()->dataAccessObject(grid, m_porosityModelEnum, m_requestedTimesteps[m_currentTimeStepNumberToRead], m_currentScalarIndex); + cvf::ref cellCenterDataAccessObject = + m_currentReservoir->reservoirData()->dataAccessObject(grid, m_porosityModelEnum, m_requestedTimesteps[m_currentTimeStepNumberToRead], m_currentScalarIndex); + if (!cellCenterDataAccessObject.isNull()) { for (size_t cellIdx = 0; static_cast(cellIdx) < cellCountFromOctave; cellIdx++) @@ -965,6 +963,7 @@ class RiaSetGridProperty : public RiaSocketCommand return true; } + return false; } diff --git a/ApplicationCode/SocketInterface/RiaSocketCommand.h b/ApplicationCode/SocketInterface/RiaSocketCommand.h index ee2fe38976..5a393acc90 100644 --- a/ApplicationCode/SocketInterface/RiaSocketCommand.h +++ b/ApplicationCode/SocketInterface/RiaSocketCommand.h @@ -20,7 +20,8 @@ ////////////////////////////////////////////////////////////////////////// -/// Socket commands, to be moved into a separate file +/// The base class for classes interpreting commands sent via socket. +/// Works in close connection with RiaSocketServer ////////////////////////////////////////////////////////////////////////// class RiaSocketServer; @@ -30,7 +31,18 @@ class RiaSocketCommand { public: virtual ~RiaSocketCommand() {} + + /// This method is supposed to interpret the commands received from the calling socket connection and + /// read the data currently available. + /// If it read all the data and completed the command, it is supposed to return true. If it did not read all the data, + /// it is supposed to return false. The socket server will then assume that the command is not completely interpreted, + /// and will continue to call interpretMore() until that method returns true. + virtual bool interpretCommand(RiaSocketServer* server, const QList& args, QDataStream& socketStream) = 0; + + /// This method is supposed to read whatever more data that is available on the socket connection, and return true if it + /// was able to read all the data. If not all the data was available, it must return false, so that the RiaSocketServer + /// will call this method again when more data becomes available. virtual bool interpretMore(RiaSocketServer* server, QTcpSocket* currentClient) { return true; } }; diff --git a/ApplicationCode/SocketInterface/RiaSocketServer.cpp b/ApplicationCode/SocketInterface/RiaSocketServer.cpp index 1cbc4b31b4..1258030bcf 100644 --- a/ApplicationCode/SocketInterface/RiaSocketServer.cpp +++ b/ApplicationCode/SocketInterface/RiaSocketServer.cpp @@ -18,6 +18,7 @@ #include "RiaStdInclude.h" #include "RiaSocketServer.h" #include "RiaSocketCommand.h" +#include "RiaSocketTools.h" #include #include @@ -68,6 +69,10 @@ RiaSocketServer::RiaSocketServer(QObject* parent) m_tcpServer = new QTcpServer(this); + m_nextPendingConnectionTimer = new QTimer(this); + m_nextPendingConnectionTimer->setInterval(100); + m_nextPendingConnectionTimer->setSingleShot(true); + if (!m_tcpServer->listen(QHostAddress::LocalHost, 40001)) { m_errorMessageDialog->showMessage("Octave communication disabled :\n" @@ -81,6 +86,7 @@ RiaSocketServer::RiaSocketServer(QObject* parent) return; } + connect(m_nextPendingConnectionTimer, SIGNAL(timeout()), this, SLOT(handleNextPendingConnection())); connect(m_tcpServer, SIGNAL(newConnection()), this, SLOT(slotNewClientConnection())); } @@ -106,54 +112,28 @@ unsigned short RiaSocketServer::serverPort() //-------------------------------------------------------------------------------------------------- void RiaSocketServer::slotNewClientConnection() { - // If we are currently handling a connection, just ignore the new one until the queue is empty. + // If we are currently handling a connection, just ignore the new one until the current one is disconnected. - if (m_currentClient != NULL) + if (m_currentClient && (m_currentClient->state() == QAbstractSocket::ConnectedState) ) { - if (m_currentClient->state() == QAbstractSocket::ConnectedState) - { - return; - } - else - { - if (m_currentCommand) - { - if (m_currentCommand->interpretMore(this, m_currentClient)) - { - delete m_currentCommand; - m_currentCommand = NULL; - } - - CVF_ASSERT(m_currentCommand == NULL); - } - - terminateCurrentConnection(); - } + //PMonLog("Starting Timer"); + m_nextPendingConnectionTimer->start(); // Reset and start again + return; } - handlePendingIncomingConnectionRequests(); -} + // Read pending data from socket -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiaSocketServer::handleClientConnection(QTcpSocket* clientToHandle) -{ - CVF_ASSERT(clientToHandle != NULL); - CVF_ASSERT(m_currentClient == NULL); - CVF_ASSERT(m_currentCommand == NULL); - - m_currentClient = clientToHandle; - m_currentCommandSize = 0; - - connect(m_currentClient, SIGNAL(disconnected()), this, SLOT(slotCurrentClientDisconnected())); - - if (m_currentClient->bytesAvailable()) + if (m_currentClient && m_currentCommand) { - this->readCommandFromOctave(); + bool isFinshed = m_currentCommand->interpretMore(this, m_currentClient); + + if (!isFinshed) + { + m_errorMessageDialog->showMessage(tr("ResInsight SocketServer: \n") + tr("Warning : The command did not finish up correctly at the presence of a new one.")); + } } - connect(m_currentClient, SIGNAL(readyRead()), this, SLOT(slotReadyRead())); + handleNextPendingConnection(); } //-------------------------------------------------------------------------------------------------- @@ -161,7 +141,13 @@ void RiaSocketServer::handleClientConnection(QTcpSocket* clientToHandle) //-------------------------------------------------------------------------------------------------- RimCase* RiaSocketServer::findReservoir(int caseId) { + int currCaseId = caseId; if (caseId < 0) + { + currCaseId = this->currentCaseId(); + } + + if (currCaseId < 0) { if (RiaApplication::instance()->activeReservoirView()) { @@ -178,7 +164,7 @@ RimCase* RiaSocketServer::findReservoir(int caseId) for (size_t i = 0; i < cases.size(); i++) { - if (cases[i]->caseId == caseId) + if (cases[i]->caseId == currCaseId) { return cases[i]; } @@ -189,26 +175,29 @@ RimCase* RiaSocketServer::findReservoir(int caseId) } //-------------------------------------------------------------------------------------------------- -/// +/// Reads the command name size, the command string and creates a new command object based on the string read. +/// Tries to interpret the command as well. +/// Returns whether the command actually was completely finished in one go. //-------------------------------------------------------------------------------------------------- -void RiaSocketServer::readCommandFromOctave() +bool RiaSocketServer::readCommandFromOctave() { QDataStream socketStream(m_currentClient); socketStream.setVersion(riOctavePlugin::qtDataStreamVersion); // If we have not read the currentCommandSize // read the size of the command if all the data is available + if (m_currentCommandSize == 0) { - if (m_currentClient->bytesAvailable() < (int)sizeof(qint64)) return; + if (m_currentClient->bytesAvailable() < (int)sizeof(qint64)) return false; socketStream >> m_currentCommandSize; } // Check if the complete command is available, return and whait for readyRead() if not - if (m_currentClient->bytesAvailable() < m_currentCommandSize) return; + if (m_currentClient->bytesAvailable() < m_currentCommandSize) return false; - // Now we can read the command + // Now we can read the command name QByteArray command = m_currentClient->read( m_currentCommandSize); QTextStream commandStream(command); @@ -223,29 +212,19 @@ void RiaSocketServer::readCommandFromOctave() CVF_ASSERT(args.size() > 0); - std::cout << args[0].data() << std::endl; + // Create the actual RiaSocketCommand object that will interpret the socket data m_currentCommand = RiaSocketCommandFactory::instance()->create(args[0]); if (m_currentCommand) { bool finished = m_currentCommand->interpretCommand(this, args, socketStream); - if (finished) - { - delete m_currentCommand; - m_currentCommand = NULL; - - handlePendingIncomingConnectionRequests(); - return; - } + return finished; } else { - handlePendingIncomingConnectionRequests(); - m_errorMessageDialog->showMessage(tr("ResInsight SocketServer: \n") + tr("Unknown command: %1").arg(args[0].data())); - terminateCurrentConnection(); - return; + return true; } } @@ -257,44 +236,16 @@ void RiaSocketServer::slotCurrentClientDisconnected() { if (m_currentCommand) { - if (m_currentCommand->interpretMore(this, m_currentClient)) + // Make sure we read what can be read. + bool isFinished = m_currentCommand->interpretMore(this, m_currentClient); + + if (!isFinished) { - delete m_currentCommand; - m_currentCommand = NULL; + m_errorMessageDialog->showMessage(tr("ResInsight SocketServer: \n") + tr("Warning : The command was interrupted and did not finish because the connection to octave disconnected.")); } - - /// What do we do here ? - CVF_ASSERT(m_currentCommand == NULL); - } - - terminateCurrentConnection(); - - handlePendingIncomingConnectionRequests(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiaSocketServer::terminateCurrentConnection() -{ - if (m_currentClient) - { - m_currentClient->disconnect(SIGNAL(disconnected())); - m_currentClient->disconnect(SIGNAL(readyRead())); - m_currentClient->deleteLater(); - m_currentClient = NULL; - } - - // Clean up more state: - - if (m_currentCommand) - { - delete m_currentCommand; - m_currentCommand = NULL; } - m_currentCommandSize = 0; - + handleNextPendingConnection(); } //-------------------------------------------------------------------------------------------------- @@ -304,17 +255,20 @@ void RiaSocketServer::slotReadyRead() { if (m_currentCommand) { - if (m_currentCommand->interpretMore(this, m_currentClient)) - { - delete m_currentCommand; - m_currentCommand = NULL; + bool isFinished = m_currentCommand->interpretMore(this, m_currentClient); - handlePendingIncomingConnectionRequests(); + if (isFinished) + { + handleNextPendingConnection(); } } else { - readCommandFromOctave(); + bool isFinished = readCommandFromOctave(); + if (isFinished) + { + handleNextPendingConnection(); + } } } @@ -334,17 +288,73 @@ int RiaSocketServer::currentCaseId() const return m_currentCaseId; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSocketServer::terminateCurrentConnection() +{ + if (m_currentClient) + { + m_currentClient->disconnect(SIGNAL(disconnected())); + m_currentClient->disconnect(SIGNAL(readyRead())); + m_currentClient->deleteLater(); + m_currentClient = NULL; + } + + // Clean up more state: + + if (m_currentCommand) + { + delete m_currentCommand; + m_currentCommand = NULL; + } + + m_currentCommandSize = 0; + +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RiaSocketServer::handlePendingIncomingConnectionRequests() +void RiaSocketServer::handleNextPendingConnection() { - QTcpSocket* newClient = m_tcpServer->nextPendingConnection(); - if (newClient) + if (m_currentClient && (m_currentClient->state() == QAbstractSocket::ConnectedState) ) + { + //PMonLog("Starting Timer"); + m_nextPendingConnectionTimer->start(); // Reset and start again + return; + } + + // Stop timer + if (m_nextPendingConnectionTimer->isActive()) + { + //PMonLog("Stopping Timer"); + m_nextPendingConnectionTimer->stop(); + } + + terminateCurrentConnection(); + + QTcpSocket* clientToHandle = m_tcpServer->nextPendingConnection(); + if (clientToHandle) { - terminateCurrentConnection(); + CVF_ASSERT(m_currentClient == NULL); + CVF_ASSERT(m_currentCommand == NULL); - this->handleClientConnection(newClient); + m_currentClient = clientToHandle; + m_currentCommandSize = 0; + + connect(m_currentClient, SIGNAL(disconnected()), this, SLOT(slotCurrentClientDisconnected())); + connect(m_currentClient, SIGNAL(readyRead()), this, SLOT(slotReadyRead())); + + if (m_currentClient->bytesAvailable()) + { + bool isFinished = this->readCommandFromOctave(); + if (isFinished) + { + // Call ourselves recursively until there are none left, or until it can not be processed in one go. + this->handleNextPendingConnection(); + } + } } } diff --git a/ApplicationCode/SocketInterface/RiaSocketServer.h b/ApplicationCode/SocketInterface/RiaSocketServer.h index 28c906177d..2b55424629 100644 --- a/ApplicationCode/SocketInterface/RiaSocketServer.h +++ b/ApplicationCode/SocketInterface/RiaSocketServer.h @@ -28,6 +28,7 @@ class QTcpServer; class QTcpSocket; class QNetworkSession; class QErrorMessage; +class QTimer; class RimCase; class RiaSocketCommand; @@ -59,11 +60,11 @@ private slots: void slotNewClientConnection(); void slotCurrentClientDisconnected(); void slotReadyRead(); + void handleNextPendingConnection(); + private: - void handleClientConnection( QTcpSocket* clientToHandle); void terminateCurrentConnection(); - void readCommandFromOctave(); - void handlePendingIncomingConnectionRequests(); + bool readCommandFromOctave(); private: QTcpServer* m_tcpServer; @@ -74,5 +75,7 @@ private slots: RiaSocketCommand* m_currentCommand; + QTimer* m_nextPendingConnectionTimer; + int m_currentCaseId; // Set to -1 to use default server behavior }; diff --git a/ApplicationCode/SocketInterface/RiaSocketTools.h b/ApplicationCode/SocketInterface/RiaSocketTools.h index ef0687a48c..1baeb5a9fc 100644 --- a/ApplicationCode/SocketInterface/RiaSocketTools.h +++ b/ApplicationCode/SocketInterface/RiaSocketTools.h @@ -18,6 +18,7 @@ class RimCase; class RiaSocketServer; +#define PMonLog( MessageString ) RiuMainWindow::instance()->processMonitor()->addStringToLog( MessageString ); class RiaSocketTools { diff --git a/ApplicationCode/SocketInterface/RiaWellDataCommands.cpp b/ApplicationCode/SocketInterface/RiaWellDataCommands.cpp index 79b6fc3276..4c9d935206 100644 --- a/ApplicationCode/SocketInterface/RiaWellDataCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaWellDataCommands.cpp @@ -311,9 +311,9 @@ class RiaGetWellCells : public RiaSocketCommand int branchId = resPoint.m_ertBranchId; int segmentId = resPoint.m_ertSegmentId; - cellIs .push_back( static_cast(i) ); - cellJs .push_back( static_cast(j) ); - cellKs .push_back( static_cast(k) ); + cellIs .push_back( static_cast(i + 1) ); // NB: 1-based index in Octave + cellJs .push_back( static_cast(j + 1) ); // NB: 1-based index in Octave + cellKs .push_back( static_cast(k + 1) ); // NB: 1-based index in Octave gridIndices .push_back( static_cast(gridIdx) ); cellStatuses.push_back( static_cast(isOpen) ); branchIds .push_back( branchId ); diff --git a/ApplicationCode/UserInterface/RiuMainWindow.cpp b/ApplicationCode/UserInterface/RiuMainWindow.cpp index d30ccab338..4d9fc05d57 100644 --- a/ApplicationCode/UserInterface/RiuMainWindow.cpp +++ b/ApplicationCode/UserInterface/RiuMainWindow.cpp @@ -50,6 +50,7 @@ #include "cafAnimationToolBar.h" #include "cafPdmUiPropertyView.h" #include "cvfqtBasicAboutDialog.h" +#include "cvfTimer.h" #include "cafPdmFieldCvfMat4d.h" @@ -60,6 +61,7 @@ #include "Rim3dOverlayInfoConfig.h" #include "RiuWellImportWizard.h" #include "RimCalcScript.h" +#include "RiaRegressionTest.h" @@ -202,6 +204,8 @@ void RiuMainWindow::createActions() m_snapshotAllViewsToFile = new QAction(QIcon(":/SnapShotSaveViews.png"), "Snapshot All Views To File", this); m_createCommandObject = new QAction("Create Command Object", this); + m_showRegressionTestDialog = new QAction("Regression Test Dialog", this); + m_executePaintEventPerformanceTest = new QAction("&Paint Event Performance Test", this); m_saveProjectAction = new QAction(QIcon(":/Save.png"), "&Save Project", this); m_saveProjectAsAction = new QAction(QIcon(":/Save.png"), "Save Project &As", this); @@ -227,6 +231,8 @@ void RiuMainWindow::createActions() connect(m_snapshotAllViewsToFile, SIGNAL(triggered()), SLOT(slotSnapshotAllViewsToFile())); connect(m_createCommandObject, SIGNAL(triggered()), SLOT(slotCreateCommandObject())); + connect(m_showRegressionTestDialog, SIGNAL(triggered()), SLOT(slotShowRegressionTestDialog())); + connect(m_executePaintEventPerformanceTest, SIGNAL(triggered()), SLOT(slotExecutePaintEventPerformanceTest())); connect(m_saveProjectAction, SIGNAL(triggered()), SLOT(slotSaveProject())); connect(m_saveProjectAsAction, SIGNAL(triggered()), SLOT(slotSaveProjectAs())); @@ -364,7 +370,9 @@ void RiuMainWindow::createMenus() debugMenu->addAction(m_mockInputModelAction); debugMenu->addSeparator(); debugMenu->addAction(m_createCommandObject); - + debugMenu->addSeparator(); + debugMenu->addAction(m_showRegressionTestDialog); + debugMenu->addAction(m_executePaintEventPerformanceTest); connect(debugMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshDebugActions())); @@ -753,7 +761,7 @@ void RiuMainWindow::slotOpenInputFiles() // Remember the path to next time app->setDefaultFileDialogDirectory("INPUT_FILES", QFileInfo(fileNames.last()).absolutePath()); - app->openInputEclipseCase("Eclipse Input Files", fileNames); + app->openInputEclipseCaseFromFileNames(fileNames); } } @@ -767,7 +775,7 @@ void RiuMainWindow::slotOpenProject() { RiaApplication* app = RiaApplication::instance(); QString defaultDir = app->defaultFileDialogDirectory("BINARY_GRID"); - QString fileName = QFileDialog::getOpenFileName(this, "Open ResInsight Project", defaultDir, "ResInsight project (*.rip)"); + QString fileName = QFileDialog::getOpenFileName(this, "Open ResInsight Project", defaultDir, "ResInsight project (*.rsp *.rip);;All files(*.*)"); if (fileName.isEmpty()) return; @@ -1197,13 +1205,13 @@ void RiuMainWindow::slotEditPreferences() if (preferencesDialog.exec() == QDialog::Accepted) { // Write preferences using QSettings and apply them to the application - app->writePreferences(); + app->writeFieldsToApplicationStore(app->preferences()); app->applyPreferences(); } else { // Read back currently stored values using QSettings - app->readPreferences(); + app->readFieldsFromApplicationStore(app->preferences()); } } @@ -1700,3 +1708,63 @@ void RiuMainWindow::slotCreateCommandObject() app->project()->updateConnectedEditors(); } } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuMainWindow::slotShowRegressionTestDialog() +{ + RiaRegressionTest regTestConfig; + + RiaApplication* app = RiaApplication::instance(); + app->readFieldsFromApplicationStore(®TestConfig); + + RiuPreferencesDialog regressionTestDialog(this, ®TestConfig, "Regression Test"); + if (regressionTestDialog.exec() == QDialog::Accepted) + { + // Write preferences using QSettings and apply them to the application + app->writeFieldsToApplicationStore(®TestConfig); + + QString currentApplicationPath = QDir::currentPath(); + + QDir::setCurrent(regTestConfig.applicationWorkingFolder); + app->executeRegressionTests(regTestConfig.regressionTestFolder); + + QDir::setCurrent(currentApplicationPath); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuMainWindow::slotExecutePaintEventPerformanceTest() +{ + + if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer()) + { + size_t redrawCount = 50; + + caf::Viewer* viewer = RiaApplication::instance()->activeReservoirView()->viewer(); + + cvf::Timer timer; + for (size_t i = 0; i < redrawCount; i++) + { + viewer->repaint(); + } + + double totalTimeMS = timer.time() * 1000.0; + + double msPerFrame = totalTimeMS / redrawCount; + + QString resultInfo = QString("Total time '%1 ms' for %2 number of redraws, frame time '%3 ms'").arg(totalTimeMS).arg(redrawCount).arg(msPerFrame); + setResultInfo(resultInfo); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuMainWindow::setDefaultWindowSize() +{ + resize(1000, 810); +} diff --git a/ApplicationCode/UserInterface/RiuMainWindow.h b/ApplicationCode/UserInterface/RiuMainWindow.h index 90ada1ab64..25e96c77cc 100644 --- a/ApplicationCode/UserInterface/RiuMainWindow.h +++ b/ApplicationCode/UserInterface/RiuMainWindow.h @@ -93,6 +93,8 @@ class RiuMainWindow : public QMainWindow void selectedCases(std::vector& cases); + void setDefaultWindowSize(); + protected: virtual void closeEvent(QCloseEvent* event); @@ -155,6 +157,8 @@ class RiuMainWindow : public QMainWindow QAction* m_snapshotAllViewsToFile; QAction* m_createCommandObject; + QAction* m_showRegressionTestDialog; + QAction* m_executePaintEventPerformanceTest; // Help actions QAction* m_aboutAction; @@ -225,6 +229,9 @@ private slots: void slotCreateCommandObject(); + void slotShowRegressionTestDialog(); + void slotExecutePaintEventPerformanceTest(); + // Mock models void slotMockModel(); void slotMockResultsModel(); diff --git a/ApplicationCode/UserInterface/RiuProcessMonitor.cpp b/ApplicationCode/UserInterface/RiuProcessMonitor.cpp index 5be4fed313..489050a2d5 100644 --- a/ApplicationCode/UserInterface/RiuProcessMonitor.cpp +++ b/ApplicationCode/UserInterface/RiuProcessMonitor.cpp @@ -52,14 +52,16 @@ RiuProcessMonitor::RiuProcessMonitor(QDockWidget* pParent) m_textEdit->setReadOnly(true); m_textEdit->setLineWrapMode(QPlainTextEdit::NoWrap); - //QFont font("Courier", 8); - QFont font("Terminal", 10); + QFont font("Courier", 8); + //QFont font("Terminal", 11); m_textEdit->setFont(font); QVBoxLayout* pLayout = new QVBoxLayout(); pLayout->addLayout(pTopLayout); pLayout->addWidget(m_textEdit); + pLayout->setContentsMargins(0, 0, 0, 0); + setLayout(pLayout); setStatusMsg("N/A", caf::PROCESS_STATE_NORMAL); diff --git a/ApplicationCode/UserInterface/RiuProcessMonitor.h b/ApplicationCode/UserInterface/RiuProcessMonitor.h index 50582c2121..7a49b5ffd6 100644 --- a/ApplicationCode/UserInterface/RiuProcessMonitor.h +++ b/ApplicationCode/UserInterface/RiuProcessMonitor.h @@ -52,12 +52,13 @@ class RiuProcessMonitor : public QWidget void startMonitorWorkProcess(caf::UiProcess* process); void stopMonitorWorkProcess(); + void addStringToLog(const QString& text); + public slots: void slotClearTextEdit(); private: void setStatusMsg(const QString& status, int messageType); - void addStringToLog(const QString& text); private slots: void slotShowProcStatusMsg(const QString& message, int messageType); diff --git a/ApplicationCode/UserInterface/RiuResultInfoPanel.cpp b/ApplicationCode/UserInterface/RiuResultInfoPanel.cpp index 124f96f632..9ac0ae118b 100644 --- a/ApplicationCode/UserInterface/RiuResultInfoPanel.cpp +++ b/ApplicationCode/UserInterface/RiuResultInfoPanel.cpp @@ -42,6 +42,9 @@ RiuResultInfoPanel::RiuResultInfoPanel(QDockWidget* parent) QVBoxLayout* layout = new QVBoxLayout(); layout->addWidget(m_textEdit); + + layout->setContentsMargins(0, 0, 0, 0); + setLayout(layout); } diff --git a/ApplicationCode/WellPathImportSsihub/CMakeLists.txt b/ApplicationCode/WellPathImportSsihub/CMakeLists.txt index 73a5f85fef..56cabdd553 100644 --- a/ApplicationCode/WellPathImportSsihub/CMakeLists.txt +++ b/ApplicationCode/WellPathImportSsihub/CMakeLists.txt @@ -20,8 +20,8 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../FileInterface - ${CMAKE_CURRENT_SOURCE_DIR}/../../cafProjectDataModel - ${CMAKE_CURRENT_SOURCE_DIR}/../../cafUserInterface + ${CMAKE_CURRENT_SOURCE_DIR}/../../Fwk/AppFwk/cafProjectDataModel + ${CMAKE_CURRENT_SOURCE_DIR}/../../Fwk/AppFwk/cafUserInterface ) diff --git a/ApplicationCode/WellPathImportSsihub/RimOilFieldEntry.cpp b/ApplicationCode/WellPathImportSsihub/RimOilFieldEntry.cpp index 3f6ef908f9..8e3010c468 100644 --- a/ApplicationCode/WellPathImportSsihub/RimOilFieldEntry.cpp +++ b/ApplicationCode/WellPathImportSsihub/RimOilFieldEntry.cpp @@ -41,7 +41,7 @@ RimOilFieldEntry::RimOilFieldEntry() CAF_PDM_InitFieldNoDefault(&name, "OilFieldName", "OilFieldName", "", "", ""); CAF_PDM_InitFieldNoDefault(&edmId, "EdmId", "EdmId", "", "", ""); - CAF_PDM_InitField(&selected, "Selected", true, "Selected", "", "", ""); + CAF_PDM_InitField(&selected, "Selected", true, "Selected", "", "", ""); CAF_PDM_InitFieldNoDefault(&wellsFilePath, "wellsFilePath", "wellsFilePath", "", "", ""); diff --git a/ApplicationCode/WellPathImportSsihub/RimOilRegionEntry.cpp b/ApplicationCode/WellPathImportSsihub/RimOilRegionEntry.cpp index ad947d30fe..d0f5893347 100644 --- a/ApplicationCode/WellPathImportSsihub/RimOilRegionEntry.cpp +++ b/ApplicationCode/WellPathImportSsihub/RimOilRegionEntry.cpp @@ -34,7 +34,7 @@ RimOilRegionEntry::RimOilRegionEntry() CAF_PDM_InitFieldNoDefault(&fields, "Fields", "", "", "", ""); - CAF_PDM_InitField(&selected, "Selected", true, "Selected", "", "", ""); + CAF_PDM_InitField(&selected, "Selected", false, "Selected", "", "", ""); } diff --git a/ApplicationCode/WellPathImportSsihub/RimOilRegionEntry.h b/ApplicationCode/WellPathImportSsihub/RimOilRegionEntry.h index 875ea6082c..db0ed686d4 100644 --- a/ApplicationCode/WellPathImportSsihub/RimOilRegionEntry.h +++ b/ApplicationCode/WellPathImportSsihub/RimOilRegionEntry.h @@ -38,12 +38,12 @@ class RimOilRegionEntry : public caf::PdmObject virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); + void updateState(); + caf::PdmField name; caf::PdmField selected; caf::PdmPointersField fields; -private: - void updateState(); }; diff --git a/ApplicationCode/WellPathImportSsihub/RimWellPathImport.cpp b/ApplicationCode/WellPathImportSsihub/RimWellPathImport.cpp index 73c11b7492..a5f17403e4 100644 --- a/ApplicationCode/WellPathImportSsihub/RimWellPathImport.cpp +++ b/ApplicationCode/WellPathImportSsihub/RimWellPathImport.cpp @@ -17,6 +17,7 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RimWellPathImport.h" +#include "cafPdmUiTreeViewEditor.h" namespace caf { @@ -186,3 +187,19 @@ void RimWellPathImport::fieldChangedByUi(const caf::PdmFieldHandle* changedField } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathImport::defineObjectEditorAttribute(QString uiConfigName, caf::PdmUiEditorAttribute * attribute) +{ + caf::PdmUiTreeViewEditorAttribute* myAttr = dynamic_cast(attribute); + if (myAttr) + { + QStringList colHeaders; + colHeaders << "Region"; + myAttr->columnHeaders = colHeaders; + } +} + + + diff --git a/ApplicationCode/WellPathImportSsihub/RimWellPathImport.h b/ApplicationCode/WellPathImportSsihub/RimWellPathImport.h index 0cf24e0271..d74b055552 100644 --- a/ApplicationCode/WellPathImportSsihub/RimWellPathImport.h +++ b/ApplicationCode/WellPathImportSsihub/RimWellPathImport.h @@ -57,9 +57,11 @@ class RimWellPathImport : public caf::PdmObject virtual void initAfterRead(); virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ); + virtual void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute * attribute ); -//private: void updateFieldVisibility(); + + }; diff --git a/ApplicationCode/WellPathImportSsihub/RiuWellImportWizard.cpp b/ApplicationCode/WellPathImportSsihub/RiuWellImportWizard.cpp index 012ccac377..2904c3fbb4 100644 --- a/ApplicationCode/WellPathImportSsihub/RiuWellImportWizard.cpp +++ b/ApplicationCode/WellPathImportSsihub/RiuWellImportWizard.cpp @@ -32,6 +32,7 @@ #include "RimWellPathImport.h" #include "RifJsonEncodeDecode.h" +#include "cafPdmUiTreeViewEditor.h" //-------------------------------------------------------------------------------------------------- @@ -45,8 +46,7 @@ RiuWellImportWizard::RiuWellImportWizard(const QString& webServiceAddress, const m_destinationFolder = downloadFolder; m_webServiceAddress = webServiceAddress; - - m_progressDialog = new QProgressDialog(this); + m_myProgressDialog = new QProgressDialog(this); m_firstTimeRequestingAuthentication = true; @@ -64,8 +64,6 @@ RiuWellImportWizard::RiuWellImportWizard(const QString& webServiceAddress, const this, SLOT(sslErrors(QNetworkReply*,QList))); #endif - connect(m_progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload())); - } //-------------------------------------------------------------------------------------------------- @@ -121,9 +119,6 @@ void RiuWellImportWizard::issueHttpRequestToFile(QString completeUrlText, QStrin return; } - m_progressDialog->setWindowTitle(tr("HTTP")); - m_progressDialog->setLabelText(tr("Downloading %1.").arg(destinationFileName)); - // schedule the request m_httpRequestAborted = false; startRequest(m_url); @@ -152,7 +147,7 @@ void RiuWellImportWizard::httpFinished() m_file = 0; } m_reply->deleteLater(); - m_progressDialog->hide(); + m_myProgressDialog->hide(); return; } @@ -215,7 +210,12 @@ void RiuWellImportWizard::httpFinished() out << singleWellPathContent; } } + + m_myProgressDialog->setLabelText(QString("Downloaded well path : %1").arg(wellPathName)); } + + int newValue = m_myProgressDialog->maximum() - m_wellRequestQueue.size(); + m_myProgressDialog->setValue(newValue); } m_reply->deleteLater(); @@ -247,20 +247,6 @@ void RiuWellImportWizard::httpReadyRead() m_file->write(m_reply->readAll()); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuWellImportWizard::updateDataReadProgress(qint64 bytesRead, qint64 totalBytes) -{ - if (m_httpRequestAborted) - return; - - m_progressDialog->setMaximum(totalBytes); - m_progressDialog->setValue(bytesRead); - -} - - //-------------------------------------------------------------------------------------------------- /// This slot will be called for the first network reply that will need authentication. /// If the authentication is successful, the username/password is cached in the QNetworkAccessManager @@ -323,8 +309,6 @@ void RiuWellImportWizard::startRequest(QUrl url) this, SLOT(httpFinished())); connect(m_reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead())); - connect(m_reply, SIGNAL(downloadProgress(qint64,qint64)), - this, SLOT(updateDataReadProgress(qint64,qint64))); } @@ -385,6 +369,13 @@ void RiuWellImportWizard::updateFieldsModel() } m_wellPathImportObject->updateRegions(regions, fields, edmIds); + + for (size_t i = 0; i < m_wellPathImportObject->regions.size(); i++) + { + m_wellPathImportObject->regions[i]->updateState(); + } + + m_wellPathImportObject->updateConnectedEditors(); } } @@ -413,7 +404,7 @@ void RiuWellImportWizard::downloadWells() } else { - wellRequest = QString("/resinsight/projects/%1/wellsInArea?north=%2&south=%3&east=%4&west=%5&utmZone=32N") + wellRequest = QString("/resinsight/projects/%1/wellsInArea?north=%2&south=%3&east=%4&west=%5&utmzone=32N") .arg(oilField->edmId) .arg(QString::number(m_wellPathImportObject->north, 'g', 10)) .arg(QString::number(m_wellPathImportObject->south, 'g', 10)) @@ -455,16 +446,15 @@ void RiuWellImportWizard::downloadWellPaths() for (size_t wIdx = 0; wIdx < oilField->wells.size(); wIdx++) { RimWellPathEntry* wellPathEntry = oilField->wells[wIdx]; - - if (!wellPathEntry->isWellPathValid()) - continue; - - DownloadEntity urlToFile; + if (wellPathEntry->selected && wellPathEntry->isWellPathValid()) + { + DownloadEntity urlToFile; - urlToFile.requestUrl = wellPathEntry->requestUrl; - urlToFile.responseFilename = wellPathEntry->wellPathFilePath; + urlToFile.requestUrl = wellPathEntry->requestUrl; + urlToFile.responseFilename = wellPathEntry->wellPathFilePath; - m_wellRequestQueue.push_back(urlToFile); + m_wellRequestQueue.push_back(urlToFile); + } } } } @@ -473,6 +463,11 @@ void RiuWellImportWizard::downloadWellPaths() m_currentDownloadState = DOWNLOAD_WELL_PATH; + m_myProgressDialog->setMaximum(m_wellRequestQueue.size()); + m_myProgressDialog->setValue(0); + m_myProgressDialog->show(); + + checkDownloadQueueAndIssueRequests(); } @@ -497,6 +492,8 @@ void RiuWellImportWizard::checkDownloadQueueAndIssueRequests() if (m_currentDownloadState == DOWNLOAD_WELLS) { + m_myProgressDialog->hide(); + // Update UI with downloaded wells for (size_t rIdx = 0; rIdx < m_wellPathImportObject->regions.size(); rIdx++) @@ -528,7 +525,7 @@ void RiuWellImportWizard::checkDownloadQueueAndIssueRequests() m_currentDownloadState = DOWNLOAD_UNDEFINED; - m_progressDialog->hide(); + m_myProgressDialog->hide(); } //-------------------------------------------------------------------------------------------------- @@ -695,7 +692,7 @@ void RiuWellImportWizard::parseWellsResponse(RimOilFieldEntry* oilFieldEntry) WellSelectionPage* wellSelectionPage = dynamic_cast(page(m_wellSelectionPageId)); if (wellSelectionPage) - wellSelectionPage->expandAllTreeNodes(); + wellSelectionPage->buildWellTreeView(); } //-------------------------------------------------------------------------------------------------- @@ -802,6 +799,31 @@ void FieldSelectionPage::initializePage() +//-------------------------------------------------------------------------------------------------- +/// Helper class used to define column headers +//-------------------------------------------------------------------------------------------------- +class ObjectGroupWithHeaders : public caf::PdmObjectGroup +{ +public: + ObjectGroupWithHeaders() : caf::PdmObjectGroup() + { + + } + + //-------------------------------------------------------------------------------------------------- + /// + //-------------------------------------------------------------------------------------------------- + virtual void defineObjectEditorAttribute(QString uiConfigName, caf::PdmUiEditorAttribute * attribute) + { + caf::PdmUiTreeViewEditorAttribute* myAttr = dynamic_cast(attribute); + if (myAttr) + { + QStringList colHeaders; + colHeaders << "Wells"; + myAttr->columnHeaders = colHeaders; + } + } +}; @@ -823,9 +845,7 @@ WellSelectionPage::WellSelectionPage(RimWellPathImport* wellPathImport, QWidget* m_wellPathImportObject = wellPathImport; - m_regionsWithVisibleWells = new caf::PdmObjectGroup; - - //m_wellSelectionTreeView->setPdmObject(wellPathImport); + m_regionsWithVisibleWells = new ObjectGroupWithHeaders; } //-------------------------------------------------------------------------------------------------- @@ -837,27 +857,73 @@ void WellSelectionPage::initializePage() if (!wiz) return; wiz->downloadWells(); + + setButtonText(QWizard::NextButton, "Download"); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void WellSelectionPage::expandAllTreeNodes() +void WellSelectionPage::buildWellTreeView() { - m_regionsWithVisibleWells->objects.clear(); + for (size_t rIdx = 0; rIdx < m_regionsWithVisibleWells->objects.size(); rIdx++) + { + caf::PdmObjectGroup* regGroup = dynamic_cast(m_regionsWithVisibleWells->objects[rIdx]); + if (!regGroup) + continue; + + for (size_t fIdx = 0; fIdx < regGroup->objects.size(); fIdx++) + { + caf::PdmObjectGroup* fieldGroup = dynamic_cast(regGroup->objects[fIdx]); + if (!fieldGroup) + continue; + + // RimWellPathEntry objects are present here, they must be taken out out the container, but not deleted + // If fieldGroup->objects->deleteObjects is performed, the objects are deleted + fieldGroup->objects.clear(); + } + } + + // Delete all temporary pdm object groups + m_regionsWithVisibleWells->deleteObjects(); for (size_t rIdx = 0; rIdx < m_wellPathImportObject->regions.size(); rIdx++) { RimOilRegionEntry* oilRegion = m_wellPathImportObject->regions[rIdx]; if (oilRegion->selected) { - m_regionsWithVisibleWells->objects.push_back(oilRegion); + caf::PdmObjectGroup* regGroup = new caf::PdmObjectGroup; + regGroup->setUiName(oilRegion->userDescriptionField()->uiValue().toString()); + + m_regionsWithVisibleWells->objects.push_back(regGroup); + + for (size_t fIdx = 0; fIdx < oilRegion->fields.size(); fIdx++) + { + RimOilFieldEntry* oilField = oilRegion->fields[fIdx]; + if (oilField->selected) + { + caf::PdmObjectGroup* fieldGroup = new caf::PdmObjectGroup; + fieldGroup->setUiName(oilField->userDescriptionField()->uiValue().toString()); + + regGroup->objects.push_back(fieldGroup); + + for (size_t wIdx = 0; wIdx < oilField->wells.size(); wIdx++) + { + RimWellPathEntry* wellPathEntry = oilField->wells[wIdx]; + if (wellPathEntry->selected) + { + fieldGroup->objects.push_back(wellPathEntry); + } + } + } + } } } m_wellSelectionTreeView->setPdmObject(m_regionsWithVisibleWells); m_regionsWithVisibleWells->updateConnectedEditors(); - //m_wellSelectionTreeView->treeView()->expandAll(); + + m_wellSelectionTreeView->treeView()->expandAll(); } //-------------------------------------------------------------------------------------------------- @@ -877,6 +943,7 @@ WellSelectionPage::~WellSelectionPage() WellSummaryPage::WellSummaryPage(RimWellPathImport* wellPathImport, QWidget* parent /*= 0*/) { m_wellPathImportObject = wellPathImport; + m_wellPathImportObject->setUiHidden(true); QVBoxLayout* layout = new QVBoxLayout; setLayout(layout); @@ -885,15 +952,18 @@ WellSummaryPage::WellSummaryPage(RimWellPathImport* wellPathImport, QWidget* par m_textEdit->setReadOnly(true); layout->addWidget(m_textEdit); - QPushButton* button = new QPushButton("Details", this); + QPushButton* button = new QPushButton("Show/hide details", this); connect(button, SIGNAL(clicked()), this, SLOT(slotShowDetails())); layout->addWidget(button); m_listView = new caf::PdmUiListView(this); + layout->setStretchFactor(m_listView, 10); layout->addWidget(m_listView); m_listView->hide(); m_objectGroup = new caf::PdmObjectGroup; + + setButtonText(QWizard::FinishButton, "Import"); } //-------------------------------------------------------------------------------------------------- @@ -933,17 +1003,19 @@ void WellSummaryPage::updateSummaryPage() for (size_t wIdx = 0; wIdx < oilField->wells.size(); wIdx++) { RimWellPathEntry* wellPathEntry = oilField->wells[wIdx]; - - if (QFile::exists(oilField->wells[wIdx]->wellPathFilePath)) - { - wellPathCount++; - } - else + if (wellPathEntry->selected) { - errorString += QString("Failed to get file '%1' from well '%2'\n").arg(oilField->wells[wIdx]->wellPathFilePath).arg(oilField->wells[wIdx]->name); + if (QFile::exists(oilField->wells[wIdx]->wellPathFilePath)) + { + wellPathCount++; + } + else + { + errorString += QString("Failed to get file '%1' from well '%2'\n").arg(oilField->wells[wIdx]->wellPathFilePath).arg(oilField->wells[wIdx]->name); + } + + m_objectGroup->objects.push_back(wellPathEntry); } - - m_objectGroup->objects.push_back(wellPathEntry); } } } @@ -951,7 +1023,7 @@ void WellSummaryPage::updateSummaryPage() } - m_textEdit->setText(QString("Downloaded successfully %1 well paths.\nPlease push 'Finish' button to import well paths into ResInsight.\n\n").arg(wellPathCount)); + m_textEdit->setText(QString("Downloaded successfully %1 well paths.\nPlease push 'Import' button to import well paths into ResInsight.\n\n").arg(wellPathCount)); if (!errorString.isEmpty()) { m_textEdit->append("Detected following errors during well path download. See details below."); @@ -968,6 +1040,13 @@ void WellSummaryPage::updateSummaryPage() //-------------------------------------------------------------------------------------------------- void WellSummaryPage::slotShowDetails() { - m_listView->show(); + if (m_listView->isHidden()) + { + m_listView->show(); + } + else + { + m_listView->hide(); + } } diff --git a/ApplicationCode/WellPathImportSsihub/RiuWellImportWizard.h b/ApplicationCode/WellPathImportSsihub/RiuWellImportWizard.h index 196b4ee4d4..aea5bee92e 100644 --- a/ApplicationCode/WellPathImportSsihub/RiuWellImportWizard.h +++ b/ApplicationCode/WellPathImportSsihub/RiuWellImportWizard.h @@ -72,6 +72,10 @@ class FieldSelectionPage : public QWizardPage }; + +class ObjectGroupWithHeaders; + + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -84,10 +88,10 @@ class WellSelectionPage : public QWizardPage ~WellSelectionPage(); virtual void initializePage(); - void expandAllTreeNodes(); + void buildWellTreeView(); private: - caf::PdmObjectGroup* m_regionsWithVisibleWells; + ObjectGroupWithHeaders* m_regionsWithVisibleWells; RimWellPathImport* m_wellPathImportObject; caf::PdmUiTreeView* m_wellSelectionTreeView; @@ -163,7 +167,6 @@ public slots: void httpFinished(); void httpReadyRead(); - void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes); void slotAuthenticationRequired(QNetworkReply* networkReply, QAuthenticator* authenticator); @@ -195,7 +198,7 @@ private slots: RimWellPathImport* m_wellPathImportObject; caf::PdmUiTreeView* m_pdmTreeView; - QProgressDialog* m_progressDialog; + QProgressDialog* m_myProgressDialog; QUrl m_url; QNetworkAccessManager m_networkAccessManager; diff --git a/ApplicationCode/WellPathImportSsihubTestApp/CMakeLists.txt b/ApplicationCode/WellPathImportSsihubTestApp/CMakeLists.txt index 3553745023..020f3032e9 100644 --- a/ApplicationCode/WellPathImportSsihubTestApp/CMakeLists.txt +++ b/ApplicationCode/WellPathImportSsihubTestApp/CMakeLists.txt @@ -13,15 +13,15 @@ find_package( OpenGL ) add_subdirectory(../WellPathImportSsihub "${CMAKE_CURRENT_BINARY_DIR}/WellPathImportSsihub") -add_subdirectory(../../cafProjectDataModel "${CMAKE_CURRENT_BINARY_DIR}/cafProjectDataModel") -add_subdirectory(../../cafUserInterface "${CMAKE_CURRENT_BINARY_DIR}/cafUserInterface") +add_subdirectory(../../Fwk/AppFwk/cafProjectDataModel "${CMAKE_CURRENT_BINARY_DIR}/cafProjectDataModel") +add_subdirectory(../../Fwk/AppFwk/cafUserInterface "${CMAKE_CURRENT_BINARY_DIR}/cafUserInterface") -add_subdirectory(../../cafTests/cafTestApplication "${CMAKE_CURRENT_BINARY_DIR}/cafTestApplication") +#add_subdirectory(../../cafTests/cafTestApplication "${CMAKE_CURRENT_BINARY_DIR}/cafTestApplication") include_directories( ${WellPathImportSsihub_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../../cafProjectDataModel - ${CMAKE_CURRENT_SOURCE_DIR}/../../cafUserInterface + ${WellPathImportSsihub_SOURCE_DIR}/../../Fwk/AppFwk/cafProjectDataModel + ${WellPathImportSsihub_SOURCE_DIR}/../../Fwk/AppFwk/cafUserInterface ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d649ae87e..716a3f2d12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,12 +2,13 @@ cmake_minimum_required (VERSION 2.8) project (ResInsight) -set (VIZ_MODULES_FOLDER_NAME VisualizationModules) +set (VIZ_MODULES_FOLDER_NAME Fwk/VizFwk) +################################################################################ # Setup the main platform defines -#----------------------------------------------------- +################################################################################ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") add_definitions(-DCVF_LINUX) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") @@ -16,23 +17,28 @@ else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") endif() -option (RESINSIGHT_USE_OPENMP "Enable OpenMP parallellization in the code" ON) +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(CMAKE_CXX_FLAGS "-DCVF_LINUX -pipe -Wextra -Woverloaded-virtual -Wformat") + set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -g3 -O0 -DDEBUG -D_DEBUG") + set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNO_DEBUG") +endif() + -IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - # Linux specific code - set(CMAKE_CXX_FLAGS "-DCVF_LINUX -pipe -Wextra -Woverloaded-virtual -Wformat") - set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -g3 -O0 -DDEBUG -D_DEBUG") - set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNO_DEBUG") - #set(CMAKE_EXE_LINKER_FLAGS "-Xlinker -rpath .") - if(RESINSIGHT_USE_OPENMP) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") - endif() -# set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g1") -ELSE() - if(RESINSIGHT_USE_OPENMP) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp") - endif() -ENDIF() +################################################################################ +# OpenMP +################################################################################ +option (RESINSIGHT_USE_OPENMP "Enable OpenMP parallellization in the code" ON) +if (RESINSIGHT_USE_OPENMP) + find_package(OpenMP) + if(OPENMP_FOUND) + message(STATUS "Enabling OpenMP support") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") + else() + message(STATUS "Disabling OpenMP support") + endif() +endif() ################################################################################ @@ -46,8 +52,10 @@ include (ResInsightVersion.cmake) ################################################################################ # Disable install of ERT libs and headers, as Ert code is compiled and linked directly -# into ResInsight -SET(INSTALL_ERT OFF CACHE BOOL "Build ERT without installing") +SET(INSTALL_ERT OFF CACHE BOOL "ERT: Install library") +SET(BUILD_SHARED_LIBS OFF CACHE BOOL "ERT: Build shared libraries") +SET(ERT_USE_OPENMP ${OPENMP_FOUND} CACHE BOOL "ERT: Compile using OpenMP") + add_subdirectory(ThirdParty/Ert/devel) @@ -98,12 +106,12 @@ include_directories( # Ceetron Application Framework ################################################################################ -add_subdirectory(cafProjectDataModel) -add_subdirectory(CommonCode) -add_subdirectory(cafAnimControl) -add_subdirectory(cafViewer) -add_subdirectory(cafUserInterface) -add_subdirectory(cafPdmCvf) +add_subdirectory(Fwk/AppFwk/cafProjectDataModel) +add_subdirectory(Fwk/AppFwk/CommonCode) +add_subdirectory(Fwk/AppFwk/cafAnimControl) +add_subdirectory(Fwk/AppFwk/cafViewer) +add_subdirectory(Fwk/AppFwk/cafUserInterface) +add_subdirectory(Fwk/AppFwk/cafPdmCvf) include_directories( ${cafUserInterface_SOURCE_DIR} diff --git a/CommonCode/cvfStructGridScalarDataAccess.h b/CommonCode/cvfStructGridScalarDataAccess.h deleted file mode 100644 index cbdac5ee4e..0000000000 --- a/CommonCode/cvfStructGridScalarDataAccess.h +++ /dev/null @@ -1,38 +0,0 @@ -//################################################################################################## -// -// Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. -// -//################################################################################################## - -#pragma once - -#include "cvfBase.h" -#include "cvfObject.h" -#include "cvfVector3.h" - - -namespace cvf { - - -class StructGridScalarDataAccess : public Object -{ -public: - virtual double cellScalar(size_t cellIndex) const = 0; - virtual void setCellScalar(size_t cellIndex, double value) = 0; -}; - - -} // namespace cvf diff --git a/CommonCode/CMakeLists.txt b/Fwk/AppFwk/CommonCode/CMakeLists.txt similarity index 100% rename from CommonCode/CMakeLists.txt rename to Fwk/AppFwk/CommonCode/CMakeLists.txt diff --git a/CommonCode/cafEffectCache.cpp b/Fwk/AppFwk/CommonCode/cafEffectCache.cpp similarity index 79% rename from CommonCode/cafEffectCache.cpp rename to Fwk/AppFwk/CommonCode/cafEffectCache.cpp index 5000acb1b0..d0734f361a 100644 --- a/CommonCode/cafEffectCache.cpp +++ b/Fwk/AppFwk/CommonCode/cafEffectCache.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafEffectGenerator.h" #include "cafEffectCache.h" diff --git a/CommonCode/cafEffectCache.h b/Fwk/AppFwk/CommonCode/cafEffectCache.h similarity index 60% rename from CommonCode/cafEffectCache.h rename to Fwk/AppFwk/CommonCode/cafEffectCache.h index d617d77d5b..c26e437b80 100644 --- a/CommonCode/cafEffectCache.h +++ b/Fwk/AppFwk/CommonCode/cafEffectCache.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfBase.h" diff --git a/CommonCode/cafEffectGenerator.cpp b/Fwk/AppFwk/CommonCode/cafEffectGenerator.cpp similarity index 95% rename from CommonCode/cafEffectGenerator.cpp rename to Fwk/AppFwk/CommonCode/cafEffectGenerator.cpp index 910dbcb2e0..84dcdc4a08 100644 --- a/CommonCode/cafEffectGenerator.cpp +++ b/Fwk/AppFwk/CommonCode/cafEffectGenerator.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafEffectGenerator.h" #include "cafUtils.h" @@ -43,8 +61,8 @@ namespace caf { -//############################################################################################################################# -//############################################################################################################################# +//============================================================================================================================= +//============================================================================================================================= static const char light_AmbientDiffuse_inl[] = " \n" "varying vec3 v_ecPosition; \n" diff --git a/CommonCode/cafEffectGenerator.h b/Fwk/AppFwk/CommonCode/cafEffectGenerator.h similarity index 87% rename from CommonCode/cafEffectGenerator.h rename to Fwk/AppFwk/CommonCode/cafEffectGenerator.h index 735008aac8..f2fc2f4420 100644 --- a/CommonCode/cafEffectGenerator.h +++ b/Fwk/AppFwk/CommonCode/cafEffectGenerator.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfBase.h" diff --git a/CommonCode/cafLog.cpp b/Fwk/AppFwk/CommonCode/cafLog.cpp similarity index 82% rename from CommonCode/cafLog.cpp rename to Fwk/AppFwk/CommonCode/cafLog.cpp index 76f5b047a6..aab270bd36 100644 --- a/CommonCode/cafLog.cpp +++ b/Fwk/AppFwk/CommonCode/cafLog.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfTrace.h" diff --git a/CommonCode/cafLog.h b/Fwk/AppFwk/CommonCode/cafLog.h similarity index 56% rename from CommonCode/cafLog.h rename to Fwk/AppFwk/CommonCode/cafLog.h index 31e2127b7f..00fb26c2d1 100644 --- a/CommonCode/cafLog.h +++ b/Fwk/AppFwk/CommonCode/cafLog.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once class QString; diff --git a/CommonCode/cafMessagePanel.cpp b/Fwk/AppFwk/CommonCode/cafMessagePanel.cpp similarity index 79% rename from CommonCode/cafMessagePanel.cpp rename to Fwk/AppFwk/CommonCode/cafMessagePanel.cpp index 0d0ece7dcf..88714f07f1 100644 --- a/CommonCode/cafMessagePanel.cpp +++ b/Fwk/AppFwk/CommonCode/cafMessagePanel.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafMessagePanel.h" #include diff --git a/CommonCode/cafMessagePanel.h b/Fwk/AppFwk/CommonCode/cafMessagePanel.h similarity index 57% rename from CommonCode/cafMessagePanel.h rename to Fwk/AppFwk/CommonCode/cafMessagePanel.h index d48dff62f8..65ab380145 100644 --- a/CommonCode/cafMessagePanel.h +++ b/Fwk/AppFwk/CommonCode/cafMessagePanel.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/CommonCode/cafMouseState.cpp b/Fwk/AppFwk/CommonCode/cafMouseState.cpp similarity index 88% rename from CommonCode/cafMouseState.cpp rename to Fwk/AppFwk/CommonCode/cafMouseState.cpp index 69d44f3d6d..a14040b23d 100644 --- a/CommonCode/cafMouseState.cpp +++ b/Fwk/AppFwk/CommonCode/cafMouseState.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfMath.h" #include "cafMouseState.h" diff --git a/CommonCode/cafMouseState.h b/Fwk/AppFwk/CommonCode/cafMouseState.h similarity index 71% rename from CommonCode/cafMouseState.h rename to Fwk/AppFwk/CommonCode/cafMouseState.h index bb072b1062..e8db4c3990 100644 --- a/CommonCode/cafMouseState.h +++ b/Fwk/AppFwk/CommonCode/cafMouseState.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once class QMouseEvent; diff --git a/CommonCode/cafUtils.cpp b/Fwk/AppFwk/CommonCode/cafUtils.cpp similarity index 77% rename from CommonCode/cafUtils.cpp rename to Fwk/AppFwk/CommonCode/cafUtils.cpp index 41434fed1b..53a25f9c74 100644 --- a/CommonCode/cafUtils.cpp +++ b/Fwk/AppFwk/CommonCode/cafUtils.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafUtils.h" #include diff --git a/CommonCode/cafUtils.h b/Fwk/AppFwk/CommonCode/cafUtils.h similarity index 57% rename from CommonCode/cafUtils.h rename to Fwk/AppFwk/CommonCode/cafUtils.h index 248eeef537..27e85796c8 100644 --- a/CommonCode/cafUtils.h +++ b/Fwk/AppFwk/CommonCode/cafUtils.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once class QLineEdit; diff --git a/CommonCode/cvfStructGrid.cpp b/Fwk/AppFwk/CommonCode/cvfStructGrid.cpp similarity index 90% rename from CommonCode/cvfStructGrid.cpp rename to Fwk/AppFwk/CommonCode/cvfStructGrid.cpp index cbd42c01f4..91a84021fe 100644 --- a/CommonCode/cvfStructGrid.cpp +++ b/Fwk/AppFwk/CommonCode/cvfStructGrid.cpp @@ -1,23 +1,41 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfStructGrid.h" diff --git a/CommonCode/cvfStructGrid.h b/Fwk/AppFwk/CommonCode/cvfStructGrid.h similarity index 74% rename from CommonCode/cvfStructGrid.h rename to Fwk/AppFwk/CommonCode/cvfStructGrid.h index 4353192b74..cde6c212ce 100644 --- a/CommonCode/cvfStructGrid.h +++ b/Fwk/AppFwk/CommonCode/cvfStructGrid.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/CommonCode/cvfStructGridGeometryGenerator.cpp b/Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.cpp similarity index 93% rename from CommonCode/cvfStructGridGeometryGenerator.cpp rename to Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.cpp index 18f7591bb7..0cd2bfe5ee 100644 --- a/CommonCode/cvfStructGridGeometryGenerator.cpp +++ b/Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfStructGrid.h" diff --git a/CommonCode/cvfStructGridGeometryGenerator.h b/Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.h similarity index 83% rename from CommonCode/cvfStructGridGeometryGenerator.h rename to Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.h index 26d9c7be11..14b9691a61 100644 --- a/CommonCode/cvfStructGridGeometryGenerator.h +++ b/Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/Fwk/AppFwk/CommonCode/cvfStructGridScalarDataAccess.h b/Fwk/AppFwk/CommonCode/cvfStructGridScalarDataAccess.h new file mode 100644 index 0000000000..506c7d45ed --- /dev/null +++ b/Fwk/AppFwk/CommonCode/cvfStructGridScalarDataAccess.h @@ -0,0 +1,56 @@ +//################################################################################################## +// +// Custom Visualization Core library +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. +// +//################################################################################################## + + +#pragma once + +#include "cvfBase.h" +#include "cvfObject.h" +#include "cvfVector3.h" + + +namespace cvf { + + +class StructGridScalarDataAccess : public Object +{ +public: + virtual double cellScalar(size_t cellIndex) const = 0; + virtual void setCellScalar(size_t cellIndex, double value) = 0; +}; + + +} // namespace cvf diff --git a/cafAnimControl/CMakeLists.txt b/Fwk/AppFwk/cafAnimControl/CMakeLists.txt similarity index 100% rename from cafAnimControl/CMakeLists.txt rename to Fwk/AppFwk/cafAnimControl/CMakeLists.txt diff --git a/cafAnimControl/Resources/Fast.png b/Fwk/AppFwk/cafAnimControl/Resources/Fast.png similarity index 100% rename from cafAnimControl/Resources/Fast.png rename to Fwk/AppFwk/cafAnimControl/Resources/Fast.png diff --git a/cafAnimControl/Resources/Pause.png b/Fwk/AppFwk/cafAnimControl/Resources/Pause.png similarity index 100% rename from cafAnimControl/Resources/Pause.png rename to Fwk/AppFwk/cafAnimControl/Resources/Pause.png diff --git a/cafAnimControl/Resources/Play.png b/Fwk/AppFwk/cafAnimControl/Resources/Play.png similarity index 100% rename from cafAnimControl/Resources/Play.png rename to Fwk/AppFwk/cafAnimControl/Resources/Play.png diff --git a/cafAnimControl/Resources/PlayBwd.png b/Fwk/AppFwk/cafAnimControl/Resources/PlayBwd.png similarity index 100% rename from cafAnimControl/Resources/PlayBwd.png rename to Fwk/AppFwk/cafAnimControl/Resources/PlayBwd.png diff --git a/cafAnimControl/Resources/RepeatFromStart.png b/Fwk/AppFwk/cafAnimControl/Resources/RepeatFromStart.png similarity index 100% rename from cafAnimControl/Resources/RepeatFromStart.png rename to Fwk/AppFwk/cafAnimControl/Resources/RepeatFromStart.png diff --git a/cafAnimControl/Resources/RepeatFwdBwd.png b/Fwk/AppFwk/cafAnimControl/Resources/RepeatFwdBwd.png similarity index 100% rename from cafAnimControl/Resources/RepeatFwdBwd.png rename to Fwk/AppFwk/cafAnimControl/Resources/RepeatFwdBwd.png diff --git a/cafAnimControl/Resources/SkipToEnd.png b/Fwk/AppFwk/cafAnimControl/Resources/SkipToEnd.png similarity index 100% rename from cafAnimControl/Resources/SkipToEnd.png rename to Fwk/AppFwk/cafAnimControl/Resources/SkipToEnd.png diff --git a/cafAnimControl/Resources/SkipToStart.png b/Fwk/AppFwk/cafAnimControl/Resources/SkipToStart.png similarity index 100% rename from cafAnimControl/Resources/SkipToStart.png rename to Fwk/AppFwk/cafAnimControl/Resources/SkipToStart.png diff --git a/cafAnimControl/Resources/Slow.png b/Fwk/AppFwk/cafAnimControl/Resources/Slow.png similarity index 100% rename from cafAnimControl/Resources/Slow.png rename to Fwk/AppFwk/cafAnimControl/Resources/Slow.png diff --git a/cafAnimControl/Resources/StepBwd.png b/Fwk/AppFwk/cafAnimControl/Resources/StepBwd.png similarity index 100% rename from cafAnimControl/Resources/StepBwd.png rename to Fwk/AppFwk/cafAnimControl/Resources/StepBwd.png diff --git a/cafAnimControl/Resources/StepFwd.png b/Fwk/AppFwk/cafAnimControl/Resources/StepFwd.png similarity index 100% rename from cafAnimControl/Resources/StepFwd.png rename to Fwk/AppFwk/cafAnimControl/Resources/StepFwd.png diff --git a/cafAnimControl/Resources/Stop.png b/Fwk/AppFwk/cafAnimControl/Resources/Stop.png similarity index 100% rename from cafAnimControl/Resources/Stop.png rename to Fwk/AppFwk/cafAnimControl/Resources/Stop.png diff --git a/cafAnimControl/Resources/cafAnimControl.qrc b/Fwk/AppFwk/cafAnimControl/Resources/cafAnimControl.qrc similarity index 100% rename from cafAnimControl/Resources/cafAnimControl.qrc rename to Fwk/AppFwk/cafAnimControl/Resources/cafAnimControl.qrc diff --git a/cafAnimControl/cafAnimationToolBar.cpp b/Fwk/AppFwk/cafAnimControl/cafAnimationToolBar.cpp similarity index 92% rename from cafAnimControl/cafAnimationToolBar.cpp rename to Fwk/AppFwk/cafAnimControl/cafAnimationToolBar.cpp index ab0c5ba7b1..3121662b04 100644 --- a/cafAnimControl/cafAnimationToolBar.cpp +++ b/Fwk/AppFwk/cafAnimControl/cafAnimationToolBar.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafAnimationToolBar.h" #include diff --git a/cafAnimControl/cafAnimationToolBar.h b/Fwk/AppFwk/cafAnimControl/cafAnimationToolBar.h similarity index 70% rename from cafAnimControl/cafAnimationToolBar.h rename to Fwk/AppFwk/cafAnimControl/cafAnimationToolBar.h index 527e2c2b55..e09bd0c521 100644 --- a/cafAnimControl/cafAnimationToolBar.h +++ b/Fwk/AppFwk/cafAnimControl/cafAnimationToolBar.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/cafAnimControl/cafFrameAnimationControl.cpp b/Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.cpp similarity index 92% rename from cafAnimControl/cafFrameAnimationControl.cpp rename to Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.cpp index 4ec1e04953..8a10a2dd73 100644 --- a/cafAnimControl/cafFrameAnimationControl.cpp +++ b/Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafFrameAnimationControl.h" #include "qtimer.h" diff --git a/cafAnimControl/cafFrameAnimationControl.h b/Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.h similarity index 70% rename from cafAnimControl/cafFrameAnimationControl.h rename to Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.h index 755e51185c..89023c76e6 100644 --- a/cafAnimControl/cafFrameAnimationControl.h +++ b/Fwk/AppFwk/cafAnimControl/cafFrameAnimationControl.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/cafPdmCvf/CMakeLists.txt b/Fwk/AppFwk/cafPdmCvf/CMakeLists.txt similarity index 100% rename from cafPdmCvf/CMakeLists.txt rename to Fwk/AppFwk/cafPdmCvf/CMakeLists.txt diff --git a/cafPdmCvf/cafPdmFieldCvfColor.cpp b/Fwk/AppFwk/cafPdmCvf/cafPdmFieldCvfColor.cpp similarity index 53% rename from cafPdmCvf/cafPdmFieldCvfColor.cpp rename to Fwk/AppFwk/cafPdmCvf/cafPdmFieldCvfColor.cpp index def8fe5ebe..17bafcf76f 100644 --- a/cafPdmCvf/cafPdmFieldCvfColor.cpp +++ b/Fwk/AppFwk/cafPdmCvf/cafPdmFieldCvfColor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include #include "cvfBase.h" diff --git a/cafPdmCvf/cafPdmFieldCvfColor.h b/Fwk/AppFwk/cafPdmCvf/cafPdmFieldCvfColor.h similarity index 69% rename from cafPdmCvf/cafPdmFieldCvfColor.h rename to Fwk/AppFwk/cafPdmCvf/cafPdmFieldCvfColor.h index 3d68d6351a..d8f7a5c777 100644 --- a/cafPdmCvf/cafPdmFieldCvfColor.h +++ b/Fwk/AppFwk/cafPdmCvf/cafPdmFieldCvfColor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include #include diff --git a/cafPdmCvf/cafPdmFieldCvfMat4d.cpp b/Fwk/AppFwk/cafPdmCvf/cafPdmFieldCvfMat4d.cpp similarity index 55% rename from cafPdmCvf/cafPdmFieldCvfMat4d.cpp rename to Fwk/AppFwk/cafPdmCvf/cafPdmFieldCvfMat4d.cpp index 1df6fcc652..ea16aafe1e 100644 --- a/cafPdmCvf/cafPdmFieldCvfMat4d.cpp +++ b/Fwk/AppFwk/cafPdmCvf/cafPdmFieldCvfMat4d.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include // Includes needed for field editor registration diff --git a/cafPdmCvf/cafPdmFieldCvfMat4d.h b/Fwk/AppFwk/cafPdmCvf/cafPdmFieldCvfMat4d.h similarity index 69% rename from cafPdmCvf/cafPdmFieldCvfMat4d.h rename to Fwk/AppFwk/cafPdmCvf/cafPdmFieldCvfMat4d.h index ed27923756..7afa2f1f3d 100644 --- a/cafPdmCvf/cafPdmFieldCvfMat4d.h +++ b/Fwk/AppFwk/cafPdmCvf/cafPdmFieldCvfMat4d.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include #include diff --git a/cafProjectDataModel/CMakeLists.txt b/Fwk/AppFwk/cafProjectDataModel/CMakeLists.txt similarity index 100% rename from cafProjectDataModel/CMakeLists.txt rename to Fwk/AppFwk/cafProjectDataModel/CMakeLists.txt diff --git a/cafProjectDataModel/cafAppEnum.h b/Fwk/AppFwk/cafProjectDataModel/cafAppEnum.h similarity index 90% rename from cafProjectDataModel/cafAppEnum.h rename to Fwk/AppFwk/cafProjectDataModel/cafAppEnum.h index 11ec828b34..927f416c67 100644 --- a/cafProjectDataModel/cafAppEnum.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafAppEnum.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/cafProjectDataModel/cafFactory.h b/Fwk/AppFwk/cafProjectDataModel/cafFactory.h similarity index 79% rename from cafProjectDataModel/cafFactory.h rename to Fwk/AppFwk/cafProjectDataModel/cafFactory.h index aa5e95725d..e4712b3cd5 100644 --- a/cafProjectDataModel/cafFactory.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafFactory.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/cafProjectDataModel/cafFixedArray.h b/Fwk/AppFwk/cafProjectDataModel/cafFixedArray.h similarity index 61% rename from cafProjectDataModel/cafFixedArray.h rename to Fwk/AppFwk/cafProjectDataModel/cafFixedArray.h index 40b9f14a76..d52d8d92dd 100644 --- a/cafProjectDataModel/cafFixedArray.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafFixedArray.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace caf diff --git a/cafProjectDataModel/cafOmpMutex.h b/Fwk/AppFwk/cafProjectDataModel/cafOmpMutex.h similarity index 68% rename from cafProjectDataModel/cafOmpMutex.h rename to Fwk/AppFwk/cafProjectDataModel/cafOmpMutex.h index 98b4e65326..3887bf2b18 100644 --- a/cafProjectDataModel/cafOmpMutex.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafOmpMutex.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/cafProjectDataModel/cafPdmDocument.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.cpp similarity index 85% rename from cafProjectDataModel/cafPdmDocument.cpp rename to Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.cpp index 8bc3cac261..d6c3c5504b 100644 --- a/cafProjectDataModel/cafPdmDocument.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmDocument.h" #include diff --git a/cafProjectDataModel/cafPdmDocument.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.h similarity index 78% rename from cafProjectDataModel/cafPdmDocument.h rename to Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.h index 8c58fe950f..bdd8ff8e4e 100644 --- a/cafProjectDataModel/cafPdmDocument.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmField.h" #include "cafPdmObject.h" diff --git a/cafProjectDataModel/cafPdmField.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmField.cpp similarity index 85% rename from cafProjectDataModel/cafPdmField.cpp rename to Fwk/AppFwk/cafProjectDataModel/cafPdmField.cpp index bda3dbeb01..a266bb290b 100644 --- a/cafProjectDataModel/cafPdmField.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmField.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmField.h" #include "cafPdmObject.h" diff --git a/cafProjectDataModel/cafPdmField.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmField.h similarity index 91% rename from cafProjectDataModel/cafPdmField.h rename to Fwk/AppFwk/cafProjectDataModel/cafPdmField.h index 22b0d081f7..17daab0bc9 100644 --- a/cafProjectDataModel/cafPdmField.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmField.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiItem.h" diff --git a/cafProjectDataModel/cafPdmField.inl b/Fwk/AppFwk/cafProjectDataModel/cafPdmField.inl similarity index 96% rename from cafProjectDataModel/cafPdmField.inl rename to Fwk/AppFwk/cafProjectDataModel/cafPdmField.inl index b9e538653c..efeffa85a9 100644 --- a/cafProjectDataModel/cafPdmField.inl +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmField.inl @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmObject.h" #include #include diff --git a/cafProjectDataModel/cafPdmFieldImpl.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmFieldImpl.h similarity index 93% rename from cafProjectDataModel/cafPdmFieldImpl.h rename to Fwk/AppFwk/cafProjectDataModel/cafPdmFieldImpl.h index ac3bb79c51..13deae974a 100644 --- a/cafProjectDataModel/cafPdmFieldImpl.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmFieldImpl.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include #include diff --git a/cafProjectDataModel/cafPdmObject.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmObject.cpp similarity index 88% rename from cafProjectDataModel/cafPdmObject.cpp rename to Fwk/AppFwk/cafProjectDataModel/cafPdmObject.cpp index 533a6d39f6..9f6acd1a49 100644 --- a/cafProjectDataModel/cafPdmObject.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmObject.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmField.h" #include "cafPdmObject.h" @@ -380,9 +398,25 @@ PdmUiTreeOrdering* PdmObject::uiTreeOrdering(QString uiConfigName /*= ""*/) for (size_t fIdx = 0; fIdx < m_fields.size(); ++fIdx) { - if ( (m_fields[fIdx]->hasChildObjects()) && !uiTreeOrdering->containsField(m_fields[fIdx])) + if (m_fields[fIdx]->hasChildObjects() && !uiTreeOrdering->containsField(m_fields[fIdx])) { - uiTreeOrdering->add( m_fields[fIdx]); + if (m_fields[fIdx]->isUiHidden() && !m_fields[fIdx]->isUiChildrenHidden()) + { + std::vector children; + m_fields[fIdx]->childObjects(&children); + + for (size_t cIdx = 0; cIdx < children.size(); cIdx++) + { + if (!uiTreeOrdering->containsObject(children[cIdx])) + { + uiTreeOrdering->add(children[cIdx]); + } + } + } + else if ( !m_fields[fIdx]->isUiHidden()) + { + uiTreeOrdering->add(m_fields[fIdx]); + } } } } @@ -404,7 +438,7 @@ void PdmObject::expandUiTree(PdmUiTreeOrdering* root, QString uiConfigName /*= " if (!root->isSubTreeDefined() && root->dataObject()) { - if (root->m_field) + if (root->m_field && !root->m_field->isUiChildrenHidden(uiConfigName)) { std::vector fieldsChildObjects; root->m_field->childObjects(&fieldsChildObjects); diff --git a/cafProjectDataModel/cafPdmObject.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmObject.h similarity index 92% rename from cafProjectDataModel/cafPdmObject.h rename to Fwk/AppFwk/cafProjectDataModel/cafPdmObject.h index f91bbce329..75fd509b53 100644 --- a/cafProjectDataModel/cafPdmObject.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmObject.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiItem.h" diff --git a/cafProjectDataModel/cafPdmObjectFactory.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmObjectFactory.h similarity index 71% rename from cafProjectDataModel/cafPdmObjectFactory.h rename to Fwk/AppFwk/cafProjectDataModel/cafPdmObjectFactory.h index bdbd74a29f..76e6348655 100644 --- a/cafProjectDataModel/cafPdmObjectFactory.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmObjectFactory.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/cafProjectDataModel/cafPdmPointer.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmPointer.cpp similarity index 59% rename from cafProjectDataModel/cafPdmPointer.cpp rename to Fwk/AppFwk/cafProjectDataModel/cafPdmPointer.cpp index cf484f7bad..1ab0948343 100644 --- a/cafProjectDataModel/cafPdmPointer.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmPointer.cpp @@ -1,21 +1,39 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmObject.h" #include "cafPdmPointer.h" diff --git a/cafProjectDataModel/cafPdmPointer.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmPointer.h similarity index 79% rename from cafProjectDataModel/cafPdmPointer.h rename to Fwk/AppFwk/cafProjectDataModel/cafPdmPointer.h index 50fa8ca96e..c9ca2359fd 100644 --- a/cafProjectDataModel/cafPdmPointer.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmPointer.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once diff --git a/cafProjectDataModel/cafPdmUiEditorHandle.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiEditorHandle.cpp similarity index 57% rename from cafProjectDataModel/cafPdmUiEditorHandle.cpp rename to Fwk/AppFwk/cafProjectDataModel/cafPdmUiEditorHandle.cpp index 6a01a8e719..b59abf0564 100644 --- a/cafProjectDataModel/cafPdmUiEditorHandle.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiEditorHandle.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiEditorHandle.h" #include "cafPdmUiItem.h" diff --git a/cafProjectDataModel/cafPdmUiEditorHandle.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiEditorHandle.h similarity index 75% rename from cafProjectDataModel/cafPdmUiEditorHandle.h rename to Fwk/AppFwk/cafProjectDataModel/cafPdmUiEditorHandle.h index c32c2cfeae..c03dc8a66e 100644 --- a/cafProjectDataModel/cafPdmUiEditorHandle.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiEditorHandle.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include #include diff --git a/cafProjectDataModel/cafPdmUiFieldEditorHandle.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiFieldEditorHandle.cpp similarity index 74% rename from cafProjectDataModel/cafPdmUiFieldEditorHandle.cpp rename to Fwk/AppFwk/cafProjectDataModel/cafPdmUiFieldEditorHandle.cpp index a820555fe2..2d0ecdc277 100644 --- a/cafProjectDataModel/cafPdmUiFieldEditorHandle.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiFieldEditorHandle.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiFieldEditorHandle.h" #include "cafPdmField.h" diff --git a/cafProjectDataModel/cafPdmUiFieldEditorHandle.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiFieldEditorHandle.h similarity index 82% rename from cafProjectDataModel/cafPdmUiFieldEditorHandle.h rename to Fwk/AppFwk/cafProjectDataModel/cafPdmUiFieldEditorHandle.h index 44b3828995..b685d1fa5a 100644 --- a/cafProjectDataModel/cafPdmUiFieldEditorHandle.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiFieldEditorHandle.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include #include diff --git a/cafProjectDataModel/cafPdmUiItem.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiItem.cpp similarity index 91% rename from cafProjectDataModel/cafPdmUiItem.cpp rename to Fwk/AppFwk/cafProjectDataModel/cafPdmUiItem.cpp index 883b76a86f..8ecc7533c4 100644 --- a/cafProjectDataModel/cafPdmUiItem.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiItem.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiItem.h" #include "cafPdmUiEditorHandle.h" diff --git a/cafProjectDataModel/cafPdmUiItem.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiItem.h similarity index 88% rename from cafProjectDataModel/cafPdmUiItem.h rename to Fwk/AppFwk/cafProjectDataModel/cafPdmUiItem.h index 62a3e3f337..00de8915e3 100644 --- a/cafProjectDataModel/cafPdmUiItem.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiItem.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include #include diff --git a/cafProjectDataModel/cafPdmUiObjectEditorHandle.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiObjectEditorHandle.cpp similarity index 62% rename from cafProjectDataModel/cafPdmUiObjectEditorHandle.cpp rename to Fwk/AppFwk/cafProjectDataModel/cafPdmUiObjectEditorHandle.cpp index d1892e5291..f5b845ab81 100644 --- a/cafProjectDataModel/cafPdmUiObjectEditorHandle.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiObjectEditorHandle.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiObjectEditorHandle.h" #include "cafPdmObject.h" diff --git a/cafProjectDataModel/cafPdmUiObjectEditorHandle.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiObjectEditorHandle.h similarity index 60% rename from cafProjectDataModel/cafPdmUiObjectEditorHandle.h rename to Fwk/AppFwk/cafProjectDataModel/cafPdmUiObjectEditorHandle.h index 954880b170..45138b2f35 100644 --- a/cafProjectDataModel/cafPdmUiObjectEditorHandle.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiObjectEditorHandle.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include #include diff --git a/cafProjectDataModel/cafPdmUiOrdering.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiOrdering.cpp similarity index 66% rename from cafProjectDataModel/cafPdmUiOrdering.cpp rename to Fwk/AppFwk/cafProjectDataModel/cafPdmUiOrdering.cpp index 73447dd78e..b2891ddb45 100644 --- a/cafProjectDataModel/cafPdmUiOrdering.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiOrdering.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiOrdering.h" diff --git a/cafProjectDataModel/cafPdmUiOrdering.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiOrdering.h similarity index 72% rename from cafProjectDataModel/cafPdmUiOrdering.h rename to Fwk/AppFwk/cafProjectDataModel/cafPdmUiOrdering.h index 9ef651ba4f..ba952cbb72 100644 --- a/cafProjectDataModel/cafPdmUiOrdering.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiOrdering.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include #include diff --git a/cafProjectDataModel/cafPdmUiTreeOrdering.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiTreeOrdering.cpp similarity index 64% rename from cafProjectDataModel/cafPdmUiTreeOrdering.cpp rename to Fwk/AppFwk/cafProjectDataModel/cafPdmUiTreeOrdering.cpp index 0ac0cede76..9135a6c07d 100644 --- a/cafProjectDataModel/cafPdmUiTreeOrdering.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiTreeOrdering.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiTreeOrdering.h" #include "cafPdmField.h" @@ -54,14 +72,14 @@ namespace caf //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- - bool PdmUiTreeOrdering::containsField(PdmFieldHandle* field) + bool PdmUiTreeOrdering::containsField(const PdmFieldHandle* field) { assert (field); for (int cIdx = 0; cIdx < this->childCount(); ++cIdx) { PdmUiTreeOrdering* child = dynamic_cast(this->child(cIdx)); - if (!(child->m_field == field)) + if (child->m_field == field) { return true; } @@ -70,6 +88,26 @@ namespace caf return false; } + //-------------------------------------------------------------------------------------------------- + /// + //-------------------------------------------------------------------------------------------------- + bool PdmUiTreeOrdering::containsObject(const PdmObject* object) + { + assert (object); + for (int cIdx = 0; cIdx < this->childCount(); ++cIdx) + { + PdmUiTreeOrdering* child = dynamic_cast(this->child(cIdx)); + + if (child->dataObject() == object) + { + return true; + } + } + + return false; + } + + //-------------------------------------------------------------------------------------------------- /// Creates an new PdmUiTreeOrdering item, and adds it to parent. If position is -1, it is added /// at the end of parents existing child list. @@ -83,5 +121,7 @@ namespace caf } + + } //End of namespace caf diff --git a/cafProjectDataModel/cafPdmUiTreeOrdering.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiTreeOrdering.h similarity index 65% rename from cafProjectDataModel/cafPdmUiTreeOrdering.h rename to Fwk/AppFwk/cafProjectDataModel/cafPdmUiTreeOrdering.h index 652d2af179..5d9def89b4 100644 --- a/cafProjectDataModel/cafPdmUiTreeOrdering.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiTreeOrdering.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include #include @@ -39,6 +57,7 @@ class PdmFieldHandle; class PdmUiTreeOrdering : public UiTreeItem< PdmPointer > { +public: PdmUiTreeOrdering(PdmUiTreeOrdering* parent = NULL, int position = -1, PdmObject* dataObject = NULL); void add(PdmFieldHandle * field); @@ -50,11 +69,14 @@ class PdmUiTreeOrdering : public UiTreeItem< PdmPointer > /// To stop the tree generation at this level, setSubTreeDefined to true void setSubTreeDefined(bool isSubTreeDefined ) { m_isSubTreeDefined = isSubTreeDefined; } + PdmFieldHandle* field() const { return m_field; } + private: friend class PdmObject; bool forgetRemainingFields() const { return m_forgetRemainingFields; } bool isSubTreeDefined() const { return m_isSubTreeDefined; } - bool containsField(PdmFieldHandle* field); + bool containsField(const PdmFieldHandle* field); + bool containsObject(const PdmObject* object); private: PdmFieldHandle* m_field; diff --git a/cafProjectDataModel/cafUiTreeItem.h b/Fwk/AppFwk/cafProjectDataModel/cafUiTreeItem.h similarity index 77% rename from cafProjectDataModel/cafUiTreeItem.h rename to Fwk/AppFwk/cafProjectDataModel/cafUiTreeItem.h index 8ee67e3072..af5bd24def 100644 --- a/cafProjectDataModel/cafUiTreeItem.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafUiTreeItem.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once //#include diff --git a/cafUserInterface/CMakeLists.txt b/Fwk/AppFwk/cafUserInterface/CMakeLists.txt similarity index 100% rename from cafUserInterface/CMakeLists.txt rename to Fwk/AppFwk/cafUserInterface/CMakeLists.txt diff --git a/cafUserInterface/cafBasicAboutDialog.cpp b/Fwk/AppFwk/cafUserInterface/cafBasicAboutDialog.cpp similarity index 90% rename from cafUserInterface/cafBasicAboutDialog.cpp rename to Fwk/AppFwk/cafUserInterface/cafBasicAboutDialog.cpp index 5a1506eed8..8a31f887c6 100644 --- a/cafUserInterface/cafBasicAboutDialog.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafBasicAboutDialog.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafBasicAboutDialog.h" #include diff --git a/cafUserInterface/cafBasicAboutDialog.h b/Fwk/AppFwk/cafUserInterface/cafBasicAboutDialog.h similarity index 68% rename from cafUserInterface/cafBasicAboutDialog.h rename to Fwk/AppFwk/cafUserInterface/cafBasicAboutDialog.h index d94256e388..7f4df36178 100644 --- a/cafUserInterface/cafBasicAboutDialog.h +++ b/Fwk/AppFwk/cafUserInterface/cafBasicAboutDialog.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/cafUserInterface/cafPdmUiCheckBoxEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiCheckBoxEditor.cpp similarity index 73% rename from cafUserInterface/cafPdmUiCheckBoxEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiCheckBoxEditor.cpp index 84a9cdd207..748cf69a9a 100644 --- a/cafUserInterface/cafPdmUiCheckBoxEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiCheckBoxEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiCheckBoxEditor.h" #include "cafPdmUiDefaultObjectEditor.h" @@ -59,6 +77,7 @@ void PdmUiCheckBoxEditor::configureAndUpdateUi(const QString& uiConfigName) m_label->setToolTip(field()->uiToolTip(uiConfigName)); m_checkBox->setEnabled(!field()->isUiReadOnly(uiConfigName)); + m_checkBox->setToolTip(field()->uiToolTip(uiConfigName)); PdmUiCheckBoxEditorAttribute attributes; field()->ownerObject()->editorAttribute(field(), uiConfigName, &attributes); diff --git a/cafUserInterface/cafPdmUiCheckBoxEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiCheckBoxEditor.h similarity index 61% rename from cafUserInterface/cafPdmUiCheckBoxEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiCheckBoxEditor.h index 68bb512e28..6b01f50e5a 100644 --- a/cafUserInterface/cafPdmUiCheckBoxEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiCheckBoxEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiFieldEditorHandle.h" diff --git a/cafUserInterface/cafPdmUiColorEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiColorEditor.cpp similarity index 83% rename from cafUserInterface/cafPdmUiColorEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiColorEditor.cpp index 450d8511f6..18e8ad2ec8 100644 --- a/cafUserInterface/cafPdmUiColorEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiColorEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiColorEditor.h" #include "cafPdmUiDefaultObjectEditor.h" diff --git a/cafUserInterface/cafPdmUiColorEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiColorEditor.h similarity index 67% rename from cafUserInterface/cafPdmUiColorEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiColorEditor.h index 367f09b8b6..32205d4795 100644 --- a/cafUserInterface/cafPdmUiColorEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiColorEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiFieldEditorHandle.h" diff --git a/cafUserInterface/cafPdmUiComboBoxEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.cpp similarity index 76% rename from cafUserInterface/cafPdmUiComboBoxEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.cpp index f0f68ac396..7931de06ce 100644 --- a/cafUserInterface/cafPdmUiComboBoxEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiComboBoxEditor.h" #include "cafPdmObject.h" diff --git a/cafUserInterface/cafPdmUiComboBoxEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.h similarity index 62% rename from cafUserInterface/cafPdmUiComboBoxEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.h index 8e4b3d4c71..b9c0480cda 100644 --- a/cafUserInterface/cafPdmUiComboBoxEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiFieldEditorHandle.h" diff --git a/cafUserInterface/cafPdmUiDefaultObjectEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiDefaultObjectEditor.cpp similarity index 91% rename from cafUserInterface/cafPdmUiDefaultObjectEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiDefaultObjectEditor.cpp index d79c08c9dd..822d2c3185 100644 --- a/cafUserInterface/cafPdmUiDefaultObjectEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiDefaultObjectEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiDefaultObjectEditor.h" #include "cafPdmObject.h" diff --git a/cafUserInterface/cafPdmUiDefaultObjectEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiDefaultObjectEditor.h similarity index 65% rename from cafUserInterface/cafPdmUiDefaultObjectEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiDefaultObjectEditor.h index 5cd2daec3b..3d3a19ba92 100644 --- a/cafUserInterface/cafPdmUiDefaultObjectEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiDefaultObjectEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiObjectEditorHandle.h" #include diff --git a/cafUserInterface/cafPdmUiDoubleSliderEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiDoubleSliderEditor.cpp similarity index 87% rename from cafUserInterface/cafPdmUiDoubleSliderEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiDoubleSliderEditor.cpp index 0fb790dfa8..b875d5f266 100644 --- a/cafUserInterface/cafPdmUiDoubleSliderEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiDoubleSliderEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiDoubleSliderEditor.h" #include "cafPdmUiDefaultObjectEditor.h" diff --git a/cafUserInterface/cafPdmUiDoubleSliderEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiDoubleSliderEditor.h similarity index 68% rename from cafUserInterface/cafPdmUiDoubleSliderEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiDoubleSliderEditor.h index 3e4d489e1a..f92cb32c67 100644 --- a/cafUserInterface/cafPdmUiDoubleSliderEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiDoubleSliderEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiFieldEditorHandle.h" diff --git a/cafUserInterface/cafPdmUiFilePathEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiFilePathEditor.cpp similarity index 83% rename from cafUserInterface/cafPdmUiFilePathEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiFilePathEditor.cpp index 64070a63c3..1b3f92c7b7 100644 --- a/cafUserInterface/cafPdmUiFilePathEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiFilePathEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiFilePathEditor.h" #include "cafPdmUiDefaultObjectEditor.h" @@ -63,8 +81,10 @@ void PdmUiFilePathEditor::configureAndUpdateUi(const QString& uiConfigName) } m_label->setEnabled(!field()->isUiReadOnly(uiConfigName)); + m_label->setToolTip(field()->uiToolTip(uiConfigName)); m_lineEdit->setEnabled(!field()->isUiReadOnly(uiConfigName)); + m_lineEdit->setToolTip(field()->uiToolTip(uiConfigName)); field()->ownerObject()->editorAttribute(field(), uiConfigName, &m_attributes); diff --git a/cafUserInterface/cafPdmUiFilePathEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiFilePathEditor.h similarity index 68% rename from cafUserInterface/cafPdmUiFilePathEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiFilePathEditor.h index 49eb90c44c..5826cc65cb 100644 --- a/cafUserInterface/cafPdmUiFilePathEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiFilePathEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiFieldEditorHandle.h" #include diff --git a/cafUserInterface/cafPdmUiLineEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp similarity index 75% rename from cafUserInterface/cafPdmUiLineEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp index 0e9b59bc51..fbcc9c26da 100644 --- a/cafUserInterface/cafPdmUiLineEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiLineEditor.h" #include "cafPdmUiDefaultObjectEditor.h" @@ -61,7 +79,10 @@ void PdmUiLineEditor::configureAndUpdateUi(const QString& uiConfigName) } m_label->setEnabled(!field()->isUiReadOnly(uiConfigName)); + m_label->setToolTip(field()->uiToolTip(uiConfigName)); + m_lineEdit->setEnabled(!field()->isUiReadOnly(uiConfigName)); + m_lineEdit->setToolTip(field()->uiToolTip(uiConfigName)); PdmUiLineEditorAttribute leab; field()->ownerObject()->editorAttribute(field(), uiConfigName, &leab); diff --git a/cafUserInterface/cafPdmUiLineEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.h similarity index 64% rename from cafUserInterface/cafPdmUiLineEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.h index d6dbed42ee..c444a5c1de 100644 --- a/cafUserInterface/cafPdmUiLineEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiLineEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiFieldEditorHandle.h" #include diff --git a/cafUserInterface/cafPdmUiListEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiListEditor.cpp similarity index 90% rename from cafUserInterface/cafPdmUiListEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiListEditor.cpp index 0a715b23d5..059d7e4c52 100644 --- a/cafUserInterface/cafPdmUiListEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiListEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiListEditor.h" #include "cafPdmUiDefaultObjectEditor.h" @@ -112,7 +130,10 @@ void PdmUiListEditor::configureAndUpdateUi(const QString& uiConfigName) } m_label->setEnabled(!field()->isUiReadOnly(uiConfigName)); + m_label->setToolTip(field()->uiToolTip(uiConfigName)); + m_listView->setEnabled(!field()->isUiReadOnly(uiConfigName)); + m_listView->setToolTip(field()->uiToolTip(uiConfigName)); /// Demo code Not used yet // PdmUiListEditorAttribute attributes; diff --git a/cafUserInterface/cafPdmUiListEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiListEditor.h similarity index 68% rename from cafUserInterface/cafPdmUiListEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiListEditor.h index 1135e51060..a8530a14aa 100644 --- a/cafUserInterface/cafPdmUiListEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiListEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiFieldEditorHandle.h" diff --git a/cafUserInterface/cafPdmUiListView.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiListView.cpp similarity index 62% rename from cafUserInterface/cafPdmUiListView.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiListView.cpp index 944f85b3e5..f9bd1d805c 100644 --- a/cafUserInterface/cafPdmUiListView.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiListView.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiListView.h" #include "cafPdmObject.h" @@ -44,7 +62,10 @@ PdmUiListView::PdmUiListView(QWidget* parent, Qt::WindowFlags f) m_listViewEditor = new PdmUiListViewEditor(); - m_layout->addWidget(m_listViewEditor->getOrCreateWidget(this)); + QWidget* widget = m_listViewEditor->getOrCreateWidget(this); + m_layout->addWidget(widget); + + this->m_layout->setStretchFactor(widget, 10); } //-------------------------------------------------------------------------------------------------- diff --git a/cafUserInterface/cafPdmUiListView.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiListView.h similarity index 55% rename from cafUserInterface/cafPdmUiListView.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiListView.h index 2c81302a50..a075039d16 100644 --- a/cafUserInterface/cafPdmUiListView.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiListView.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include #include diff --git a/cafUserInterface/cafPdmUiListViewEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiListViewEditor.cpp similarity index 87% rename from cafUserInterface/cafPdmUiListViewEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiListViewEditor.cpp index e138d60ff5..a03375dee9 100644 --- a/cafUserInterface/cafPdmUiListViewEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiListViewEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiListViewEditor.h" #include "cafPdmObject.h" diff --git a/cafUserInterface/cafPdmUiListViewEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiListViewEditor.h similarity index 74% rename from cafUserInterface/cafPdmUiListViewEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiListViewEditor.h index 7eece163fc..c46119994a 100644 --- a/cafUserInterface/cafPdmUiListViewEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiListViewEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiFieldEditorHandle.h" diff --git a/cafUserInterface/cafPdmUiPropertyView.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyView.cpp similarity index 80% rename from cafUserInterface/cafPdmUiPropertyView.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyView.cpp index 6511ba9014..5dd66dafb2 100644 --- a/cafUserInterface/cafPdmUiPropertyView.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyView.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiPropertyView.h" #include "cafPdmObject.h" diff --git a/cafUserInterface/cafPdmUiPropertyView.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyView.h similarity index 58% rename from cafUserInterface/cafPdmUiPropertyView.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyView.h index 6c944232e1..36cad39a12 100644 --- a/cafUserInterface/cafPdmUiPropertyView.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyView.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include #include diff --git a/cafUserInterface/cafPdmUiPushButtonEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiPushButtonEditor.cpp similarity index 76% rename from cafUserInterface/cafPdmUiPushButtonEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiPushButtonEditor.cpp index 18aa383213..67fdfa6384 100644 --- a/cafUserInterface/cafPdmUiPushButtonEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiPushButtonEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiPushButtonEditor.h" #include "cafPdmUiDefaultObjectEditor.h" @@ -59,6 +77,8 @@ void PdmUiPushButtonEditor::configureAndUpdateUi(const QString& uiConfigName) //m_label->setEnabled(!field()->isUiReadOnly(uiConfigName)); m_pushButton->setEnabled(!field()->isUiReadOnly(uiConfigName)); + m_pushButton->setToolTip(field()->uiToolTip(uiConfigName)); + m_label->setToolTip(field()->uiToolTip(uiConfigName)); PdmUiPushButtonEditorAttribute attributes; field()->ownerObject()->editorAttribute(field(), uiConfigName, &attributes); diff --git a/cafUserInterface/cafPdmUiPushButtonEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiPushButtonEditor.h similarity index 62% rename from cafUserInterface/cafPdmUiPushButtonEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiPushButtonEditor.h index 596f0a5b6b..8e73a5b02a 100644 --- a/cafUserInterface/cafPdmUiPushButtonEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiPushButtonEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiFieldEditorHandle.h" diff --git a/cafUserInterface/cafPdmUiSliderEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiSliderEditor.cpp similarity index 80% rename from cafUserInterface/cafPdmUiSliderEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiSliderEditor.cpp index 5c657bd298..c395611f10 100644 --- a/cafUserInterface/cafPdmUiSliderEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiSliderEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiSliderEditor.h" #include "cafPdmUiDefaultObjectEditor.h" @@ -57,8 +75,13 @@ void PdmUiSliderEditor::configureAndUpdateUi(const QString& uiConfigName) } m_label->setEnabled(!field()->isUiReadOnly(uiConfigName)); + m_label->setToolTip(field()->uiToolTip(uiConfigName)); + m_spinBox->setEnabled(!field()->isUiReadOnly(uiConfigName)); + m_spinBox->setToolTip(field()->uiToolTip(uiConfigName)); + m_slider->setEnabled(!field()->isUiReadOnly(uiConfigName)); + m_slider->setToolTip(field()->uiToolTip(uiConfigName)); field()->ownerObject()->editorAttribute(field(), uiConfigName, &m_attributes); diff --git a/cafUserInterface/cafPdmUiSliderEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiSliderEditor.h similarity index 66% rename from cafUserInterface/cafPdmUiSliderEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiSliderEditor.h index df11b3a886..668db5191a 100644 --- a/cafUserInterface/cafPdmUiSliderEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiSliderEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiFieldEditorHandle.h" diff --git a/cafUserInterface/cafPdmUiTextEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiTextEditor.cpp similarity index 80% rename from cafUserInterface/cafPdmUiTextEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiTextEditor.cpp index 1d57335310..6771e82559 100644 --- a/cafUserInterface/cafPdmUiTextEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTextEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiTextEditor.h" #include "cafPdmUiDefaultObjectEditor.h" @@ -62,9 +80,11 @@ void PdmUiTextEditor::configureAndUpdateUi(const QString& uiConfigName) } //m_label->setEnabled(!field()->isUiReadOnly(uiConfigName)); + m_label->setToolTip(field()->uiToolTip(uiConfigName)); m_textEdit->setReadOnly(field()->isUiReadOnly(uiConfigName)); //m_textEdit->setEnabled(!field()->isUiReadOnly(uiConfigName)); // Neccesary ? + m_textEdit->setToolTip(field()->uiToolTip(uiConfigName)); PdmUiTextEditorAttribute leab; field()->ownerObject()->editorAttribute(field(), uiConfigName, &leab); diff --git a/cafUserInterface/cafPdmUiTextEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiTextEditor.h similarity index 67% rename from cafUserInterface/cafPdmUiTextEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiTextEditor.h index 7f26c6fc6a..0e669307ea 100644 --- a/cafUserInterface/cafPdmUiTextEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTextEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiFieldEditorHandle.h" #include diff --git a/cafUserInterface/cafPdmUiTreeView.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeView.cpp similarity index 73% rename from cafUserInterface/cafPdmUiTreeView.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiTreeView.cpp index 4ee31e4586..47a3287770 100644 --- a/cafUserInterface/cafPdmUiTreeView.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeView.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiTreeView.h" #include "cafPdmObject.h" diff --git a/cafUserInterface/cafPdmUiTreeView.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeView.h similarity index 58% rename from cafUserInterface/cafPdmUiTreeView.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiTreeView.h index b0c5d7d420..481f8452fe 100644 --- a/cafUserInterface/cafPdmUiTreeView.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeView.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include #include diff --git a/cafUserInterface/cafPdmUiTreeViewEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewEditor.cpp similarity index 70% rename from cafUserInterface/cafPdmUiTreeViewEditor.cpp rename to Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewEditor.cpp index 99713963c8..f2653ed19f 100644 --- a/cafUserInterface/cafPdmUiTreeViewEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewEditor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafPdmUiTreeViewEditor.h" #include "cafPdmObject.h" @@ -27,6 +45,29 @@ #include #include #include +#include + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +class MySortFilterProxyModel : public QSortFilterProxyModel +{ +public: + MySortFilterProxyModel(QObject *parent = 0) + : QSortFilterProxyModel(parent) + { + + } + + void notifyModelChanged() + { + QModelIndex startModelIdx = index(0,0); + QModelIndex endModelIdx = index(rowCount(startModelIdx), 0); + + emit dataChanged(startModelIdx, endModelIdx); + } +}; @@ -66,8 +107,14 @@ QWidget* PdmUiTreeViewEditor::createWidget(QWidget* parent) m_treeModelPdm = new caf::UiTreeModelPdm(m_mainWidget); m_treeView = new QTreeView(m_mainWidget); - m_treeView->setHeaderHidden(true); - m_treeView->setModel(m_treeModelPdm); + + m_proxyTreeModelPdm = new MySortFilterProxyModel(m_mainWidget); + m_proxyTreeModelPdm->setSourceModel(m_treeModelPdm); + m_treeView->setModel(m_proxyTreeModelPdm); + + m_treeView->setSortingEnabled(true); + m_treeView->sortByColumn(1, Qt::AscendingOrder); + m_layout->addWidget(m_treeView); @@ -107,12 +154,11 @@ void PdmUiTreeViewEditor::configureAndUpdateUi(const QString& uiConfigName) } } - - PdmUiTreeViewEditorAttribute leab; - + m_treeModelPdm->setColumnHeaders(m_editorAttributes.columnHeaders); // Notify all connected views that the complete model is updated m_treeModelPdm->notifyModelChanged(); + m_proxyTreeModelPdm->notifyModelChanged(); } //-------------------------------------------------------------------------------------------------- diff --git a/cafUserInterface/cafPdmUiTreeViewEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewEditor.h similarity index 62% rename from cafUserInterface/cafPdmUiTreeViewEditor.h rename to Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewEditor.h index 9a5c2d4ece..04ae2f44f9 100644 --- a/cafUserInterface/cafPdmUiTreeViewEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeViewEditor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafPdmUiObjectEditorHandle.h" @@ -25,6 +43,8 @@ #include #include +class MySortFilterProxyModel; + class QGridLayout; class QVBoxLayout; class QTreeView; @@ -48,6 +68,7 @@ class PdmUiTreeViewEditorAttribute : public PdmUiEditorAttribute } public: + QStringList columnHeaders; }; @@ -72,8 +93,9 @@ class PdmUiTreeViewEditor : public PdmUiObjectEditorHandle QPointer m_mainWidget; QVBoxLayout* m_layout; - QTreeView* m_treeView; - UiTreeModelPdm* m_treeModelPdm; + QTreeView* m_treeView; + UiTreeModelPdm* m_treeModelPdm; + MySortFilterProxyModel* m_proxyTreeModelPdm; // Forward update events to the tree view editor connected to Pdm root object using a proxy editor PdmUiProxyEditorHandle* m_proxyEditor; diff --git a/cafUserInterface/cafProgressInfo.cpp b/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp similarity index 93% rename from cafUserInterface/cafProgressInfo.cpp rename to Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp index 54ff45b7c3..03847fdc3b 100644 --- a/cafUserInterface/cafProgressInfo.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafProgressInfo.h" #include #include diff --git a/cafUserInterface/cafProgressInfo.h b/Fwk/AppFwk/cafUserInterface/cafProgressInfo.h similarity index 56% rename from cafUserInterface/cafProgressInfo.h rename to Fwk/AppFwk/cafUserInterface/cafProgressInfo.h index 9820df12cf..a889a1dda2 100644 --- a/cafUserInterface/cafProgressInfo.h +++ b/Fwk/AppFwk/cafUserInterface/cafProgressInfo.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/cafUserInterface/cafUiProcess.cpp b/Fwk/AppFwk/cafUserInterface/cafUiProcess.cpp similarity index 84% rename from cafUserInterface/cafUiProcess.cpp rename to Fwk/AppFwk/cafUserInterface/cafUiProcess.cpp index 97e9e758bd..bb3c5d0312 100644 --- a/cafUserInterface/cafUiProcess.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafUiProcess.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafUiProcess.h" #include diff --git a/cafUserInterface/cafUiProcess.h b/Fwk/AppFwk/cafUserInterface/cafUiProcess.h similarity index 64% rename from cafUserInterface/cafUiProcess.h rename to Fwk/AppFwk/cafUserInterface/cafUiProcess.h index 60ba6f93f7..46351f1ce5 100644 --- a/cafUserInterface/cafUiProcess.h +++ b/Fwk/AppFwk/cafUserInterface/cafUiProcess.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/cafUserInterface/cafUiTreeModelPdm.cpp b/Fwk/AppFwk/cafUserInterface/cafUiTreeModelPdm.cpp similarity index 91% rename from cafUserInterface/cafUiTreeModelPdm.cpp rename to Fwk/AppFwk/cafUserInterface/cafUiTreeModelPdm.cpp index e00efee9e2..5c5718e878 100644 --- a/cafUserInterface/cafUiTreeModelPdm.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafUiTreeModelPdm.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafUiTreeModelPdm.h" #include "cafPdmField.h" #include "cafPdmObject.h" @@ -480,6 +498,33 @@ void UiTreeModelPdm::notifyModelChanged() emit dataChanged(startModelIdx, endModelIdx); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QVariant UiTreeModelPdm::headerData(int section, Qt::Orientation orientation, int role /*= Qt::DisplayRole */) const +{ + if (role != Qt::DisplayRole) + return QVariant(); + + if (section < m_columnHeaders.size()) + { + return m_columnHeaders[section]; + } + + return QVariant(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void UiTreeModelPdm::setColumnHeaders(const QStringList& columnHeaders) +{ + m_columnHeaders = columnHeaders; +} + + + + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/cafUserInterface/cafUiTreeModelPdm.h b/Fwk/AppFwk/cafUserInterface/cafUiTreeModelPdm.h similarity index 70% rename from cafUserInterface/cafUiTreeModelPdm.h rename to Fwk/AppFwk/cafUserInterface/cafUiTreeModelPdm.h index f26811ad64..2bba5d4210 100644 --- a/cafUserInterface/cafUiTreeModelPdm.h +++ b/Fwk/AppFwk/cafUserInterface/cafUiTreeModelPdm.h @@ -1,27 +1,47 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafUiTreeItem.h" #include +#include + #include #include "cafPdmPointer.h" @@ -53,6 +73,7 @@ class UiTreeModelPdm : public QAbstractItemModel void updateUiSubTree(PdmObject* root); void notifyModelChanged(); + void setColumnHeaders(const QStringList& columnHeaders); public: // Overrides from QAbstractItemModel @@ -61,10 +82,12 @@ class UiTreeModelPdm : public QAbstractItemModel virtual int rowCount(const QModelIndex &parentIndex = QModelIndex( ) ) const; virtual int columnCount(const QModelIndex &parentIndex = QModelIndex( ) ) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole ) const; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; virtual Qt::ItemFlags flags(const QModelIndex &index) const; virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + virtual bool removeRows_special(int position, int rows, const QModelIndex &parent = QModelIndex()); protected: @@ -73,6 +96,7 @@ class UiTreeModelPdm : public QAbstractItemModel void updateModelSubTree(const QModelIndex& uiSubTreeRootModelIdx, PdmUiTreeItem* uiModelSubTreeRoot, PdmUiTreeItem* updatedPdmSubTreeRoot); PdmUiTreeItem* m_treeItemRoot; + QStringList m_columnHeaders; }; diff --git a/cafViewer/CMakeLists.txt b/Fwk/AppFwk/cafViewer/CMakeLists.txt similarity index 100% rename from cafViewer/CMakeLists.txt rename to Fwk/AppFwk/cafViewer/CMakeLists.txt diff --git a/cafViewer/cafCadNavigation.cpp b/Fwk/AppFwk/cafViewer/cafCadNavigation.cpp similarity index 88% rename from cafViewer/cafCadNavigation.cpp rename to Fwk/AppFwk/cafViewer/cafCadNavigation.cpp index 28b4023d91..f31032b0ec 100644 --- a/cafViewer/cafCadNavigation.cpp +++ b/Fwk/AppFwk/cafViewer/cafCadNavigation.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafCadNavigation.h" #include "cafViewer.h" #include "cvfCamera.h" diff --git a/cafViewer/cafCadNavigation.h b/Fwk/AppFwk/cafViewer/cafCadNavigation.h similarity index 57% rename from cafViewer/cafCadNavigation.h rename to Fwk/AppFwk/cafViewer/cafCadNavigation.h index 9ace3fddc0..9cbae679be 100644 --- a/cafViewer/cafCadNavigation.h +++ b/Fwk/AppFwk/cafViewer/cafCadNavigation.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafNavigationPolicy.h" diff --git a/cafViewer/cafCeetronNavigation.cpp b/Fwk/AppFwk/cafViewer/cafCeetronNavigation.cpp similarity index 89% rename from cafViewer/cafCeetronNavigation.cpp rename to Fwk/AppFwk/cafViewer/cafCeetronNavigation.cpp index e4a444ed20..8202ac2432 100644 --- a/cafViewer/cafCeetronNavigation.cpp +++ b/Fwk/AppFwk/cafViewer/cafCeetronNavigation.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafCeetronNavigation.h" #include "cafViewer.h" #include "cvfCamera.h" diff --git a/cafViewer/cafCeetronNavigation.h b/Fwk/AppFwk/cafViewer/cafCeetronNavigation.h similarity index 63% rename from cafViewer/cafCeetronNavigation.h rename to Fwk/AppFwk/cafViewer/cafCeetronNavigation.h index c6374db724..e9f7d78f73 100644 --- a/cafViewer/cafCeetronNavigation.h +++ b/Fwk/AppFwk/cafViewer/cafCeetronNavigation.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cafNavigationPolicy.h" diff --git a/cafViewer/cafNavigationPolicy.cpp b/Fwk/AppFwk/cafViewer/cafNavigationPolicy.cpp similarity index 52% rename from cafViewer/cafNavigationPolicy.cpp rename to Fwk/AppFwk/cafViewer/cafNavigationPolicy.cpp index a597256ac8..52a1b3e37c 100644 --- a/cafViewer/cafNavigationPolicy.cpp +++ b/Fwk/AppFwk/cafViewer/cafNavigationPolicy.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafNavigationPolicy.h" #include "cafViewer.h" #include "cvfScene.h" diff --git a/cafViewer/cafNavigationPolicy.h b/Fwk/AppFwk/cafViewer/cafNavigationPolicy.h similarity index 59% rename from cafViewer/cafNavigationPolicy.h rename to Fwk/AppFwk/cafViewer/cafNavigationPolicy.h index ab8e1fabdd..66a9528e44 100644 --- a/cafViewer/cafNavigationPolicy.h +++ b/Fwk/AppFwk/cafViewer/cafNavigationPolicy.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfAssert.h" diff --git a/cafViewer/cafOpenGLWidget.cpp b/Fwk/AppFwk/cafViewer/cafOpenGLWidget.cpp similarity index 84% rename from cafViewer/cafOpenGLWidget.cpp rename to Fwk/AppFwk/cafViewer/cafOpenGLWidget.cpp index f479ddf88c..1813c08e3e 100644 --- a/cafViewer/cafOpenGLWidget.cpp +++ b/Fwk/AppFwk/cafViewer/cafOpenGLWidget.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOpenGLContextGroup.h" #include "cvfqtCvfBoundQGLContext.h" diff --git a/cafViewer/cafOpenGLWidget.h b/Fwk/AppFwk/cafViewer/cafOpenGLWidget.h similarity index 57% rename from cafViewer/cafOpenGLWidget.h rename to Fwk/AppFwk/cafViewer/cafOpenGLWidget.h index c1528dc518..b0cf0a5cd2 100644 --- a/cafViewer/cafOpenGLWidget.h +++ b/Fwk/AppFwk/cafViewer/cafOpenGLWidget.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/cafViewer/cafViewer.cpp b/Fwk/AppFwk/cafViewer/cafViewer.cpp similarity index 95% rename from cafViewer/cafViewer.cpp rename to Fwk/AppFwk/cafViewer/cafViewer.cpp index b1b7356911..32674d327c 100644 --- a/cafViewer/cafViewer.cpp +++ b/Fwk/AppFwk/cafViewer/cafViewer.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cafViewer.h" #include "cvfCamera.h" @@ -436,28 +454,13 @@ void caf::Viewer::paintEvent(QPaintEvent* event) // Convert the QImage into the cvf::TextureImage, // handling vertical mirroring and (possible) byteswapping - if (((int)m_overlayTextureImage->height()) != this->height() || ((int)m_overlayTextureImage->width() != this->width())) + if (((int)m_overlayTextureImage->height()) != this->height() || ((int)m_overlayTextureImage->width() != this->width())) { m_overlayTextureImage->allocate(this->width(), this->height()); } - int height = m_overlayTextureImage->height(); - int width = m_overlayTextureImage->width(); - -#pragma omp parallel for - for (int y = 0 ; y < height; ++y) - { - int negy = height - 1 - y; - for (int x = 0 ; x < width; ++x) - { - // Should probably do direct conversion on byte level. Would be faster - // QImage.bits() and cvf::TextureImage.ptr() (casting away const) - QRgb qtRgbaVal = m_overlayPaintingQImage.pixel(x, negy); - cvf::Color4ub cvfRgbVal(qRed(qtRgbaVal), qGreen(qtRgbaVal), qBlue(qtRgbaVal), qAlpha(qtRgbaVal)); - m_overlayTextureImage->setPixel(x, y, cvfRgbVal); - } - } - + cvfqt::Utils::copyFromQImage(m_overlayTextureImage.p(), m_overlayPaintingQImage); + m_overlayImage->setImage(m_overlayTextureImage.p()); m_overlayImage->setPixelSize(cvf::Vec2ui(this->width(), this->height())); } diff --git a/cafViewer/cafViewer.h b/Fwk/AppFwk/cafViewer/cafViewer.h similarity index 86% rename from cafViewer/cafViewer.h rename to Fwk/AppFwk/cafViewer/cafViewer.h index e9ad4bf13e..8cc92a41b5 100644 --- a/cafViewer/cafViewer.h +++ b/Fwk/AppFwk/cafViewer/cafViewer.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfAssert.h" diff --git a/VisualizationModules/LibCore/CMakeLists.txt b/Fwk/VizFwk/LibCore/CMakeLists.txt similarity index 100% rename from VisualizationModules/LibCore/CMakeLists.txt rename to Fwk/VizFwk/LibCore/CMakeLists.txt diff --git a/VisualizationModules/LibCore/cvfArray.h b/Fwk/VizFwk/LibCore/cvfArray.h similarity index 81% rename from VisualizationModules/LibCore/cvfArray.h rename to Fwk/VizFwk/LibCore/cvfArray.h index f4657bf952..d52d104c20 100644 --- a/VisualizationModules/LibCore/cvfArray.h +++ b/Fwk/VizFwk/LibCore/cvfArray.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibCore/cvfArray.inl b/Fwk/VizFwk/LibCore/cvfArray.inl similarity index 95% rename from VisualizationModules/LibCore/cvfArray.inl rename to Fwk/VizFwk/LibCore/cvfArray.inl index b480ddc06a..6f76a71919 100644 --- a/VisualizationModules/LibCore/cvfArray.inl +++ b/Fwk/VizFwk/LibCore/cvfArray.inl @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + namespace cvf { @@ -752,7 +770,7 @@ T Array::max(size_t* index) const /// /// \param other Modifiable reference to the array that should have its contents swapped. /// -/// \warning Note that signature differs from normal CeeVizFramework practice. This is done to be +/// \warning Note that signature differs from normal practice. This is done to be /// consistent with the signature of std::swap() //-------------------------------------------------------------------------------------------------- template diff --git a/VisualizationModules/LibCore/cvfAssert.cpp b/Fwk/VizFwk/LibCore/cvfAssert.cpp similarity index 93% rename from VisualizationModules/LibCore/cvfAssert.cpp rename to Fwk/VizFwk/LibCore/cvfAssert.cpp index 272c2ab8ef..d5f300925a 100644 --- a/VisualizationModules/LibCore/cvfAssert.cpp +++ b/Fwk/VizFwk/LibCore/cvfAssert.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfAssert.h" #include "cvfSystem.h" diff --git a/VisualizationModules/LibCore/cvfAssert.h b/Fwk/VizFwk/LibCore/cvfAssert.h similarity index 73% rename from VisualizationModules/LibCore/cvfAssert.h rename to Fwk/VizFwk/LibCore/cvfAssert.h index aa89c8edd7..dde61490c5 100644 --- a/VisualizationModules/LibCore/cvfAssert.h +++ b/Fwk/VizFwk/LibCore/cvfAssert.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace cvf { diff --git a/VisualizationModules/LibCore/cvfBase.h b/Fwk/VizFwk/LibCore/cvfBase.h similarity index 76% rename from VisualizationModules/LibCore/cvfBase.h rename to Fwk/VizFwk/LibCore/cvfBase.h index 674faaa968..30970d05fb 100644 --- a/VisualizationModules/LibCore/cvfBase.h +++ b/Fwk/VizFwk/LibCore/cvfBase.h @@ -1,29 +1,47 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #if !defined(WIN32) && !defined(CVF_LINUX) && !defined(CVF_IOS) && !defined(CVF_OSX) && !defined(CVF_ANDROID) #error No platform defined #endif -// Global include file with definitions useful for all CeeVizFramework files +// Global include file with definitions useful for all library files // Disable some annoying warnings so we can compile with warning level Wall #ifdef WIN32 diff --git a/VisualizationModules/LibCore/cvfBase64.cpp b/Fwk/VizFwk/LibCore/cvfBase64.cpp similarity index 81% rename from VisualizationModules/LibCore/cvfBase64.cpp rename to Fwk/VizFwk/LibCore/cvfBase64.cpp index ba03300ca9..b12aceb715 100644 --- a/VisualizationModules/LibCore/cvfBase64.cpp +++ b/Fwk/VizFwk/LibCore/cvfBase64.cpp @@ -1,12 +1,40 @@ //################################################################################################## // -// CeeVizFramework -// Lib: LibCore -// -// -------------------------------------------------------------------------------------------- -// Please see references below for copyright, usage rights and license for this file. +// Custom Visualization Core library +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. +// //################################################################################################## + #include "cvfBase.h" #include "cvfBase64.h" diff --git a/VisualizationModules/LibCore/cvfBase64.h b/Fwk/VizFwk/LibCore/cvfBase64.h similarity index 52% rename from VisualizationModules/LibCore/cvfBase64.h rename to Fwk/VizFwk/LibCore/cvfBase64.h index 68473230ed..cbe956e29c 100644 --- a/VisualizationModules/LibCore/cvfBase64.h +++ b/Fwk/VizFwk/LibCore/cvfBase64.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfString.h" diff --git a/VisualizationModules/LibCore/cvfCharArray.cpp b/Fwk/VizFwk/LibCore/cvfCharArray.cpp similarity index 82% rename from VisualizationModules/LibCore/cvfCharArray.cpp rename to Fwk/VizFwk/LibCore/cvfCharArray.cpp index 92fb3e5b5c..0754cc987b 100644 --- a/VisualizationModules/LibCore/cvfCharArray.cpp +++ b/Fwk/VizFwk/LibCore/cvfCharArray.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfCharArray.h" #include "cvfSystem.h" diff --git a/VisualizationModules/LibCore/cvfCharArray.h b/Fwk/VizFwk/LibCore/cvfCharArray.h similarity index 55% rename from VisualizationModules/LibCore/cvfCharArray.h rename to Fwk/VizFwk/LibCore/cvfCharArray.h index a4448313be..b2707fa4eb 100644 --- a/VisualizationModules/LibCore/cvfCharArray.h +++ b/Fwk/VizFwk/LibCore/cvfCharArray.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/VisualizationModules/LibCore/cvfCodeLocation.cpp b/Fwk/VizFwk/LibCore/cvfCodeLocation.cpp similarity index 82% rename from VisualizationModules/LibCore/cvfCodeLocation.cpp rename to Fwk/VizFwk/LibCore/cvfCodeLocation.cpp index 4716136be2..3d6e8e533d 100644 --- a/VisualizationModules/LibCore/cvfCodeLocation.cpp +++ b/Fwk/VizFwk/LibCore/cvfCodeLocation.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfCodeLocation.h" diff --git a/VisualizationModules/LibCore/cvfCodeLocation.h b/Fwk/VizFwk/LibCore/cvfCodeLocation.h similarity index 62% rename from VisualizationModules/LibCore/cvfCodeLocation.h rename to Fwk/VizFwk/LibCore/cvfCodeLocation.h index c8f5722a72..1e35b511fc 100644 --- a/VisualizationModules/LibCore/cvfCodeLocation.h +++ b/Fwk/VizFwk/LibCore/cvfCodeLocation.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace cvf { diff --git a/VisualizationModules/LibCore/cvfCollection.h b/Fwk/VizFwk/LibCore/cvfCollection.h similarity index 69% rename from VisualizationModules/LibCore/cvfCollection.h rename to Fwk/VizFwk/LibCore/cvfCollection.h index 26075711d9..bca56507b9 100644 --- a/VisualizationModules/LibCore/cvfCollection.h +++ b/Fwk/VizFwk/LibCore/cvfCollection.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibCore/cvfCollection.inl b/Fwk/VizFwk/LibCore/cvfCollection.inl similarity index 90% rename from VisualizationModules/LibCore/cvfCollection.inl rename to Fwk/VizFwk/LibCore/cvfCollection.inl index 862b99b6fd..063e10c11e 100644 --- a/VisualizationModules/LibCore/cvfCollection.inl +++ b/Fwk/VizFwk/LibCore/cvfCollection.inl @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + namespace cvf { diff --git a/VisualizationModules/LibCore/cvfColor3.cpp b/Fwk/VizFwk/LibCore/cvfColor3.cpp similarity index 94% rename from VisualizationModules/LibCore/cvfColor3.cpp rename to Fwk/VizFwk/LibCore/cvfColor3.cpp index d1e606cf2a..cab22e0023 100644 --- a/VisualizationModules/LibCore/cvfColor3.cpp +++ b/Fwk/VizFwk/LibCore/cvfColor3.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfColor3.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibCore/cvfColor3.h b/Fwk/VizFwk/LibCore/cvfColor3.h similarity index 82% rename from VisualizationModules/LibCore/cvfColor3.h rename to Fwk/VizFwk/LibCore/cvfColor3.h index 0b6e894e2f..524ba5227e 100644 --- a/VisualizationModules/LibCore/cvfColor3.h +++ b/Fwk/VizFwk/LibCore/cvfColor3.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace cvf { diff --git a/VisualizationModules/LibCore/cvfColor4.cpp b/Fwk/VizFwk/LibCore/cvfColor4.cpp similarity index 94% rename from VisualizationModules/LibCore/cvfColor4.cpp rename to Fwk/VizFwk/LibCore/cvfColor4.cpp index 54cbad72af..9a3bb013e4 100644 --- a/VisualizationModules/LibCore/cvfColor4.cpp +++ b/Fwk/VizFwk/LibCore/cvfColor4.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfColor4.h" #include "cvfColor3.h" diff --git a/VisualizationModules/LibCore/cvfColor4.h b/Fwk/VizFwk/LibCore/cvfColor4.h similarity index 74% rename from VisualizationModules/LibCore/cvfColor4.h rename to Fwk/VizFwk/LibCore/cvfColor4.h index 3d1f4b2fd2..db4764527e 100644 --- a/VisualizationModules/LibCore/cvfColor4.h +++ b/Fwk/VizFwk/LibCore/cvfColor4.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfColor3.h" diff --git a/VisualizationModules/LibCore/cvfConfigCore.h b/Fwk/VizFwk/LibCore/cvfConfigCore.h similarity index 61% rename from VisualizationModules/LibCore/cvfConfigCore.h rename to Fwk/VizFwk/LibCore/cvfConfigCore.h index e84ff0a1c3..b0fc3be3e6 100644 --- a/VisualizationModules/LibCore/cvfConfigCore.h +++ b/Fwk/VizFwk/LibCore/cvfConfigCore.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once diff --git a/VisualizationModules/LibCore/cvfDebugTimer.cpp b/Fwk/VizFwk/LibCore/cvfDebugTimer.cpp similarity index 85% rename from VisualizationModules/LibCore/cvfDebugTimer.cpp rename to Fwk/VizFwk/LibCore/cvfDebugTimer.cpp index a1301ea940..c08e3194c3 100644 --- a/VisualizationModules/LibCore/cvfDebugTimer.cpp +++ b/Fwk/VizFwk/LibCore/cvfDebugTimer.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfDebugTimer.h" #include "cvfTimer.h" diff --git a/VisualizationModules/LibCore/cvfDebugTimer.h b/Fwk/VizFwk/LibCore/cvfDebugTimer.h similarity index 63% rename from VisualizationModules/LibCore/cvfDebugTimer.h rename to Fwk/VizFwk/LibCore/cvfDebugTimer.h index 9297a3df2b..13a83af1a6 100644 --- a/VisualizationModules/LibCore/cvfDebugTimer.h +++ b/Fwk/VizFwk/LibCore/cvfDebugTimer.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfString.h" diff --git a/VisualizationModules/LibCore/cvfFlags.h b/Fwk/VizFwk/LibCore/cvfFlags.h similarity index 60% rename from VisualizationModules/LibCore/cvfFlags.h rename to Fwk/VizFwk/LibCore/cvfFlags.h index 31d15c4bc8..65af77efc7 100644 --- a/VisualizationModules/LibCore/cvfFlags.h +++ b/Fwk/VizFwk/LibCore/cvfFlags.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace cvf { diff --git a/VisualizationModules/LibCore/cvfFlags.inl b/Fwk/VizFwk/LibCore/cvfFlags.inl similarity index 85% rename from VisualizationModules/LibCore/cvfFlags.inl rename to Fwk/VizFwk/LibCore/cvfFlags.inl index 74d0969bc6..4f2b93606d 100644 --- a/VisualizationModules/LibCore/cvfFlags.inl +++ b/Fwk/VizFwk/LibCore/cvfFlags.inl @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + namespace cvf { diff --git a/VisualizationModules/LibCore/cvfFunctorRange.h b/Fwk/VizFwk/LibCore/cvfFunctorRange.h similarity index 61% rename from VisualizationModules/LibCore/cvfFunctorRange.h rename to Fwk/VizFwk/LibCore/cvfFunctorRange.h index d8946f3e01..b04861a711 100644 --- a/VisualizationModules/LibCore/cvfFunctorRange.h +++ b/Fwk/VizFwk/LibCore/cvfFunctorRange.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace cvf { diff --git a/VisualizationModules/LibCore/cvfLibCore.h b/Fwk/VizFwk/LibCore/cvfLibCore.h similarity index 55% rename from VisualizationModules/LibCore/cvfLibCore.h rename to Fwk/VizFwk/LibCore/cvfLibCore.h index 02ddf45b05..88238dfa22 100644 --- a/VisualizationModules/LibCore/cvfLibCore.h +++ b/Fwk/VizFwk/LibCore/cvfLibCore.h @@ -1,29 +1,47 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + // Doxygen module definition -/// \ingroup CeeVizFramework +/// \ingroup VizFramework /// @{ /// \defgroup Core Core module /// @} -/// \defgroup CeeVizFramework CeeViz Framework Basis +/// \defgroup VizFramework Framework Basis // Intentionally on top to be included first #include "cvfBase.h" diff --git a/VisualizationModules/LibCore/cvfLogDestination.h b/Fwk/VizFwk/LibCore/cvfLogDestination.h similarity index 50% rename from VisualizationModules/LibCore/cvfLogDestination.h rename to Fwk/VizFwk/LibCore/cvfLogDestination.h index 9fa8e12ae0..b3b9c7294f 100644 --- a/VisualizationModules/LibCore/cvfLogDestination.h +++ b/Fwk/VizFwk/LibCore/cvfLogDestination.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibCore/cvfLogDestinationConsole.cpp b/Fwk/VizFwk/LibCore/cvfLogDestinationConsole.cpp similarity index 78% rename from VisualizationModules/LibCore/cvfLogDestinationConsole.cpp rename to Fwk/VizFwk/LibCore/cvfLogDestinationConsole.cpp index 3ec37d5d57..2c1e302594 100644 --- a/VisualizationModules/LibCore/cvfLogDestinationConsole.cpp +++ b/Fwk/VizFwk/LibCore/cvfLogDestinationConsole.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfLogDestinationConsole.h" #include "cvfLogEvent.h" diff --git a/VisualizationModules/LibCore/cvfLogDestinationConsole.h b/Fwk/VizFwk/LibCore/cvfLogDestinationConsole.h similarity index 54% rename from VisualizationModules/LibCore/cvfLogDestinationConsole.h rename to Fwk/VizFwk/LibCore/cvfLogDestinationConsole.h index 87f3bdd00a..640f9d6c6b 100644 --- a/VisualizationModules/LibCore/cvfLogDestinationConsole.h +++ b/Fwk/VizFwk/LibCore/cvfLogDestinationConsole.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfLogDestination.h" diff --git a/VisualizationModules/LibCore/cvfLogDestinationFile.cpp b/Fwk/VizFwk/LibCore/cvfLogDestinationFile.cpp similarity index 81% rename from VisualizationModules/LibCore/cvfLogDestinationFile.cpp rename to Fwk/VizFwk/LibCore/cvfLogDestinationFile.cpp index c6b6617e05..bcf2d51f11 100644 --- a/VisualizationModules/LibCore/cvfLogDestinationFile.cpp +++ b/Fwk/VizFwk/LibCore/cvfLogDestinationFile.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfLogDestinationFile.h" #include "cvfLogEvent.h" diff --git a/VisualizationModules/LibCore/cvfLogDestinationFile.h b/Fwk/VizFwk/LibCore/cvfLogDestinationFile.h similarity index 56% rename from VisualizationModules/LibCore/cvfLogDestinationFile.h rename to Fwk/VizFwk/LibCore/cvfLogDestinationFile.h index a01ddc344b..a2d56fd800 100644 --- a/VisualizationModules/LibCore/cvfLogDestinationFile.h +++ b/Fwk/VizFwk/LibCore/cvfLogDestinationFile.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfLogDestination.h" diff --git a/VisualizationModules/LibCore/cvfLogEvent.cpp b/Fwk/VizFwk/LibCore/cvfLogEvent.cpp similarity index 78% rename from VisualizationModules/LibCore/cvfLogEvent.cpp rename to Fwk/VizFwk/LibCore/cvfLogEvent.cpp index 7d08ffe386..66454c6468 100644 --- a/VisualizationModules/LibCore/cvfLogEvent.cpp +++ b/Fwk/VizFwk/LibCore/cvfLogEvent.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfLogEvent.h" diff --git a/VisualizationModules/LibCore/cvfLogEvent.h b/Fwk/VizFwk/LibCore/cvfLogEvent.h similarity index 62% rename from VisualizationModules/LibCore/cvfLogEvent.h rename to Fwk/VizFwk/LibCore/cvfLogEvent.h index 4cb02f5313..10c23270fa 100644 --- a/VisualizationModules/LibCore/cvfLogEvent.h +++ b/Fwk/VizFwk/LibCore/cvfLogEvent.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibCore/cvfLogManager.cpp b/Fwk/VizFwk/LibCore/cvfLogManager.cpp similarity index 88% rename from VisualizationModules/LibCore/cvfLogManager.cpp rename to Fwk/VizFwk/LibCore/cvfLogManager.cpp index 1e48c0abf9..eb5800a506 100644 --- a/VisualizationModules/LibCore/cvfLogManager.cpp +++ b/Fwk/VizFwk/LibCore/cvfLogManager.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfLogManager.h" #include "cvfLogDestinationConsole.h" diff --git a/VisualizationModules/LibCore/cvfLogManager.h b/Fwk/VizFwk/LibCore/cvfLogManager.h similarity index 67% rename from VisualizationModules/LibCore/cvfLogManager.h rename to Fwk/VizFwk/LibCore/cvfLogManager.h index 50720e7bff..381de9b5b2 100644 --- a/VisualizationModules/LibCore/cvfLogManager.h +++ b/Fwk/VizFwk/LibCore/cvfLogManager.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibCore/cvfLogger.cpp b/Fwk/VizFwk/LibCore/cvfLogger.cpp similarity index 85% rename from VisualizationModules/LibCore/cvfLogger.cpp rename to Fwk/VizFwk/LibCore/cvfLogger.cpp index 5a97eea156..5862e7e7b0 100644 --- a/VisualizationModules/LibCore/cvfLogger.cpp +++ b/Fwk/VizFwk/LibCore/cvfLogger.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfLogger.h" #include "cvfLogEvent.h" diff --git a/VisualizationModules/LibCore/cvfLogger.h b/Fwk/VizFwk/LibCore/cvfLogger.h similarity index 75% rename from VisualizationModules/LibCore/cvfLogger.h rename to Fwk/VizFwk/LibCore/cvfLogger.h index d48e4363a6..c92bee3d1c 100644 --- a/VisualizationModules/LibCore/cvfLogger.h +++ b/Fwk/VizFwk/LibCore/cvfLogger.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibCore/cvfMath.cpp b/Fwk/VizFwk/LibCore/cvfMath.cpp similarity index 90% rename from VisualizationModules/LibCore/cvfMath.cpp rename to Fwk/VizFwk/LibCore/cvfMath.cpp index e475990763..f60827db25 100644 --- a/VisualizationModules/LibCore/cvfMath.cpp +++ b/Fwk/VizFwk/LibCore/cvfMath.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibCore/cvfMath.h b/Fwk/VizFwk/LibCore/cvfMath.h similarity index 77% rename from VisualizationModules/LibCore/cvfMath.h rename to Fwk/VizFwk/LibCore/cvfMath.h index d97becdc2d..0b0b7ab2b6 100644 --- a/VisualizationModules/LibCore/cvfMath.h +++ b/Fwk/VizFwk/LibCore/cvfMath.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace cvf { diff --git a/VisualizationModules/LibCore/cvfMath.inl b/Fwk/VizFwk/LibCore/cvfMath.inl similarity index 69% rename from VisualizationModules/LibCore/cvfMath.inl rename to Fwk/VizFwk/LibCore/cvfMath.inl index 3a9bd26ff4..fe104c0087 100644 --- a/VisualizationModules/LibCore/cvfMath.inl +++ b/Fwk/VizFwk/LibCore/cvfMath.inl @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + namespace cvf { diff --git a/VisualizationModules/LibCore/cvfMatrix3.h b/Fwk/VizFwk/LibCore/cvfMatrix3.h similarity index 73% rename from VisualizationModules/LibCore/cvfMatrix3.h rename to Fwk/VizFwk/LibCore/cvfMatrix3.h index 8b1a3ae348..06162d8d1d 100644 --- a/VisualizationModules/LibCore/cvfMatrix3.h +++ b/Fwk/VizFwk/LibCore/cvfMatrix3.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfSystem.h" diff --git a/VisualizationModules/LibCore/cvfMatrix3.inl b/Fwk/VizFwk/LibCore/cvfMatrix3.inl similarity index 93% rename from VisualizationModules/LibCore/cvfMatrix3.inl rename to Fwk/VizFwk/LibCore/cvfMatrix3.inl index 266487bb60..e5698586ac 100644 --- a/VisualizationModules/LibCore/cvfMatrix3.inl +++ b/Fwk/VizFwk/LibCore/cvfMatrix3.inl @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + namespace cvf { diff --git a/VisualizationModules/LibCore/cvfMatrix4.h b/Fwk/VizFwk/LibCore/cvfMatrix4.h similarity index 80% rename from VisualizationModules/LibCore/cvfMatrix4.h rename to Fwk/VizFwk/LibCore/cvfMatrix4.h index c9a9b5b6da..141d524225 100644 --- a/VisualizationModules/LibCore/cvfMatrix4.h +++ b/Fwk/VizFwk/LibCore/cvfMatrix4.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfSystem.h" diff --git a/VisualizationModules/LibCore/cvfMatrix4.inl b/Fwk/VizFwk/LibCore/cvfMatrix4.inl similarity index 96% rename from VisualizationModules/LibCore/cvfMatrix4.inl rename to Fwk/VizFwk/LibCore/cvfMatrix4.inl index d0c39d62c8..6a2a0a9545 100644 --- a/VisualizationModules/LibCore/cvfMatrix4.inl +++ b/Fwk/VizFwk/LibCore/cvfMatrix4.inl @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + namespace cvf { diff --git a/VisualizationModules/LibCore/cvfMutex.cpp b/Fwk/VizFwk/LibCore/cvfMutex.cpp similarity index 83% rename from VisualizationModules/LibCore/cvfMutex.cpp rename to Fwk/VizFwk/LibCore/cvfMutex.cpp index d72a683d1a..139c203051 100644 --- a/VisualizationModules/LibCore/cvfMutex.cpp +++ b/Fwk/VizFwk/LibCore/cvfMutex.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfMutex.h" diff --git a/VisualizationModules/LibCore/cvfMutex.h b/Fwk/VizFwk/LibCore/cvfMutex.h similarity index 54% rename from VisualizationModules/LibCore/cvfMutex.h rename to Fwk/VizFwk/LibCore/cvfMutex.h index 5571a9717c..4f62e668cd 100644 --- a/VisualizationModules/LibCore/cvfMutex.h +++ b/Fwk/VizFwk/LibCore/cvfMutex.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/VisualizationModules/LibCore/cvfObject.cpp b/Fwk/VizFwk/LibCore/cvfObject.cpp similarity index 78% rename from VisualizationModules/LibCore/cvfObject.cpp rename to Fwk/VizFwk/LibCore/cvfObject.cpp index 68edaf99f8..6ac3272793 100644 --- a/VisualizationModules/LibCore/cvfObject.cpp +++ b/Fwk/VizFwk/LibCore/cvfObject.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfObject.h" #include "cvfTrace.h" diff --git a/VisualizationModules/LibCore/cvfObject.h b/Fwk/VizFwk/LibCore/cvfObject.h similarity index 85% rename from VisualizationModules/LibCore/cvfObject.h rename to Fwk/VizFwk/LibCore/cvfObject.h index 2943ed065c..9ff28e7ad6 100644 --- a/VisualizationModules/LibCore/cvfObject.h +++ b/Fwk/VizFwk/LibCore/cvfObject.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfSystem.h" diff --git a/VisualizationModules/LibCore/cvfObject.inl b/Fwk/VizFwk/LibCore/cvfObject.inl similarity index 93% rename from VisualizationModules/LibCore/cvfObject.inl rename to Fwk/VizFwk/LibCore/cvfObject.inl index 40529aee8f..a4c65fd573 100644 --- a/VisualizationModules/LibCore/cvfObject.inl +++ b/Fwk/VizFwk/LibCore/cvfObject.inl @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + namespace cvf { @@ -354,7 +372,7 @@ bool ref::operator<(const ref& rhs) const /// Swap the associated pointer in this and the passed ref object. Will not modify the reference /// count of any of the associated objects. /// -/// \warning Note that signature differs from normal CeeVizFramework practice. This is done to be +/// \warning Note that signature differs from normal practice. This is done to be /// consistent with the signature of std::swap() //-------------------------------------------------------------------------------------------------- template diff --git a/VisualizationModules/LibCore/cvfPlane.cpp b/Fwk/VizFwk/LibCore/cvfPlane.cpp similarity index 94% rename from VisualizationModules/LibCore/cvfPlane.cpp rename to Fwk/VizFwk/LibCore/cvfPlane.cpp index 6f42e802a6..dcb523125a 100644 --- a/VisualizationModules/LibCore/cvfPlane.cpp +++ b/Fwk/VizFwk/LibCore/cvfPlane.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfPlane.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibCore/cvfPlane.h b/Fwk/VizFwk/LibCore/cvfPlane.h similarity index 73% rename from VisualizationModules/LibCore/cvfPlane.h rename to Fwk/VizFwk/LibCore/cvfPlane.h index f3f500aa5a..0ce4614d69 100644 --- a/VisualizationModules/LibCore/cvfPlane.h +++ b/Fwk/VizFwk/LibCore/cvfPlane.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibCore/cvfPropertySet.cpp b/Fwk/VizFwk/LibCore/cvfPropertySet.cpp similarity index 81% rename from VisualizationModules/LibCore/cvfPropertySet.cpp rename to Fwk/VizFwk/LibCore/cvfPropertySet.cpp index dac0d3feb1..0854b69d1e 100644 --- a/VisualizationModules/LibCore/cvfPropertySet.cpp +++ b/Fwk/VizFwk/LibCore/cvfPropertySet.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfPropertySet.h" diff --git a/VisualizationModules/LibCore/cvfPropertySet.h b/Fwk/VizFwk/LibCore/cvfPropertySet.h similarity index 61% rename from VisualizationModules/LibCore/cvfPropertySet.h rename to Fwk/VizFwk/LibCore/cvfPropertySet.h index cf2f0969df..1433a4185e 100644 --- a/VisualizationModules/LibCore/cvfPropertySet.h +++ b/Fwk/VizFwk/LibCore/cvfPropertySet.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibCore/cvfPropertySetCollection.cpp b/Fwk/VizFwk/LibCore/cvfPropertySetCollection.cpp similarity index 82% rename from VisualizationModules/LibCore/cvfPropertySetCollection.cpp rename to Fwk/VizFwk/LibCore/cvfPropertySetCollection.cpp index f751d2170a..66ba15c733 100644 --- a/VisualizationModules/LibCore/cvfPropertySetCollection.cpp +++ b/Fwk/VizFwk/LibCore/cvfPropertySetCollection.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfPropertySetCollection.h" diff --git a/VisualizationModules/LibCore/cvfPropertySetCollection.h b/Fwk/VizFwk/LibCore/cvfPropertySetCollection.h similarity index 60% rename from VisualizationModules/LibCore/cvfPropertySetCollection.h rename to Fwk/VizFwk/LibCore/cvfPropertySetCollection.h index 2b8b628aea..20f58ec63f 100644 --- a/VisualizationModules/LibCore/cvfPropertySetCollection.h +++ b/Fwk/VizFwk/LibCore/cvfPropertySetCollection.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibCore/cvfQuat.h b/Fwk/VizFwk/LibCore/cvfQuat.h similarity index 72% rename from VisualizationModules/LibCore/cvfQuat.h rename to Fwk/VizFwk/LibCore/cvfQuat.h index be9f0791de..428a5aade6 100644 --- a/VisualizationModules/LibCore/cvfQuat.h +++ b/Fwk/VizFwk/LibCore/cvfQuat.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfVector3.h" diff --git a/VisualizationModules/LibCore/cvfQuat.inl b/Fwk/VizFwk/LibCore/cvfQuat.inl similarity index 91% rename from VisualizationModules/LibCore/cvfQuat.inl rename to Fwk/VizFwk/LibCore/cvfQuat.inl index a97f3f531d..e4a0b3a610 100644 --- a/VisualizationModules/LibCore/cvfQuat.inl +++ b/Fwk/VizFwk/LibCore/cvfQuat.inl @@ -1,23 +1,41 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + namespace cvf { diff --git a/VisualizationModules/LibCore/cvfRect.h b/Fwk/VizFwk/LibCore/cvfRect.h similarity index 70% rename from VisualizationModules/LibCore/cvfRect.h rename to Fwk/VizFwk/LibCore/cvfRect.h index 93c71c34fd..40772f86d5 100644 --- a/VisualizationModules/LibCore/cvfRect.h +++ b/Fwk/VizFwk/LibCore/cvfRect.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfVector2.h" diff --git a/VisualizationModules/LibCore/cvfRect.inl b/Fwk/VizFwk/LibCore/cvfRect.inl similarity index 93% rename from VisualizationModules/LibCore/cvfRect.inl rename to Fwk/VizFwk/LibCore/cvfRect.inl index 420f0e4c21..5c1f991957 100644 --- a/VisualizationModules/LibCore/cvfRect.inl +++ b/Fwk/VizFwk/LibCore/cvfRect.inl @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + namespace cvf { diff --git a/VisualizationModules/LibCore/cvfString.cpp b/Fwk/VizFwk/LibCore/cvfString.cpp similarity index 97% rename from VisualizationModules/LibCore/cvfString.cpp rename to Fwk/VizFwk/LibCore/cvfString.cpp index af87068021..be05c85b7e 100644 --- a/VisualizationModules/LibCore/cvfString.cpp +++ b/Fwk/VizFwk/LibCore/cvfString.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfString.h" #include "cvfSystem.h" @@ -1533,7 +1551,7 @@ String String::arg(double a, int fieldWidth, char format, int precision, const w /// /// \param other Modifiable reference to the string that should have its contents swapped. /// -/// \warning Note that signature differs from normal CeeVizFramework practice. This is done to be +/// \warning Note that signature differs from normal practice. This is done to be /// consistent with the signature of std::swap() //-------------------------------------------------------------------------------------------------- void String::swap(String& other) diff --git a/VisualizationModules/LibCore/cvfString.h b/Fwk/VizFwk/LibCore/cvfString.h similarity index 82% rename from VisualizationModules/LibCore/cvfString.h rename to Fwk/VizFwk/LibCore/cvfString.h index 342f6d37e6..0be089dcde 100644 --- a/VisualizationModules/LibCore/cvfString.h +++ b/Fwk/VizFwk/LibCore/cvfString.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfCharArray.h" diff --git a/VisualizationModules/LibCore/cvfSystem.cpp b/Fwk/VizFwk/LibCore/cvfSystem.cpp similarity index 89% rename from VisualizationModules/LibCore/cvfSystem.cpp rename to Fwk/VizFwk/LibCore/cvfSystem.cpp index 31933c81c2..60c7f0b37f 100644 --- a/VisualizationModules/LibCore/cvfSystem.cpp +++ b/Fwk/VizFwk/LibCore/cvfSystem.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfSystem.h" #include "cvfString.h" diff --git a/VisualizationModules/LibCore/cvfSystem.h b/Fwk/VizFwk/LibCore/cvfSystem.h similarity index 61% rename from VisualizationModules/LibCore/cvfSystem.h rename to Fwk/VizFwk/LibCore/cvfSystem.h index 841880ee07..e705f28108 100644 --- a/VisualizationModules/LibCore/cvfSystem.h +++ b/Fwk/VizFwk/LibCore/cvfSystem.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace cvf { diff --git a/VisualizationModules/LibCore/cvfTBBControl.cpp b/Fwk/VizFwk/LibCore/cvfTBBControl.cpp similarity index 65% rename from VisualizationModules/LibCore/cvfTBBControl.cpp rename to Fwk/VizFwk/LibCore/cvfTBBControl.cpp index 80669d8033..105c501865 100644 --- a/VisualizationModules/LibCore/cvfTBBControl.cpp +++ b/Fwk/VizFwk/LibCore/cvfTBBControl.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfTBBControl.h" diff --git a/VisualizationModules/LibCore/cvfTBBControl.h b/Fwk/VizFwk/LibCore/cvfTBBControl.h similarity index 50% rename from VisualizationModules/LibCore/cvfTBBControl.h rename to Fwk/VizFwk/LibCore/cvfTBBControl.h index b7a2eb3aea..11bab6e1a8 100644 --- a/VisualizationModules/LibCore/cvfTBBControl.h +++ b/Fwk/VizFwk/LibCore/cvfTBBControl.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace cvf { diff --git a/VisualizationModules/LibCore/cvfTimer.cpp b/Fwk/VizFwk/LibCore/cvfTimer.cpp similarity index 87% rename from VisualizationModules/LibCore/cvfTimer.cpp rename to Fwk/VizFwk/LibCore/cvfTimer.cpp index ddb45b4132..db80ce18ba 100644 --- a/VisualizationModules/LibCore/cvfTimer.cpp +++ b/Fwk/VizFwk/LibCore/cvfTimer.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfTimer.h" diff --git a/VisualizationModules/LibCore/cvfTimer.h b/Fwk/VizFwk/LibCore/cvfTimer.h similarity index 51% rename from VisualizationModules/LibCore/cvfTimer.h rename to Fwk/VizFwk/LibCore/cvfTimer.h index ddee5e0c5e..3b0f3f82a2 100644 --- a/VisualizationModules/LibCore/cvfTimer.h +++ b/Fwk/VizFwk/LibCore/cvfTimer.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibCore/cvfTrace.cpp b/Fwk/VizFwk/LibCore/cvfTrace.cpp similarity index 80% rename from VisualizationModules/LibCore/cvfTrace.cpp rename to Fwk/VizFwk/LibCore/cvfTrace.cpp index 99fa035708..5abf95390d 100644 --- a/VisualizationModules/LibCore/cvfTrace.cpp +++ b/Fwk/VizFwk/LibCore/cvfTrace.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfTrace.h" #include "cvfSystem.h" diff --git a/VisualizationModules/LibCore/cvfTrace.h b/Fwk/VizFwk/LibCore/cvfTrace.h similarity index 57% rename from VisualizationModules/LibCore/cvfTrace.h rename to Fwk/VizFwk/LibCore/cvfTrace.h index 1d6fa9877b..48e902604a 100644 --- a/VisualizationModules/LibCore/cvfTrace.h +++ b/Fwk/VizFwk/LibCore/cvfTrace.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfString.h" diff --git a/VisualizationModules/LibCore/cvfValueArray.h b/Fwk/VizFwk/LibCore/cvfValueArray.h similarity index 62% rename from VisualizationModules/LibCore/cvfValueArray.h rename to Fwk/VizFwk/LibCore/cvfValueArray.h index 754990a7ed..9047f66492 100644 --- a/VisualizationModules/LibCore/cvfValueArray.h +++ b/Fwk/VizFwk/LibCore/cvfValueArray.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfVector4.h" diff --git a/VisualizationModules/LibCore/cvfVariant.cpp b/Fwk/VizFwk/LibCore/cvfVariant.cpp similarity index 92% rename from VisualizationModules/LibCore/cvfVariant.cpp rename to Fwk/VizFwk/LibCore/cvfVariant.cpp index 971e3df03f..989e912946 100644 --- a/VisualizationModules/LibCore/cvfVariant.cpp +++ b/Fwk/VizFwk/LibCore/cvfVariant.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfVariant.h" diff --git a/VisualizationModules/LibCore/cvfVariant.h b/Fwk/VizFwk/LibCore/cvfVariant.h similarity index 71% rename from VisualizationModules/LibCore/cvfVariant.h rename to Fwk/VizFwk/LibCore/cvfVariant.h index 0983c37d24..80decf6e34 100644 --- a/VisualizationModules/LibCore/cvfVariant.h +++ b/Fwk/VizFwk/LibCore/cvfVariant.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfVector3.h" diff --git a/Fwk/VizFwk/LibCore/cvfVector2.cpp b/Fwk/VizFwk/LibCore/cvfVector2.cpp new file mode 100644 index 0000000000..2930a25f62 --- /dev/null +++ b/Fwk/VizFwk/LibCore/cvfVector2.cpp @@ -0,0 +1,50 @@ +//################################################################################################## +// +// Custom Visualization Core library +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. +// +//################################################################################################## + + +#include "cvfBase.h" +#include "cvfVector2.h" + +namespace cvf { + + +template<> Vector2 const Vector2::UNDEFINED(UNDEFINED_DOUBLE, UNDEFINED_DOUBLE); +template<> Vector2 const Vector2::UNDEFINED(UNDEFINED_FLOAT, UNDEFINED_FLOAT); +template<> Vector2 const Vector2::UNDEFINED(UNDEFINED_INT, UNDEFINED_INT); + + +} // namespace cvf + diff --git a/VisualizationModules/LibCore/cvfVector2.h b/Fwk/VizFwk/LibCore/cvfVector2.h similarity index 80% rename from VisualizationModules/LibCore/cvfVector2.h rename to Fwk/VizFwk/LibCore/cvfVector2.h index 00a6bc0db3..0bf1806b67 100644 --- a/VisualizationModules/LibCore/cvfVector2.h +++ b/Fwk/VizFwk/LibCore/cvfVector2.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfMath.h" diff --git a/VisualizationModules/LibCore/cvfVector2.inl b/Fwk/VizFwk/LibCore/cvfVector2.inl similarity index 93% rename from VisualizationModules/LibCore/cvfVector2.inl rename to Fwk/VizFwk/LibCore/cvfVector2.inl index 9db31aa4b8..7a74ae73d2 100644 --- a/VisualizationModules/LibCore/cvfVector2.inl +++ b/Fwk/VizFwk/LibCore/cvfVector2.inl @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + namespace cvf { diff --git a/VisualizationModules/LibCore/cvfVector3.cpp b/Fwk/VizFwk/LibCore/cvfVector3.cpp similarity index 52% rename from VisualizationModules/LibCore/cvfVector3.cpp rename to Fwk/VizFwk/LibCore/cvfVector3.cpp index ae2f609e1c..4116ae0b72 100644 --- a/VisualizationModules/LibCore/cvfVector3.cpp +++ b/Fwk/VizFwk/LibCore/cvfVector3.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfVector3.h" diff --git a/VisualizationModules/LibCore/cvfVector3.h b/Fwk/VizFwk/LibCore/cvfVector3.h similarity index 84% rename from VisualizationModules/LibCore/cvfVector3.h rename to Fwk/VizFwk/LibCore/cvfVector3.h index 5254ba1d7f..25d4c9533e 100644 --- a/VisualizationModules/LibCore/cvfVector3.h +++ b/Fwk/VizFwk/LibCore/cvfVector3.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfVector2.h" diff --git a/VisualizationModules/LibCore/cvfVector3.inl b/Fwk/VizFwk/LibCore/cvfVector3.inl similarity index 96% rename from VisualizationModules/LibCore/cvfVector3.inl rename to Fwk/VizFwk/LibCore/cvfVector3.inl index f663e21c78..d8379b251e 100644 --- a/VisualizationModules/LibCore/cvfVector3.inl +++ b/Fwk/VizFwk/LibCore/cvfVector3.inl @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + namespace cvf { diff --git a/VisualizationModules/LibCore/cvfVector4.cpp b/Fwk/VizFwk/LibCore/cvfVector4.cpp similarity index 51% rename from VisualizationModules/LibCore/cvfVector4.cpp rename to Fwk/VizFwk/LibCore/cvfVector4.cpp index 7ef304a8dc..e78645581a 100644 --- a/VisualizationModules/LibCore/cvfVector4.cpp +++ b/Fwk/VizFwk/LibCore/cvfVector4.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfVector4.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibCore/cvfVector4.h b/Fwk/VizFwk/LibCore/cvfVector4.h similarity index 81% rename from VisualizationModules/LibCore/cvfVector4.h rename to Fwk/VizFwk/LibCore/cvfVector4.h index d93c7c5c0d..35f1586265 100644 --- a/VisualizationModules/LibCore/cvfVector4.h +++ b/Fwk/VizFwk/LibCore/cvfVector4.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfVector3.h" diff --git a/VisualizationModules/LibCore/cvfVector4.inl b/Fwk/VizFwk/LibCore/cvfVector4.inl similarity index 93% rename from VisualizationModules/LibCore/cvfVector4.inl rename to Fwk/VizFwk/LibCore/cvfVector4.inl index 5ec517c125..5c0bd9269a 100644 --- a/VisualizationModules/LibCore/cvfVector4.inl +++ b/Fwk/VizFwk/LibCore/cvfVector4.inl @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + namespace cvf { diff --git a/Fwk/VizFwk/LibCore/cvfVersion.h b/Fwk/VizFwk/LibCore/cvfVersion.h new file mode 100644 index 0000000000..e0dd973b39 --- /dev/null +++ b/Fwk/VizFwk/LibCore/cvfVersion.h @@ -0,0 +1,45 @@ +//################################################################################################## +// +// Custom Visualization Core library +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. +// +//################################################################################################## + + +#pragma once + + + +#define CVF_MAJOR_VERSION "0" // Major version number +#define CVF_MINOR_VERSION "9" // Minor version number +#define CVF_SPECIAL_BUILD "" // Special build description +#define CVF_BUILD_NUMBER "5" // Build number. Increase for each shipment diff --git a/VisualizationModules/LibGeometry/CMakeLists.txt b/Fwk/VizFwk/LibGeometry/CMakeLists.txt similarity index 100% rename from VisualizationModules/LibGeometry/CMakeLists.txt rename to Fwk/VizFwk/LibGeometry/CMakeLists.txt diff --git a/VisualizationModules/LibGeometry/cvfArrowGenerator.cpp b/Fwk/VizFwk/LibGeometry/cvfArrowGenerator.cpp similarity index 77% rename from VisualizationModules/LibGeometry/cvfArrowGenerator.cpp rename to Fwk/VizFwk/LibGeometry/cvfArrowGenerator.cpp index aea8260ce3..cb34f38092 100644 --- a/VisualizationModules/LibGeometry/cvfArrowGenerator.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfArrowGenerator.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfArrowGenerator.h" #include "cvfGeometryUtils.h" diff --git a/VisualizationModules/LibGeometry/cvfArrowGenerator.h b/Fwk/VizFwk/LibGeometry/cvfArrowGenerator.h similarity index 57% rename from VisualizationModules/LibGeometry/cvfArrowGenerator.h rename to Fwk/VizFwk/LibGeometry/cvfArrowGenerator.h index c3ceb37cf9..14fcb99d64 100644 --- a/VisualizationModules/LibGeometry/cvfArrowGenerator.h +++ b/Fwk/VizFwk/LibGeometry/cvfArrowGenerator.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace cvf { diff --git a/VisualizationModules/LibGeometry/cvfBoundingBox.cpp b/Fwk/VizFwk/LibGeometry/cvfBoundingBox.cpp similarity index 92% rename from VisualizationModules/LibGeometry/cvfBoundingBox.cpp rename to Fwk/VizFwk/LibGeometry/cvfBoundingBox.cpp index bcfa45d71f..57482ac7df 100644 --- a/VisualizationModules/LibGeometry/cvfBoundingBox.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfBoundingBox.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfBoundingBox.h" #include "cvfString.h" diff --git a/VisualizationModules/LibGeometry/cvfBoundingBox.h b/Fwk/VizFwk/LibGeometry/cvfBoundingBox.h similarity index 66% rename from VisualizationModules/LibGeometry/cvfBoundingBox.h rename to Fwk/VizFwk/LibGeometry/cvfBoundingBox.h index 514c1ca897..771eb4b1a2 100644 --- a/VisualizationModules/LibGeometry/cvfBoundingBox.h +++ b/Fwk/VizFwk/LibGeometry/cvfBoundingBox.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfArray.h" diff --git a/VisualizationModules/LibGeometry/cvfBoxGenerator.cpp b/Fwk/VizFwk/LibGeometry/cvfBoxGenerator.cpp similarity index 84% rename from VisualizationModules/LibGeometry/cvfBoxGenerator.cpp rename to Fwk/VizFwk/LibGeometry/cvfBoxGenerator.cpp index 492605ad7a..8d8203ad1e 100644 --- a/VisualizationModules/LibGeometry/cvfBoxGenerator.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfBoxGenerator.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfBoxGenerator.h" #include "cvfPatchGenerator.h" diff --git a/VisualizationModules/LibGeometry/cvfBoxGenerator.h b/Fwk/VizFwk/LibGeometry/cvfBoxGenerator.h similarity index 58% rename from VisualizationModules/LibGeometry/cvfBoxGenerator.h rename to Fwk/VizFwk/LibGeometry/cvfBoxGenerator.h index 26895f303c..224afc8a10 100644 --- a/VisualizationModules/LibGeometry/cvfBoxGenerator.h +++ b/Fwk/VizFwk/LibGeometry/cvfBoxGenerator.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfVector3.h" diff --git a/VisualizationModules/LibGeometry/cvfEdgeKey.cpp b/Fwk/VizFwk/LibGeometry/cvfEdgeKey.cpp similarity index 73% rename from VisualizationModules/LibGeometry/cvfEdgeKey.cpp rename to Fwk/VizFwk/LibGeometry/cvfEdgeKey.cpp index c98548ecfd..9b78e838a4 100644 --- a/VisualizationModules/LibGeometry/cvfEdgeKey.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfEdgeKey.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfEdgeKey.h" diff --git a/VisualizationModules/LibGeometry/cvfEdgeKey.h b/Fwk/VizFwk/LibGeometry/cvfEdgeKey.h similarity index 57% rename from VisualizationModules/LibGeometry/cvfEdgeKey.h rename to Fwk/VizFwk/LibGeometry/cvfEdgeKey.h index 3dfb964a0b..74c4544333 100644 --- a/VisualizationModules/LibGeometry/cvfEdgeKey.h +++ b/Fwk/VizFwk/LibGeometry/cvfEdgeKey.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace cvf { diff --git a/VisualizationModules/LibGeometry/cvfFrustum.cpp b/Fwk/VizFwk/LibGeometry/cvfFrustum.cpp similarity index 86% rename from VisualizationModules/LibGeometry/cvfFrustum.cpp rename to Fwk/VizFwk/LibGeometry/cvfFrustum.cpp index e4296a61fb..9641cb9145 100644 --- a/VisualizationModules/LibGeometry/cvfFrustum.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfFrustum.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfBoundingBox.h" #include "cvfFrustum.h" diff --git a/VisualizationModules/LibGeometry/cvfFrustum.h b/Fwk/VizFwk/LibGeometry/cvfFrustum.h similarity index 62% rename from VisualizationModules/LibGeometry/cvfFrustum.h rename to Fwk/VizFwk/LibGeometry/cvfFrustum.h index 9d993380fc..5acc76d8e2 100644 --- a/VisualizationModules/LibGeometry/cvfFrustum.h +++ b/Fwk/VizFwk/LibGeometry/cvfFrustum.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibGeometry/cvfGeometryBuilder.cpp b/Fwk/VizFwk/LibGeometry/cvfGeometryBuilder.cpp similarity index 91% rename from VisualizationModules/LibGeometry/cvfGeometryBuilder.cpp rename to Fwk/VizFwk/LibGeometry/cvfGeometryBuilder.cpp index 7d929caa80..630e6e751a 100644 --- a/VisualizationModules/LibGeometry/cvfGeometryBuilder.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfGeometryBuilder.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfGeometryBuilder.h" diff --git a/VisualizationModules/LibGeometry/cvfGeometryBuilder.h b/Fwk/VizFwk/LibGeometry/cvfGeometryBuilder.h similarity index 67% rename from VisualizationModules/LibGeometry/cvfGeometryBuilder.h rename to Fwk/VizFwk/LibGeometry/cvfGeometryBuilder.h index ebe17fd551..76f94c76af 100644 --- a/VisualizationModules/LibGeometry/cvfGeometryBuilder.h +++ b/Fwk/VizFwk/LibGeometry/cvfGeometryBuilder.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibGeometry/cvfGeometryBuilderFaceList.cpp b/Fwk/VizFwk/LibGeometry/cvfGeometryBuilderFaceList.cpp similarity index 81% rename from VisualizationModules/LibGeometry/cvfGeometryBuilderFaceList.cpp rename to Fwk/VizFwk/LibGeometry/cvfGeometryBuilderFaceList.cpp index 9e18cf009f..5d536db8a6 100644 --- a/VisualizationModules/LibGeometry/cvfGeometryBuilderFaceList.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfGeometryBuilderFaceList.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfGeometryBuilderFaceList.h" diff --git a/VisualizationModules/LibGeometry/cvfGeometryBuilderFaceList.h b/Fwk/VizFwk/LibGeometry/cvfGeometryBuilderFaceList.h similarity index 60% rename from VisualizationModules/LibGeometry/cvfGeometryBuilderFaceList.h rename to Fwk/VizFwk/LibGeometry/cvfGeometryBuilderFaceList.h index 20836e6ed5..4c83714beb 100644 --- a/VisualizationModules/LibGeometry/cvfGeometryBuilderFaceList.h +++ b/Fwk/VizFwk/LibGeometry/cvfGeometryBuilderFaceList.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfGeometryBuilder.h" diff --git a/VisualizationModules/LibGeometry/cvfGeometryBuilderTriangles.cpp b/Fwk/VizFwk/LibGeometry/cvfGeometryBuilderTriangles.cpp similarity index 79% rename from VisualizationModules/LibGeometry/cvfGeometryBuilderTriangles.cpp rename to Fwk/VizFwk/LibGeometry/cvfGeometryBuilderTriangles.cpp index 3752744fc0..db34b461bb 100644 --- a/VisualizationModules/LibGeometry/cvfGeometryBuilderTriangles.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfGeometryBuilderTriangles.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfGeometryBuilderTriangles.h" diff --git a/VisualizationModules/LibGeometry/cvfGeometryBuilderTriangles.h b/Fwk/VizFwk/LibGeometry/cvfGeometryBuilderTriangles.h similarity index 59% rename from VisualizationModules/LibGeometry/cvfGeometryBuilderTriangles.h rename to Fwk/VizFwk/LibGeometry/cvfGeometryBuilderTriangles.h index 854e703273..c0445f84c6 100644 --- a/VisualizationModules/LibGeometry/cvfGeometryBuilderTriangles.h +++ b/Fwk/VizFwk/LibGeometry/cvfGeometryBuilderTriangles.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfGeometryBuilder.h" diff --git a/VisualizationModules/LibGeometry/cvfGeometryUtils.cpp b/Fwk/VizFwk/LibGeometry/cvfGeometryUtils.cpp similarity index 96% rename from VisualizationModules/LibGeometry/cvfGeometryUtils.cpp rename to Fwk/VizFwk/LibGeometry/cvfGeometryUtils.cpp index f78f84fc30..1b6d284897 100644 --- a/VisualizationModules/LibGeometry/cvfGeometryUtils.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfGeometryUtils.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfGeometryBuilder.h" #include "cvfGeometryUtils.h" diff --git a/VisualizationModules/LibGeometry/cvfGeometryUtils.h b/Fwk/VizFwk/LibGeometry/cvfGeometryUtils.h similarity index 75% rename from VisualizationModules/LibGeometry/cvfGeometryUtils.h rename to Fwk/VizFwk/LibGeometry/cvfGeometryUtils.h index 3f04d4c966..c19a1052b8 100644 --- a/VisualizationModules/LibGeometry/cvfGeometryUtils.h +++ b/Fwk/VizFwk/LibGeometry/cvfGeometryUtils.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfVector3.h" diff --git a/VisualizationModules/LibGeometry/cvfLibGeometry.h b/Fwk/VizFwk/LibGeometry/cvfLibGeometry.h similarity index 53% rename from VisualizationModules/LibGeometry/cvfLibGeometry.h rename to Fwk/VizFwk/LibGeometry/cvfLibGeometry.h index c819b9ca16..9cacbbceb0 100644 --- a/VisualizationModules/LibGeometry/cvfLibGeometry.h +++ b/Fwk/VizFwk/LibGeometry/cvfLibGeometry.h @@ -1,25 +1,43 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + // Doxygen module definition -/// \ingroup CeeVizFramework +/// \ingroup VizFramework /// @{ /// \defgroup Geometry Geometry module /// @} diff --git a/VisualizationModules/LibGeometry/cvfMeshEdgeExtractor.cpp b/Fwk/VizFwk/LibGeometry/cvfMeshEdgeExtractor.cpp similarity index 81% rename from VisualizationModules/LibGeometry/cvfMeshEdgeExtractor.cpp rename to Fwk/VizFwk/LibGeometry/cvfMeshEdgeExtractor.cpp index 8dbb4688c8..a6bbf47d96 100644 --- a/VisualizationModules/LibGeometry/cvfMeshEdgeExtractor.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfMeshEdgeExtractor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfMeshEdgeExtractor.h" #include "cvfEdgeKey.h" diff --git a/VisualizationModules/LibGeometry/cvfMeshEdgeExtractor.h b/Fwk/VizFwk/LibGeometry/cvfMeshEdgeExtractor.h similarity index 55% rename from VisualizationModules/LibGeometry/cvfMeshEdgeExtractor.h rename to Fwk/VizFwk/LibGeometry/cvfMeshEdgeExtractor.h index d5f4f4443d..e21a61fd79 100644 --- a/VisualizationModules/LibGeometry/cvfMeshEdgeExtractor.h +++ b/Fwk/VizFwk/LibGeometry/cvfMeshEdgeExtractor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfArray.h" diff --git a/VisualizationModules/LibGeometry/cvfOutlineEdgeExtractor.cpp b/Fwk/VizFwk/LibGeometry/cvfOutlineEdgeExtractor.cpp similarity index 89% rename from VisualizationModules/LibGeometry/cvfOutlineEdgeExtractor.cpp rename to Fwk/VizFwk/LibGeometry/cvfOutlineEdgeExtractor.cpp index b4d12b2ba3..b4f256c597 100644 --- a/VisualizationModules/LibGeometry/cvfOutlineEdgeExtractor.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfOutlineEdgeExtractor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOutlineEdgeExtractor.h" #include "cvfEdgeKey.h" diff --git a/VisualizationModules/LibGeometry/cvfOutlineEdgeExtractor.h b/Fwk/VizFwk/LibGeometry/cvfOutlineEdgeExtractor.h similarity index 64% rename from VisualizationModules/LibGeometry/cvfOutlineEdgeExtractor.h rename to Fwk/VizFwk/LibGeometry/cvfOutlineEdgeExtractor.h index e198c50715..7de21fff07 100644 --- a/VisualizationModules/LibGeometry/cvfOutlineEdgeExtractor.h +++ b/Fwk/VizFwk/LibGeometry/cvfOutlineEdgeExtractor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfArray.h" diff --git a/VisualizationModules/LibGeometry/cvfPatchGenerator.cpp b/Fwk/VizFwk/LibGeometry/cvfPatchGenerator.cpp similarity index 81% rename from VisualizationModules/LibGeometry/cvfPatchGenerator.cpp rename to Fwk/VizFwk/LibGeometry/cvfPatchGenerator.cpp index a86abed5dc..20bdc8c13e 100644 --- a/VisualizationModules/LibGeometry/cvfPatchGenerator.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfPatchGenerator.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfPatchGenerator.h" #include "cvfGeometryUtils.h" diff --git a/VisualizationModules/LibGeometry/cvfPatchGenerator.h b/Fwk/VizFwk/LibGeometry/cvfPatchGenerator.h similarity index 65% rename from VisualizationModules/LibGeometry/cvfPatchGenerator.h rename to Fwk/VizFwk/LibGeometry/cvfPatchGenerator.h index 358b5ae603..1572b58e02 100644 --- a/VisualizationModules/LibGeometry/cvfPatchGenerator.h +++ b/Fwk/VizFwk/LibGeometry/cvfPatchGenerator.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfVector3.h" diff --git a/VisualizationModules/LibGeometry/cvfRay.cpp b/Fwk/VizFwk/LibGeometry/cvfRay.cpp similarity index 93% rename from VisualizationModules/LibGeometry/cvfRay.cpp rename to Fwk/VizFwk/LibGeometry/cvfRay.cpp index a198cfeab1..4f8e07dc3b 100644 --- a/VisualizationModules/LibGeometry/cvfRay.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfRay.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRay.h" #include "cvfBoundingBox.h" diff --git a/VisualizationModules/LibGeometry/cvfRay.h b/Fwk/VizFwk/LibGeometry/cvfRay.h similarity index 70% rename from VisualizationModules/LibGeometry/cvfRay.h rename to Fwk/VizFwk/LibGeometry/cvfRay.h index 4bb008a8e3..73aa665a5a 100644 --- a/VisualizationModules/LibGeometry/cvfRay.h +++ b/Fwk/VizFwk/LibGeometry/cvfRay.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibGeometry/cvfTriangleMeshEdgeExtractor.cpp b/Fwk/VizFwk/LibGeometry/cvfTriangleMeshEdgeExtractor.cpp similarity index 77% rename from VisualizationModules/LibGeometry/cvfTriangleMeshEdgeExtractor.cpp rename to Fwk/VizFwk/LibGeometry/cvfTriangleMeshEdgeExtractor.cpp index 5ad00d568f..72b359489b 100644 --- a/VisualizationModules/LibGeometry/cvfTriangleMeshEdgeExtractor.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfTriangleMeshEdgeExtractor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfTriangleMeshEdgeExtractor.h" diff --git a/VisualizationModules/LibGeometry/cvfTriangleMeshEdgeExtractor.h b/Fwk/VizFwk/LibGeometry/cvfTriangleMeshEdgeExtractor.h similarity index 60% rename from VisualizationModules/LibGeometry/cvfTriangleMeshEdgeExtractor.h rename to Fwk/VizFwk/LibGeometry/cvfTriangleMeshEdgeExtractor.h index 07a9ad2e65..89a70478d8 100644 --- a/VisualizationModules/LibGeometry/cvfTriangleMeshEdgeExtractor.h +++ b/Fwk/VizFwk/LibGeometry/cvfTriangleMeshEdgeExtractor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfArray.h" diff --git a/VisualizationModules/LibGeometry/cvfTriangleVertexSplitter.cpp b/Fwk/VizFwk/LibGeometry/cvfTriangleVertexSplitter.cpp similarity index 90% rename from VisualizationModules/LibGeometry/cvfTriangleVertexSplitter.cpp rename to Fwk/VizFwk/LibGeometry/cvfTriangleVertexSplitter.cpp index 4ef19c5ede..659394f3fe 100644 --- a/VisualizationModules/LibGeometry/cvfTriangleVertexSplitter.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfTriangleVertexSplitter.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfTriangleVertexSplitter.h" #include "cvfFrustum.h" diff --git a/VisualizationModules/LibGeometry/cvfTriangleVertexSplitter.h b/Fwk/VizFwk/LibGeometry/cvfTriangleVertexSplitter.h similarity index 65% rename from VisualizationModules/LibGeometry/cvfTriangleVertexSplitter.h rename to Fwk/VizFwk/LibGeometry/cvfTriangleVertexSplitter.h index ac180b40eb..4b805a6d38 100644 --- a/VisualizationModules/LibGeometry/cvfTriangleVertexSplitter.h +++ b/Fwk/VizFwk/LibGeometry/cvfTriangleVertexSplitter.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfArray.h" diff --git a/VisualizationModules/LibGeometry/cvfVertexCompactor.cpp b/Fwk/VizFwk/LibGeometry/cvfVertexCompactor.cpp similarity index 79% rename from VisualizationModules/LibGeometry/cvfVertexCompactor.cpp rename to Fwk/VizFwk/LibGeometry/cvfVertexCompactor.cpp index 1bbb9cef82..ae3840fa8e 100644 --- a/VisualizationModules/LibGeometry/cvfVertexCompactor.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfVertexCompactor.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfVertexCompactor.h" #include "cvfGeometryUtils.h" diff --git a/VisualizationModules/LibGeometry/cvfVertexCompactor.h b/Fwk/VizFwk/LibGeometry/cvfVertexCompactor.h similarity index 62% rename from VisualizationModules/LibGeometry/cvfVertexCompactor.h rename to Fwk/VizFwk/LibGeometry/cvfVertexCompactor.h index 10b8009ed8..4af9c0633a 100644 --- a/VisualizationModules/LibGeometry/cvfVertexCompactor.h +++ b/Fwk/VizFwk/LibGeometry/cvfVertexCompactor.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfArray.h" diff --git a/VisualizationModules/LibGeometry/cvfVertexWelder.cpp b/Fwk/VizFwk/LibGeometry/cvfVertexWelder.cpp similarity index 89% rename from VisualizationModules/LibGeometry/cvfVertexWelder.cpp rename to Fwk/VizFwk/LibGeometry/cvfVertexWelder.cpp index 4ef99cd3c3..b7965f1d56 100644 --- a/VisualizationModules/LibGeometry/cvfVertexWelder.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfVertexWelder.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfVertexWelder.h" diff --git a/VisualizationModules/LibGeometry/cvfVertexWelder.h b/Fwk/VizFwk/LibGeometry/cvfVertexWelder.h similarity index 67% rename from VisualizationModules/LibGeometry/cvfVertexWelder.h rename to Fwk/VizFwk/LibGeometry/cvfVertexWelder.h index 6ed7a31250..82b3fbd0a5 100644 --- a/VisualizationModules/LibGeometry/cvfVertexWelder.h +++ b/Fwk/VizFwk/LibGeometry/cvfVertexWelder.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfArray.h" diff --git a/VisualizationModules/LibGuiQt/CMakeLists.txt b/Fwk/VizFwk/LibGuiQt/CMakeLists.txt similarity index 100% rename from VisualizationModules/LibGuiQt/CMakeLists.txt rename to Fwk/VizFwk/LibGuiQt/CMakeLists.txt diff --git a/VisualizationModules/LibGuiQt/cvfqtBasicAboutDialog.cpp b/Fwk/VizFwk/LibGuiQt/cvfqtBasicAboutDialog.cpp similarity index 92% rename from VisualizationModules/LibGuiQt/cvfqtBasicAboutDialog.cpp rename to Fwk/VizFwk/LibGuiQt/cvfqtBasicAboutDialog.cpp index fd168a5e5c..a10f9779cc 100644 --- a/VisualizationModules/LibGuiQt/cvfqtBasicAboutDialog.cpp +++ b/Fwk/VizFwk/LibGuiQt/cvfqtBasicAboutDialog.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfSystem.h" diff --git a/VisualizationModules/LibGuiQt/cvfqtBasicAboutDialog.h b/Fwk/VizFwk/LibGuiQt/cvfqtBasicAboutDialog.h similarity index 70% rename from VisualizationModules/LibGuiQt/cvfqtBasicAboutDialog.h rename to Fwk/VizFwk/LibGuiQt/cvfqtBasicAboutDialog.h index 993c803fcb..7e70e11789 100644 --- a/VisualizationModules/LibGuiQt/cvfqtBasicAboutDialog.h +++ b/Fwk/VizFwk/LibGuiQt/cvfqtBasicAboutDialog.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/VisualizationModules/LibGuiQt/cvfqtCvfBoundQGLContext.cpp b/Fwk/VizFwk/LibGuiQt/cvfqtCvfBoundQGLContext.cpp similarity index 67% rename from VisualizationModules/LibGuiQt/cvfqtCvfBoundQGLContext.cpp rename to Fwk/VizFwk/LibGuiQt/cvfqtCvfBoundQGLContext.cpp index 22e2772260..c3734d7af2 100644 --- a/VisualizationModules/LibGuiQt/cvfqtCvfBoundQGLContext.cpp +++ b/Fwk/VizFwk/LibGuiQt/cvfqtCvfBoundQGLContext.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfqtCvfBoundQGLContext.h" #include "cvfqtOpenGLContext.h" @@ -53,7 +71,7 @@ CvfBoundQGLContext::~CvfBoundQGLContext() { // TODO // Need to resolve the case where the Qt QGLcontext (that we're deriving from) is deleted - // and CeeViz is still holding a reference to one or more OpenGLContext objects + // and we are still holding a reference to one or more OpenGLContext objects // By the time we get here we expect that we're holding the only reference CVF_ASSERT(m_cvfGLContext->refCount() == 1); m_cvfGLContext = NULL; diff --git a/VisualizationModules/LibGuiQt/cvfqtCvfBoundQGLContext.h b/Fwk/VizFwk/LibGuiQt/cvfqtCvfBoundQGLContext.h similarity index 52% rename from VisualizationModules/LibGuiQt/cvfqtCvfBoundQGLContext.h rename to Fwk/VizFwk/LibGuiQt/cvfqtCvfBoundQGLContext.h index 3b3b58ffc8..5160f372fc 100644 --- a/VisualizationModules/LibGuiQt/cvfqtCvfBoundQGLContext.h +++ b/Fwk/VizFwk/LibGuiQt/cvfqtCvfBoundQGLContext.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfOpenGLContext.h" @@ -28,7 +46,7 @@ namespace cvfqt { //================================================================================================== // -// Utility class used to piggyback our CeeViz OpenGLContext onto Qt's QGLContext +// Utility class used to piggyback OpenGLContext onto Qt's QGLContext // //================================================================================================== class CvfBoundQGLContext : public QGLContext diff --git a/VisualizationModules/LibGuiQt/cvfqtMouseState.cpp b/Fwk/VizFwk/LibGuiQt/cvfqtMouseState.cpp similarity index 88% rename from VisualizationModules/LibGuiQt/cvfqtMouseState.cpp rename to Fwk/VizFwk/LibGuiQt/cvfqtMouseState.cpp index cef1636d7d..72a7d0bcda 100644 --- a/VisualizationModules/LibGuiQt/cvfqtMouseState.cpp +++ b/Fwk/VizFwk/LibGuiQt/cvfqtMouseState.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibGuiQt/cvfqtMouseState.h b/Fwk/VizFwk/LibGuiQt/cvfqtMouseState.h similarity index 71% rename from VisualizationModules/LibGuiQt/cvfqtMouseState.h rename to Fwk/VizFwk/LibGuiQt/cvfqtMouseState.h index 3b44897fa8..406c6909a0 100644 --- a/VisualizationModules/LibGuiQt/cvfqtMouseState.h +++ b/Fwk/VizFwk/LibGuiQt/cvfqtMouseState.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once class QMouseEvent; diff --git a/VisualizationModules/LibGuiQt/cvfqtOpenGLContext.cpp b/Fwk/VizFwk/LibGuiQt/cvfqtOpenGLContext.cpp similarity index 84% rename from VisualizationModules/LibGuiQt/cvfqtOpenGLContext.cpp rename to Fwk/VizFwk/LibGuiQt/cvfqtOpenGLContext.cpp index 264ed6cd6e..088aadc42c 100644 --- a/VisualizationModules/LibGuiQt/cvfqtOpenGLContext.cpp +++ b/Fwk/VizFwk/LibGuiQt/cvfqtOpenGLContext.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOpenGL.h" #include "cvfqtOpenGLContext.h" diff --git a/VisualizationModules/LibGuiQt/cvfqtOpenGLContext.h b/Fwk/VizFwk/LibGuiQt/cvfqtOpenGLContext.h similarity index 61% rename from VisualizationModules/LibGuiQt/cvfqtOpenGLContext.h rename to Fwk/VizFwk/LibGuiQt/cvfqtOpenGLContext.h index 4d957ec425..89dc0bc57b 100644 --- a/VisualizationModules/LibGuiQt/cvfqtOpenGLContext.h +++ b/Fwk/VizFwk/LibGuiQt/cvfqtOpenGLContext.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfOpenGLContext.h" diff --git a/VisualizationModules/LibGuiQt/cvfqtOpenGLWidget.cpp b/Fwk/VizFwk/LibGuiQt/cvfqtOpenGLWidget.cpp similarity index 82% rename from VisualizationModules/LibGuiQt/cvfqtOpenGLWidget.cpp rename to Fwk/VizFwk/LibGuiQt/cvfqtOpenGLWidget.cpp index 712517549e..fbfb54f65a 100644 --- a/VisualizationModules/LibGuiQt/cvfqtOpenGLWidget.cpp +++ b/Fwk/VizFwk/LibGuiQt/cvfqtOpenGLWidget.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOpenGLContextGroup.h" #include "cvfqtCvfBoundQGLContext.h" diff --git a/VisualizationModules/LibGuiQt/cvfqtOpenGLWidget.h b/Fwk/VizFwk/LibGuiQt/cvfqtOpenGLWidget.h similarity index 56% rename from VisualizationModules/LibGuiQt/cvfqtOpenGLWidget.h rename to Fwk/VizFwk/LibGuiQt/cvfqtOpenGLWidget.h index 905bbe4405..c598f9997d 100644 --- a/VisualizationModules/LibGuiQt/cvfqtOpenGLWidget.h +++ b/Fwk/VizFwk/LibGuiQt/cvfqtOpenGLWidget.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/VisualizationModules/LibGuiQt/cvfqtPerformanceInfoHud.cpp b/Fwk/VizFwk/LibGuiQt/cvfqtPerformanceInfoHud.cpp similarity index 89% rename from VisualizationModules/LibGuiQt/cvfqtPerformanceInfoHud.cpp rename to Fwk/VizFwk/LibGuiQt/cvfqtPerformanceInfoHud.cpp index b2393614f4..c3470c7a84 100644 --- a/VisualizationModules/LibGuiQt/cvfqtPerformanceInfoHud.cpp +++ b/Fwk/VizFwk/LibGuiQt/cvfqtPerformanceInfoHud.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfCamera.h" #include "cvfPerformanceInfo.h" diff --git a/VisualizationModules/LibGuiQt/cvfqtPerformanceInfoHud.h b/Fwk/VizFwk/LibGuiQt/cvfqtPerformanceInfoHud.h similarity index 58% rename from VisualizationModules/LibGuiQt/cvfqtPerformanceInfoHud.h rename to Fwk/VizFwk/LibGuiQt/cvfqtPerformanceInfoHud.h index 5dd3bd0894..457d0c0e27 100644 --- a/VisualizationModules/LibGuiQt/cvfqtPerformanceInfoHud.h +++ b/Fwk/VizFwk/LibGuiQt/cvfqtPerformanceInfoHud.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include diff --git a/Fwk/VizFwk/LibGuiQt/cvfqtUtils.cpp b/Fwk/VizFwk/LibGuiQt/cvfqtUtils.cpp new file mode 100644 index 0000000000..2ccf57d775 --- /dev/null +++ b/Fwk/VizFwk/LibGuiQt/cvfqtUtils.cpp @@ -0,0 +1,185 @@ +//################################################################################################## +// +// Custom Visualization Core library +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. +// +//################################################################################################## + + +#include "cvfBase.h" +#include "cvfTextureImage.h" + +#include "cvfqtUtils.h" + +#include + +namespace cvfqt { + + + +//================================================================================================== +/// +/// \class cvfqt::Utils +/// \ingroup GuiQt +/// +/// Static helper class for Qt interop +/// +//================================================================================================== + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString Utils::toQString(const cvf::String& ceeString) +{ + if (ceeString.isEmpty()) + { + return QString(); + } + + if (sizeof(wchar_t) == 2) + { + const unsigned short* strPtr = reinterpret_cast(ceeString.c_str()); + + return QString::fromUtf16(strPtr); + } + else if (sizeof(wchar_t) == 4) + { + const unsigned int* strPtr = reinterpret_cast(ceeString.c_str()); + + return QString::fromUcs4(strPtr); + } + + CVF_FAIL_MSG("Unexpected sizeof wchar_t"); + return QString(); +} + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::String Utils::fromQString(const QString& qtString) +{ + if (qtString.length() == 0) + { + return cvf::String(); + } + + if (sizeof(wchar_t) == 2) + { + const wchar_t* strPtr = reinterpret_cast(qtString.utf16()); + + return cvf::String(strPtr); + } + else if (sizeof(wchar_t) == 4) + { + QVector ucs4Str = qtString.toUcs4(); + ucs4Str.push_back(0); + const wchar_t* strPtr = reinterpret_cast(ucs4Str.data()); + + return cvf::String(strPtr); + } + + CVF_FAIL_MSG("Unexpected sizeof wchar_t"); + return cvf::String(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void Utils::copyFromQImage(cvf::TextureImage* textureImage, const QImage& qtImage) +{ + CVF_ASSERT(textureImage); + + if (qtImage.isNull()) + { + return; + } + + if (((int)textureImage->height()) != qtImage.height() || ((int)textureImage->width() != qtImage.width())) + { + textureImage->allocate(qtImage.width(), qtImage.height()); + } + + int height = textureImage->height(); + int width = textureImage->width(); + + // Check if QImage has format QImage::Format_ARGB32, and perform a direct memory copy of image data + if (qtImage.format() == QImage::Format_ARGB32) + { + cvf::ubyte* dataPtr = const_cast(textureImage->ptr()); + + int negy = 0; + uint idx = 0; + QRgb qtRgbaVal = 0; + + // This loop is a candidate for multi-threading. Testing with OpenMP has so far indicated + // quite large variance in performance (Windows Intel i7 with 8 cores). + // When this function is called from the paint event, + // the user experience is considered better when the paint time is consistent. + for (int y = 0 ; y < height; ++y) + { + negy = height - 1 - y; + const uchar* s = qtImage.scanLine(negy); + + for (int x = 0 ; x < width; ++x) + { + qtRgbaVal = ((QRgb*)s)[x]; // Taken from QImage::pixel(int x, int y) + + idx = 4*(y*width + x); + dataPtr[idx] = qRed(qtRgbaVal); + dataPtr[idx + 1] = qGreen(qtRgbaVal); + dataPtr[idx + 2] = qBlue(qtRgbaVal); + dataPtr[idx + 3] = qAlpha(qtRgbaVal); + } + } + } + else + { + for (int y = 0 ; y < height; ++y) + { + int negy = height - 1 - y; + QRgb qtRgbaVal; + cvf::Color4ub cvfRgbVal; + for (int x = 0 ; x < width; ++x) + { + qtRgbaVal = qtImage.pixel(x, negy); + cvfRgbVal.set(qRed(qtRgbaVal), qGreen(qtRgbaVal), qBlue(qtRgbaVal), qAlpha(qtRgbaVal)); + textureImage->setPixel(x, y, cvfRgbVal); + } + } + } +} + + +} // namespace cvfqt + + diff --git a/Fwk/VizFwk/LibGuiQt/cvfqtUtils.h b/Fwk/VizFwk/LibGuiQt/cvfqtUtils.h new file mode 100644 index 0000000000..1e0f2bca48 --- /dev/null +++ b/Fwk/VizFwk/LibGuiQt/cvfqtUtils.h @@ -0,0 +1,66 @@ +//################################################################################################## +// +// Custom Visualization Core library +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. +// +//################################################################################################## + + +#pragma once + +#include "cvfString.h" + +#include +#include + +namespace cvf { + class TextureImage; +} + +namespace cvfqt { + + +//================================================================================================== +// +// Static helper class for Qt interop +// +//================================================================================================== +class Utils +{ +public: + static QString toQString(const cvf::String& ceeString); + static cvf::String fromQString(const QString& qtString); + + static void copyFromQImage(cvf::TextureImage* textureImage, const QImage& qtImage); +}; + +} diff --git a/VisualizationModules/LibRender/CMakeLists.txt b/Fwk/VizFwk/LibRender/CMakeLists.txt similarity index 100% rename from VisualizationModules/LibRender/CMakeLists.txt rename to Fwk/VizFwk/LibRender/CMakeLists.txt diff --git a/VisualizationModules/LibRender/cvfBufferObjectManaged.cpp b/Fwk/VizFwk/LibRender/cvfBufferObjectManaged.cpp similarity index 85% rename from VisualizationModules/LibRender/cvfBufferObjectManaged.cpp rename to Fwk/VizFwk/LibRender/cvfBufferObjectManaged.cpp index 1308604fce..2eee81a0ed 100644 --- a/VisualizationModules/LibRender/cvfBufferObjectManaged.cpp +++ b/Fwk/VizFwk/LibRender/cvfBufferObjectManaged.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfBufferObjectManaged.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfBufferObjectManaged.h b/Fwk/VizFwk/LibRender/cvfBufferObjectManaged.h similarity index 64% rename from VisualizationModules/LibRender/cvfBufferObjectManaged.h rename to Fwk/VizFwk/LibRender/cvfBufferObjectManaged.h index 77c407b2c9..3fb22fdca0 100644 --- a/VisualizationModules/LibRender/cvfBufferObjectManaged.h +++ b/Fwk/VizFwk/LibRender/cvfBufferObjectManaged.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfCamera.cpp b/Fwk/VizFwk/LibRender/cvfCamera.cpp similarity index 97% rename from VisualizationModules/LibRender/cvfCamera.cpp rename to Fwk/VizFwk/LibRender/cvfCamera.cpp index ebc9f98323..f90ed87021 100644 --- a/VisualizationModules/LibRender/cvfCamera.cpp +++ b/Fwk/VizFwk/LibRender/cvfCamera.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfCamera.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfCamera.h b/Fwk/VizFwk/LibRender/cvfCamera.h similarity index 83% rename from VisualizationModules/LibRender/cvfCamera.h rename to Fwk/VizFwk/LibRender/cvfCamera.h index 58899da671..7a1d14d45f 100644 --- a/VisualizationModules/LibRender/cvfCamera.h +++ b/Fwk/VizFwk/LibRender/cvfCamera.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfCameraAnimation.cpp b/Fwk/VizFwk/LibRender/cvfCameraAnimation.cpp similarity index 76% rename from VisualizationModules/LibRender/cvfCameraAnimation.cpp rename to Fwk/VizFwk/LibRender/cvfCameraAnimation.cpp index f72739d765..fb6d4d6523 100644 --- a/VisualizationModules/LibRender/cvfCameraAnimation.cpp +++ b/Fwk/VizFwk/LibRender/cvfCameraAnimation.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfCameraAnimation.h" #include "cvfCamera.h" diff --git a/VisualizationModules/LibRender/cvfCameraAnimation.h b/Fwk/VizFwk/LibRender/cvfCameraAnimation.h similarity index 59% rename from VisualizationModules/LibRender/cvfCameraAnimation.h rename to Fwk/VizFwk/LibRender/cvfCameraAnimation.h index bbd5a50270..dcb23ed550 100644 --- a/VisualizationModules/LibRender/cvfCameraAnimation.h +++ b/Fwk/VizFwk/LibRender/cvfCameraAnimation.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfDrawable.cpp b/Fwk/VizFwk/LibRender/cvfDrawable.cpp similarity index 72% rename from VisualizationModules/LibRender/cvfDrawable.cpp rename to Fwk/VizFwk/LibRender/cvfDrawable.cpp index d4f5cb5f9e..9b58849b8c 100644 --- a/VisualizationModules/LibRender/cvfDrawable.cpp +++ b/Fwk/VizFwk/LibRender/cvfDrawable.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfDrawable.h" diff --git a/VisualizationModules/LibRender/cvfDrawable.h b/Fwk/VizFwk/LibRender/cvfDrawable.h similarity index 65% rename from VisualizationModules/LibRender/cvfDrawable.h rename to Fwk/VizFwk/LibRender/cvfDrawable.h index bed46a1ca4..f9de092fc8 100644 --- a/VisualizationModules/LibRender/cvfDrawable.h +++ b/Fwk/VizFwk/LibRender/cvfDrawable.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfDrawableGeo.cpp b/Fwk/VizFwk/LibRender/cvfDrawableGeo.cpp similarity index 97% rename from VisualizationModules/LibRender/cvfDrawableGeo.cpp rename to Fwk/VizFwk/LibRender/cvfDrawableGeo.cpp index 28ee7bba9c..4804e28329 100644 --- a/VisualizationModules/LibRender/cvfDrawableGeo.cpp +++ b/Fwk/VizFwk/LibRender/cvfDrawableGeo.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfDrawableGeo.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfDrawableGeo.h b/Fwk/VizFwk/LibRender/cvfDrawableGeo.h similarity index 82% rename from VisualizationModules/LibRender/cvfDrawableGeo.h rename to Fwk/VizFwk/LibRender/cvfDrawableGeo.h index 0ea57b4103..9a640c5943 100644 --- a/VisualizationModules/LibRender/cvfDrawableGeo.h +++ b/Fwk/VizFwk/LibRender/cvfDrawableGeo.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfDrawable.h" diff --git a/VisualizationModules/LibRender/cvfDrawableText.cpp b/Fwk/VizFwk/LibRender/cvfDrawableText.cpp similarity index 93% rename from VisualizationModules/LibRender/cvfDrawableText.cpp rename to Fwk/VizFwk/LibRender/cvfDrawableText.cpp index 11ac32b535..a00ab3f356 100644 --- a/VisualizationModules/LibRender/cvfDrawableText.cpp +++ b/Fwk/VizFwk/LibRender/cvfDrawableText.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfDrawableText.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfDrawableText.h b/Fwk/VizFwk/LibRender/cvfDrawableText.h similarity index 80% rename from VisualizationModules/LibRender/cvfDrawableText.h rename to Fwk/VizFwk/LibRender/cvfDrawableText.h index f9a6bdacfc..beb75a568f 100644 --- a/VisualizationModules/LibRender/cvfDrawableText.h +++ b/Fwk/VizFwk/LibRender/cvfDrawableText.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfDrawable.h" diff --git a/VisualizationModules/LibRender/cvfDrawableVectors.cpp b/Fwk/VizFwk/LibRender/cvfDrawableVectors.cpp similarity index 94% rename from VisualizationModules/LibRender/cvfDrawableVectors.cpp rename to Fwk/VizFwk/LibRender/cvfDrawableVectors.cpp index 47264ebb19..d07c79291d 100644 --- a/VisualizationModules/LibRender/cvfDrawableVectors.cpp +++ b/Fwk/VizFwk/LibRender/cvfDrawableVectors.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfDrawableVectors.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfDrawableVectors.h b/Fwk/VizFwk/LibRender/cvfDrawableVectors.h similarity index 77% rename from VisualizationModules/LibRender/cvfDrawableVectors.h rename to Fwk/VizFwk/LibRender/cvfDrawableVectors.h index 147b81ef07..18798b1fce 100644 --- a/VisualizationModules/LibRender/cvfDrawableVectors.h +++ b/Fwk/VizFwk/LibRender/cvfDrawableVectors.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfDrawable.h" diff --git a/VisualizationModules/LibRender/cvfFixedAtlasFont.cpp b/Fwk/VizFwk/LibRender/cvfFixedAtlasFont.cpp similarity index 99% rename from VisualizationModules/LibRender/cvfFixedAtlasFont.cpp rename to Fwk/VizFwk/LibRender/cvfFixedAtlasFont.cpp index a47d1f35e5..99a9b50a02 100644 --- a/VisualizationModules/LibRender/cvfFixedAtlasFont.cpp +++ b/Fwk/VizFwk/LibRender/cvfFixedAtlasFont.cpp @@ -1,12 +1,40 @@ //################################################################################################## // -// CeeVizFramework -// Lib: LibRender -// -// -------------------------------------------------------------------------------------------- -// Please see references below for copyright, usage rights and license for this file. +// Custom Visualization Core library +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. +// //################################################################################################## + #include "cvfBase.h" #include "cvfFixedAtlasFont.h" #include "cvfTextureImage.h" diff --git a/VisualizationModules/LibRender/cvfFixedAtlasFont.h b/Fwk/VizFwk/LibRender/cvfFixedAtlasFont.h similarity index 69% rename from VisualizationModules/LibRender/cvfFixedAtlasFont.h rename to Fwk/VizFwk/LibRender/cvfFixedAtlasFont.h index d657899629..6e5897a4ce 100644 --- a/VisualizationModules/LibRender/cvfFixedAtlasFont.h +++ b/Fwk/VizFwk/LibRender/cvfFixedAtlasFont.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfFont.cpp b/Fwk/VizFwk/LibRender/cvfFont.cpp similarity index 81% rename from VisualizationModules/LibRender/cvfFont.cpp rename to Fwk/VizFwk/LibRender/cvfFont.cpp index 948afd181e..b72f19fb79 100644 --- a/VisualizationModules/LibRender/cvfFont.cpp +++ b/Fwk/VizFwk/LibRender/cvfFont.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfFont.h" #include "cvfGlyph.h" diff --git a/VisualizationModules/LibRender/cvfFont.h b/Fwk/VizFwk/LibRender/cvfFont.h similarity index 58% rename from VisualizationModules/LibRender/cvfFont.h rename to Fwk/VizFwk/LibRender/cvfFont.h index f79346cfb2..5943996c5b 100644 --- a/VisualizationModules/LibRender/cvfFont.h +++ b/Fwk/VizFwk/LibRender/cvfFont.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfFontManager.cpp b/Fwk/VizFwk/LibRender/cvfFontManager.cpp similarity index 73% rename from VisualizationModules/LibRender/cvfFontManager.cpp rename to Fwk/VizFwk/LibRender/cvfFontManager.cpp index aeff279109..99b91476c3 100644 --- a/VisualizationModules/LibRender/cvfFontManager.cpp +++ b/Fwk/VizFwk/LibRender/cvfFontManager.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfFontManager.h" diff --git a/VisualizationModules/LibRender/cvfFontManager.h b/Fwk/VizFwk/LibRender/cvfFontManager.h similarity index 58% rename from VisualizationModules/LibRender/cvfFontManager.h rename to Fwk/VizFwk/LibRender/cvfFontManager.h index 343a1f04a0..33de4a9498 100644 --- a/VisualizationModules/LibRender/cvfFontManager.h +++ b/Fwk/VizFwk/LibRender/cvfFontManager.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfFramebufferObject.cpp b/Fwk/VizFwk/LibRender/cvfFramebufferObject.cpp similarity index 95% rename from VisualizationModules/LibRender/cvfFramebufferObject.cpp rename to Fwk/VizFwk/LibRender/cvfFramebufferObject.cpp index 8dd83b6c69..3196999ff2 100644 --- a/VisualizationModules/LibRender/cvfFramebufferObject.cpp +++ b/Fwk/VizFwk/LibRender/cvfFramebufferObject.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfFramebufferObject.h" #include "cvfRenderbufferObject.h" diff --git a/VisualizationModules/LibRender/cvfFramebufferObject.h b/Fwk/VizFwk/LibRender/cvfFramebufferObject.h similarity index 74% rename from VisualizationModules/LibRender/cvfFramebufferObject.h rename to Fwk/VizFwk/LibRender/cvfFramebufferObject.h index 3175c15931..03e0147d8e 100644 --- a/VisualizationModules/LibRender/cvfFramebufferObject.h +++ b/Fwk/VizFwk/LibRender/cvfFramebufferObject.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfGeometryBuilderDrawableGeo.cpp b/Fwk/VizFwk/LibRender/cvfGeometryBuilderDrawableGeo.cpp similarity index 83% rename from VisualizationModules/LibRender/cvfGeometryBuilderDrawableGeo.cpp rename to Fwk/VizFwk/LibRender/cvfGeometryBuilderDrawableGeo.cpp index bc1f9d40ec..750b7e43b4 100644 --- a/VisualizationModules/LibRender/cvfGeometryBuilderDrawableGeo.cpp +++ b/Fwk/VizFwk/LibRender/cvfGeometryBuilderDrawableGeo.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfGeometryBuilderDrawableGeo.h" diff --git a/VisualizationModules/LibRender/cvfGeometryBuilderDrawableGeo.h b/Fwk/VizFwk/LibRender/cvfGeometryBuilderDrawableGeo.h similarity index 62% rename from VisualizationModules/LibRender/cvfGeometryBuilderDrawableGeo.h rename to Fwk/VizFwk/LibRender/cvfGeometryBuilderDrawableGeo.h index 301be7bc20..b5ebd42022 100644 --- a/VisualizationModules/LibRender/cvfGeometryBuilderDrawableGeo.h +++ b/Fwk/VizFwk/LibRender/cvfGeometryBuilderDrawableGeo.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfGeometryBuilder.h" diff --git a/VisualizationModules/LibRender/cvfGlyph.cpp b/Fwk/VizFwk/LibRender/cvfGlyph.cpp similarity index 91% rename from VisualizationModules/LibRender/cvfGlyph.cpp rename to Fwk/VizFwk/LibRender/cvfGlyph.cpp index f4d8edc016..ffe0a9f696 100644 --- a/VisualizationModules/LibRender/cvfGlyph.cpp +++ b/Fwk/VizFwk/LibRender/cvfGlyph.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOpenGL.h" #include "cvfGlyph.h" @@ -329,11 +347,10 @@ void Glyph::setupAndBindTexture(OpenGLContext* oglContext, bool software) texture->setWrapMode(Texture2D_FF::CLAMP); texture->setMinFilter(Texture2D_FF::NEAREST); texture->setMagFilter(Texture2D_FF::NEAREST); - texture->setupTexture(oglContext); - texture->setupTextureParams(oglContext); ref textureMapping = new RenderStateTextureMapping_FF(texture.p()); textureMapping->setTextureFunction(RenderStateTextureMapping_FF::MODULATE); + textureMapping->setupTexture(oglContext); m_textureBindings = textureMapping; #endif @@ -346,7 +363,6 @@ void Glyph::setupAndBindTexture(OpenGLContext* oglContext, bool software) sampler->setMagFilter(Sampler::NEAREST); ref texture = new Texture(m_textureImage.p()); - texture->setupTexture(oglContext); RenderStateTextureBindings* textureBindings = new RenderStateTextureBindings(texture.p(), sampler.p(), "dummy"); textureBindings->setupTextures(oglContext); diff --git a/VisualizationModules/LibRender/cvfGlyph.h b/Fwk/VizFwk/LibRender/cvfGlyph.h similarity index 75% rename from VisualizationModules/LibRender/cvfGlyph.h rename to Fwk/VizFwk/LibRender/cvfGlyph.h index eda75000fa..3356098ed5 100644 --- a/VisualizationModules/LibRender/cvfGlyph.h +++ b/Fwk/VizFwk/LibRender/cvfGlyph.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfHitDetail.cpp b/Fwk/VizFwk/LibRender/cvfHitDetail.cpp similarity index 58% rename from VisualizationModules/LibRender/cvfHitDetail.cpp rename to Fwk/VizFwk/LibRender/cvfHitDetail.cpp index 4399292198..8cf8d78f45 100644 --- a/VisualizationModules/LibRender/cvfHitDetail.cpp +++ b/Fwk/VizFwk/LibRender/cvfHitDetail.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfHitDetail.h" diff --git a/VisualizationModules/LibRender/cvfHitDetail.h b/Fwk/VizFwk/LibRender/cvfHitDetail.h similarity index 50% rename from VisualizationModules/LibRender/cvfHitDetail.h rename to Fwk/VizFwk/LibRender/cvfHitDetail.h index ae00a92747..53354ac705 100644 --- a/VisualizationModules/LibRender/cvfHitDetail.h +++ b/Fwk/VizFwk/LibRender/cvfHitDetail.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfLibRender.h b/Fwk/VizFwk/LibRender/cvfLibRender.h similarity index 73% rename from VisualizationModules/LibRender/cvfLibRender.h rename to Fwk/VizFwk/LibRender/cvfLibRender.h index f9c2573d3b..4b46fbcd0b 100644 --- a/VisualizationModules/LibRender/cvfLibRender.h +++ b/Fwk/VizFwk/LibRender/cvfLibRender.h @@ -1,24 +1,42 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + // Doxygen module definition -/// \ingroup CeeVizFramework +/// \ingroup VizFramework /// @{ /// \defgroup Render Render module /// @} diff --git a/VisualizationModules/LibRender/cvfMatrixState.cpp b/Fwk/VizFwk/LibRender/cvfMatrixState.cpp similarity index 90% rename from VisualizationModules/LibRender/cvfMatrixState.cpp rename to Fwk/VizFwk/LibRender/cvfMatrixState.cpp index 65edddc254..311e5077f3 100644 --- a/VisualizationModules/LibRender/cvfMatrixState.cpp +++ b/Fwk/VizFwk/LibRender/cvfMatrixState.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfMatrixState.h" #include "cvfCamera.h" diff --git a/VisualizationModules/LibRender/cvfMatrixState.h b/Fwk/VizFwk/LibRender/cvfMatrixState.h similarity index 74% rename from VisualizationModules/LibRender/cvfMatrixState.h rename to Fwk/VizFwk/LibRender/cvfMatrixState.h index f7caa6a368..aae955ed54 100644 --- a/VisualizationModules/LibRender/cvfMatrixState.h +++ b/Fwk/VizFwk/LibRender/cvfMatrixState.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfMatrix4.h" diff --git a/VisualizationModules/LibRender/cvfOglRc.cpp b/Fwk/VizFwk/LibRender/cvfOglRc.cpp similarity index 89% rename from VisualizationModules/LibRender/cvfOglRc.cpp rename to Fwk/VizFwk/LibRender/cvfOglRc.cpp index dae7c57e87..b9d5aacab2 100644 --- a/VisualizationModules/LibRender/cvfOglRc.cpp +++ b/Fwk/VizFwk/LibRender/cvfOglRc.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOglRc.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfOglRc.h b/Fwk/VizFwk/LibRender/cvfOglRc.h similarity index 76% rename from VisualizationModules/LibRender/cvfOglRc.h rename to Fwk/VizFwk/LibRender/cvfOglRc.h index 7e0e844bf8..dee85737d4 100644 --- a/VisualizationModules/LibRender/cvfOglRc.h +++ b/Fwk/VizFwk/LibRender/cvfOglRc.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfOpenGL.cpp b/Fwk/VizFwk/LibRender/cvfOpenGL.cpp similarity index 85% rename from VisualizationModules/LibRender/cvfOpenGL.cpp rename to Fwk/VizFwk/LibRender/cvfOpenGL.cpp index b021de0ae9..0e535170c0 100644 --- a/VisualizationModules/LibRender/cvfOpenGL.cpp +++ b/Fwk/VizFwk/LibRender/cvfOpenGL.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOpenGL.h" #include "cvfSystem.h" diff --git a/VisualizationModules/LibRender/cvfOpenGL.h b/Fwk/VizFwk/LibRender/cvfOpenGL.h similarity index 80% rename from VisualizationModules/LibRender/cvfOpenGL.h rename to Fwk/VizFwk/LibRender/cvfOpenGL.h index a5e09d3542..00c50c02b8 100644 --- a/VisualizationModules/LibRender/cvfOpenGL.h +++ b/Fwk/VizFwk/LibRender/cvfOpenGL.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once diff --git a/VisualizationModules/LibRender/cvfOpenGLCapabilities.cpp b/Fwk/VizFwk/LibRender/cvfOpenGLCapabilities.cpp similarity index 84% rename from VisualizationModules/LibRender/cvfOpenGLCapabilities.cpp rename to Fwk/VizFwk/LibRender/cvfOpenGLCapabilities.cpp index b8eb0f2a39..6a31eaca27 100644 --- a/VisualizationModules/LibRender/cvfOpenGLCapabilities.cpp +++ b/Fwk/VizFwk/LibRender/cvfOpenGLCapabilities.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOpenGLCapabilities.h" diff --git a/VisualizationModules/LibRender/cvfOpenGLCapabilities.h b/Fwk/VizFwk/LibRender/cvfOpenGLCapabilities.h similarity index 71% rename from VisualizationModules/LibRender/cvfOpenGLCapabilities.h rename to Fwk/VizFwk/LibRender/cvfOpenGLCapabilities.h index 3f6162e0f1..3f97f97813 100644 --- a/VisualizationModules/LibRender/cvfOpenGLCapabilities.h +++ b/Fwk/VizFwk/LibRender/cvfOpenGLCapabilities.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfOpenGLContext.cpp b/Fwk/VizFwk/LibRender/cvfOpenGLContext.cpp similarity index 85% rename from VisualizationModules/LibRender/cvfOpenGLContext.cpp rename to Fwk/VizFwk/LibRender/cvfOpenGLContext.cpp index 1cf16efb1f..f993313996 100644 --- a/VisualizationModules/LibRender/cvfOpenGLContext.cpp +++ b/Fwk/VizFwk/LibRender/cvfOpenGLContext.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOpenGLContext.h" #include "cvfOpenGLResourceManager.h" diff --git a/VisualizationModules/LibRender/cvfOpenGLContext.h b/Fwk/VizFwk/LibRender/cvfOpenGLContext.h similarity index 66% rename from VisualizationModules/LibRender/cvfOpenGLContext.h rename to Fwk/VizFwk/LibRender/cvfOpenGLContext.h index 6cc2d70c93..254a656c60 100644 --- a/VisualizationModules/LibRender/cvfOpenGLContext.h +++ b/Fwk/VizFwk/LibRender/cvfOpenGLContext.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfOpenGLContextGroup.cpp b/Fwk/VizFwk/LibRender/cvfOpenGLContextGroup.cpp similarity index 93% rename from VisualizationModules/LibRender/cvfOpenGLContextGroup.cpp rename to Fwk/VizFwk/LibRender/cvfOpenGLContextGroup.cpp index a7b9ca2cec..b85c592025 100644 --- a/VisualizationModules/LibRender/cvfOpenGLContextGroup.cpp +++ b/Fwk/VizFwk/LibRender/cvfOpenGLContextGroup.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOpenGLContextGroup.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfOpenGLContextGroup.h b/Fwk/VizFwk/LibRender/cvfOpenGLContextGroup.h similarity index 72% rename from VisualizationModules/LibRender/cvfOpenGLContextGroup.h rename to Fwk/VizFwk/LibRender/cvfOpenGLContextGroup.h index 8fd274288a..82268b4ca2 100644 --- a/VisualizationModules/LibRender/cvfOpenGLContextGroup.h +++ b/Fwk/VizFwk/LibRender/cvfOpenGLContextGroup.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfOpenGLResourceManager.cpp b/Fwk/VizFwk/LibRender/cvfOpenGLResourceManager.cpp similarity index 95% rename from VisualizationModules/LibRender/cvfOpenGLResourceManager.cpp rename to Fwk/VizFwk/LibRender/cvfOpenGLResourceManager.cpp index 471eb63f1f..3d1c03346d 100644 --- a/VisualizationModules/LibRender/cvfOpenGLResourceManager.cpp +++ b/Fwk/VizFwk/LibRender/cvfOpenGLResourceManager.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfTrace.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfOpenGLResourceManager.h b/Fwk/VizFwk/LibRender/cvfOpenGLResourceManager.h similarity index 80% rename from VisualizationModules/LibRender/cvfOpenGLResourceManager.h rename to Fwk/VizFwk/LibRender/cvfOpenGLResourceManager.h index a51466b24f..62a4958aa9 100644 --- a/VisualizationModules/LibRender/cvfOpenGLResourceManager.h +++ b/Fwk/VizFwk/LibRender/cvfOpenGLResourceManager.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfOpenGLTypes.h b/Fwk/VizFwk/LibRender/cvfOpenGLTypes.h similarity index 63% rename from VisualizationModules/LibRender/cvfOpenGLTypes.h rename to Fwk/VizFwk/LibRender/cvfOpenGLTypes.h index f29c846a62..3cd3a2d898 100644 --- a/VisualizationModules/LibRender/cvfOpenGLTypes.h +++ b/Fwk/VizFwk/LibRender/cvfOpenGLTypes.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace cvf { diff --git a/VisualizationModules/LibRender/cvfOverlayAxisCross.cpp b/Fwk/VizFwk/LibRender/cvfOverlayAxisCross.cpp similarity index 92% rename from VisualizationModules/LibRender/cvfOverlayAxisCross.cpp rename to Fwk/VizFwk/LibRender/cvfOverlayAxisCross.cpp index 29aca5ac4f..209c02c162 100644 --- a/VisualizationModules/LibRender/cvfOverlayAxisCross.cpp +++ b/Fwk/VizFwk/LibRender/cvfOverlayAxisCross.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOverlayAxisCross.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfOverlayAxisCross.h b/Fwk/VizFwk/LibRender/cvfOverlayAxisCross.h similarity index 72% rename from VisualizationModules/LibRender/cvfOverlayAxisCross.h rename to Fwk/VizFwk/LibRender/cvfOverlayAxisCross.h index a48eb08c8b..0dc8bb5524 100644 --- a/VisualizationModules/LibRender/cvfOverlayAxisCross.h +++ b/Fwk/VizFwk/LibRender/cvfOverlayAxisCross.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfOverlayItem.h" diff --git a/VisualizationModules/LibRender/cvfOverlayColorLegend.cpp b/Fwk/VizFwk/LibRender/cvfOverlayColorLegend.cpp similarity index 95% rename from VisualizationModules/LibRender/cvfOverlayColorLegend.cpp rename to Fwk/VizFwk/LibRender/cvfOverlayColorLegend.cpp index 8359f33a11..715b16c405 100644 --- a/VisualizationModules/LibRender/cvfOverlayColorLegend.cpp +++ b/Fwk/VizFwk/LibRender/cvfOverlayColorLegend.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOverlayColorLegend.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfOverlayColorLegend.h b/Fwk/VizFwk/LibRender/cvfOverlayColorLegend.h similarity index 79% rename from VisualizationModules/LibRender/cvfOverlayColorLegend.h rename to Fwk/VizFwk/LibRender/cvfOverlayColorLegend.h index f4188d3de6..6bccec27d3 100644 --- a/VisualizationModules/LibRender/cvfOverlayColorLegend.h +++ b/Fwk/VizFwk/LibRender/cvfOverlayColorLegend.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfOverlayItem.h" diff --git a/VisualizationModules/LibRender/cvfOverlayImage.cpp b/Fwk/VizFwk/LibRender/cvfOverlayImage.cpp similarity index 92% rename from VisualizationModules/LibRender/cvfOverlayImage.cpp rename to Fwk/VizFwk/LibRender/cvfOverlayImage.cpp index ce7fc16063..dd1a09311c 100644 --- a/VisualizationModules/LibRender/cvfOverlayImage.cpp +++ b/Fwk/VizFwk/LibRender/cvfOverlayImage.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOverlayImage.h" #include "cvfMatrixState.h" diff --git a/VisualizationModules/LibRender/cvfOverlayImage.h b/Fwk/VizFwk/LibRender/cvfOverlayImage.h similarity index 70% rename from VisualizationModules/LibRender/cvfOverlayImage.h rename to Fwk/VizFwk/LibRender/cvfOverlayImage.h index 421a84edb1..5e5508df2b 100644 --- a/VisualizationModules/LibRender/cvfOverlayImage.h +++ b/Fwk/VizFwk/LibRender/cvfOverlayImage.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfOverlayItem.h" diff --git a/VisualizationModules/LibRender/cvfOverlayItem.cpp b/Fwk/VizFwk/LibRender/cvfOverlayItem.cpp similarity index 64% rename from VisualizationModules/LibRender/cvfOverlayItem.cpp rename to Fwk/VizFwk/LibRender/cvfOverlayItem.cpp index 129f6eec8b..e8e4f6fbf6 100644 --- a/VisualizationModules/LibRender/cvfOverlayItem.cpp +++ b/Fwk/VizFwk/LibRender/cvfOverlayItem.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOverlayTextBox.h" #include "cvfDrawableText.h" diff --git a/VisualizationModules/LibRender/cvfOverlayItem.h b/Fwk/VizFwk/LibRender/cvfOverlayItem.h similarity index 65% rename from VisualizationModules/LibRender/cvfOverlayItem.h rename to Fwk/VizFwk/LibRender/cvfOverlayItem.h index a419c93015..910433a20c 100644 --- a/VisualizationModules/LibRender/cvfOverlayItem.h +++ b/Fwk/VizFwk/LibRender/cvfOverlayItem.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfOverlayNavigationCube.cpp b/Fwk/VizFwk/LibRender/cvfOverlayNavigationCube.cpp similarity index 98% rename from VisualizationModules/LibRender/cvfOverlayNavigationCube.cpp rename to Fwk/VizFwk/LibRender/cvfOverlayNavigationCube.cpp index 6caa550c3e..58f1f8170b 100644 --- a/VisualizationModules/LibRender/cvfOverlayNavigationCube.cpp +++ b/Fwk/VizFwk/LibRender/cvfOverlayNavigationCube.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOverlayNavigationCube.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfOverlayNavigationCube.h b/Fwk/VizFwk/LibRender/cvfOverlayNavigationCube.h similarity index 88% rename from VisualizationModules/LibRender/cvfOverlayNavigationCube.h rename to Fwk/VizFwk/LibRender/cvfOverlayNavigationCube.h index 1a5750f47d..674a35bd46 100644 --- a/VisualizationModules/LibRender/cvfOverlayNavigationCube.h +++ b/Fwk/VizFwk/LibRender/cvfOverlayNavigationCube.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfOverlayItem.h" diff --git a/VisualizationModules/LibRender/cvfOverlayScalarMapperLegend.cpp b/Fwk/VizFwk/LibRender/cvfOverlayScalarMapperLegend.cpp similarity index 96% rename from VisualizationModules/LibRender/cvfOverlayScalarMapperLegend.cpp rename to Fwk/VizFwk/LibRender/cvfOverlayScalarMapperLegend.cpp index 9e56d64a00..6d24a75628 100644 --- a/VisualizationModules/LibRender/cvfOverlayScalarMapperLegend.cpp +++ b/Fwk/VizFwk/LibRender/cvfOverlayScalarMapperLegend.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOverlayScalarMapperLegend.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfOverlayScalarMapperLegend.h b/Fwk/VizFwk/LibRender/cvfOverlayScalarMapperLegend.h similarity index 79% rename from VisualizationModules/LibRender/cvfOverlayScalarMapperLegend.h rename to Fwk/VizFwk/LibRender/cvfOverlayScalarMapperLegend.h index 30a045622a..ac2be99352 100644 --- a/VisualizationModules/LibRender/cvfOverlayScalarMapperLegend.h +++ b/Fwk/VizFwk/LibRender/cvfOverlayScalarMapperLegend.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfOverlayItem.h" diff --git a/VisualizationModules/LibRender/cvfOverlayTextBox.cpp b/Fwk/VizFwk/LibRender/cvfOverlayTextBox.cpp similarity index 93% rename from VisualizationModules/LibRender/cvfOverlayTextBox.cpp rename to Fwk/VizFwk/LibRender/cvfOverlayTextBox.cpp index c436320f2a..e7f452216b 100644 --- a/VisualizationModules/LibRender/cvfOverlayTextBox.cpp +++ b/Fwk/VizFwk/LibRender/cvfOverlayTextBox.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOverlayTextBox.h" #include "cvfDrawableText.h" diff --git a/VisualizationModules/LibRender/cvfOverlayTextBox.h b/Fwk/VizFwk/LibRender/cvfOverlayTextBox.h similarity index 72% rename from VisualizationModules/LibRender/cvfOverlayTextBox.h rename to Fwk/VizFwk/LibRender/cvfOverlayTextBox.h index 61725f7d30..08529566fe 100644 --- a/VisualizationModules/LibRender/cvfOverlayTextBox.h +++ b/Fwk/VizFwk/LibRender/cvfOverlayTextBox.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfOverlayItem.h" diff --git a/VisualizationModules/LibRender/cvfPrimitiveSet.cpp b/Fwk/VizFwk/LibRender/cvfPrimitiveSet.cpp similarity index 85% rename from VisualizationModules/LibRender/cvfPrimitiveSet.cpp rename to Fwk/VizFwk/LibRender/cvfPrimitiveSet.cpp index 9580597267..d38b2beb09 100644 --- a/VisualizationModules/LibRender/cvfPrimitiveSet.cpp +++ b/Fwk/VizFwk/LibRender/cvfPrimitiveSet.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfAssert.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibRender/cvfPrimitiveSet.h b/Fwk/VizFwk/LibRender/cvfPrimitiveSet.h similarity index 63% rename from VisualizationModules/LibRender/cvfPrimitiveSet.h rename to Fwk/VizFwk/LibRender/cvfPrimitiveSet.h index f3a9d1650f..9df2c752f0 100644 --- a/VisualizationModules/LibRender/cvfPrimitiveSet.h +++ b/Fwk/VizFwk/LibRender/cvfPrimitiveSet.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfPrimitiveSetDirect.cpp b/Fwk/VizFwk/LibRender/cvfPrimitiveSetDirect.cpp similarity index 78% rename from VisualizationModules/LibRender/cvfPrimitiveSetDirect.cpp rename to Fwk/VizFwk/LibRender/cvfPrimitiveSetDirect.cpp index 87eea32afa..f24c9556aa 100644 --- a/VisualizationModules/LibRender/cvfPrimitiveSetDirect.cpp +++ b/Fwk/VizFwk/LibRender/cvfPrimitiveSetDirect.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfAssert.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibRender/cvfPrimitiveSetDirect.h b/Fwk/VizFwk/LibRender/cvfPrimitiveSetDirect.h similarity index 59% rename from VisualizationModules/LibRender/cvfPrimitiveSetDirect.h rename to Fwk/VizFwk/LibRender/cvfPrimitiveSetDirect.h index 8c92d0d7af..f459e4ed66 100644 --- a/VisualizationModules/LibRender/cvfPrimitiveSetDirect.h +++ b/Fwk/VizFwk/LibRender/cvfPrimitiveSetDirect.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfPrimitiveSet.h" diff --git a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUInt.cpp b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUInt.cpp similarity index 87% rename from VisualizationModules/LibRender/cvfPrimitiveSetIndexedUInt.cpp rename to Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUInt.cpp index 4fef0bed47..223172aa5e 100644 --- a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUInt.cpp +++ b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUInt.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfAssert.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUInt.h b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUInt.h similarity index 63% rename from VisualizationModules/LibRender/cvfPrimitiveSetIndexedUInt.h rename to Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUInt.h index 7fd216b7e0..58d5dad946 100644 --- a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUInt.h +++ b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUInt.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfPrimitiveSet.h" diff --git a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUIntScoped.cpp b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUIntScoped.cpp similarity index 87% rename from VisualizationModules/LibRender/cvfPrimitiveSetIndexedUIntScoped.cpp rename to Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUIntScoped.cpp index 0909aab6ad..d91236729f 100644 --- a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUIntScoped.cpp +++ b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUIntScoped.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfAssert.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUIntScoped.h b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUIntScoped.h similarity index 64% rename from VisualizationModules/LibRender/cvfPrimitiveSetIndexedUIntScoped.h rename to Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUIntScoped.h index d4d126f8c3..815faccee5 100644 --- a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUIntScoped.h +++ b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUIntScoped.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfPrimitiveSet.h" diff --git a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUShort.cpp b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUShort.cpp similarity index 87% rename from VisualizationModules/LibRender/cvfPrimitiveSetIndexedUShort.cpp rename to Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUShort.cpp index ac731d4c4f..24a3c8ef5d 100644 --- a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUShort.cpp +++ b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUShort.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfAssert.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUShort.h b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUShort.h similarity index 64% rename from VisualizationModules/LibRender/cvfPrimitiveSetIndexedUShort.h rename to Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUShort.h index 5d84dd034b..a842d712c0 100644 --- a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUShort.h +++ b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUShort.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfPrimitiveSet.h" diff --git a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUShortScoped.cpp b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUShortScoped.cpp similarity index 87% rename from VisualizationModules/LibRender/cvfPrimitiveSetIndexedUShortScoped.cpp rename to Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUShortScoped.cpp index fb9d70f86e..a622226f9e 100644 --- a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUShortScoped.cpp +++ b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUShortScoped.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfAssert.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUShortScoped.h b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUShortScoped.h similarity index 64% rename from VisualizationModules/LibRender/cvfPrimitiveSetIndexedUShortScoped.h rename to Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUShortScoped.h index 0283446d99..25767144ce 100644 --- a/VisualizationModules/LibRender/cvfPrimitiveSetIndexedUShortScoped.h +++ b/Fwk/VizFwk/LibRender/cvfPrimitiveSetIndexedUShortScoped.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfPrimitiveSet.h" diff --git a/VisualizationModules/LibRender/cvfRenderState.cpp b/Fwk/VizFwk/LibRender/cvfRenderState.cpp similarity index 68% rename from VisualizationModules/LibRender/cvfRenderState.cpp rename to Fwk/VizFwk/LibRender/cvfRenderState.cpp index cb75c82104..be2f1c0bf0 100644 --- a/VisualizationModules/LibRender/cvfRenderState.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderState.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfAssert.h" #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderState.h b/Fwk/VizFwk/LibRender/cvfRenderState.h similarity index 65% rename from VisualizationModules/LibRender/cvfRenderState.h rename to Fwk/VizFwk/LibRender/cvfRenderState.h index 57cfee46a8..4ddcac7bd2 100644 --- a/VisualizationModules/LibRender/cvfRenderState.h +++ b/Fwk/VizFwk/LibRender/cvfRenderState.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateBlending.cpp b/Fwk/VizFwk/LibRender/cvfRenderStateBlending.cpp similarity index 89% rename from VisualizationModules/LibRender/cvfRenderStateBlending.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStateBlending.cpp index cc778df42d..5ffb8d9713 100644 --- a/VisualizationModules/LibRender/cvfRenderStateBlending.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStateBlending.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderStateBlending.h" #include "cvfAssert.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateBlending.h b/Fwk/VizFwk/LibRender/cvfRenderStateBlending.h similarity index 72% rename from VisualizationModules/LibRender/cvfRenderStateBlending.h rename to Fwk/VizFwk/LibRender/cvfRenderStateBlending.h index 3277163fc4..bc787277f4 100644 --- a/VisualizationModules/LibRender/cvfRenderStateBlending.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStateBlending.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateColorMask.cpp b/Fwk/VizFwk/LibRender/cvfRenderStateColorMask.cpp similarity index 80% rename from VisualizationModules/LibRender/cvfRenderStateColorMask.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStateColorMask.cpp index 3f849b22d2..cd84855636 100644 --- a/VisualizationModules/LibRender/cvfRenderStateColorMask.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStateColorMask.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderStateColorMask.h" #include "cvfAssert.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateColorMask.h b/Fwk/VizFwk/LibRender/cvfRenderStateColorMask.h similarity index 60% rename from VisualizationModules/LibRender/cvfRenderStateColorMask.h rename to Fwk/VizFwk/LibRender/cvfRenderStateColorMask.h index a9a3e8ce14..a1b6b4252b 100644 --- a/VisualizationModules/LibRender/cvfRenderStateColorMask.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStateColorMask.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateCullFace.cpp b/Fwk/VizFwk/LibRender/cvfRenderStateCullFace.cpp similarity index 76% rename from VisualizationModules/LibRender/cvfRenderStateCullFace.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStateCullFace.cpp index f99eec4777..484bebea29 100644 --- a/VisualizationModules/LibRender/cvfRenderStateCullFace.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStateCullFace.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderStateCullFace.h" #include "cvfAssert.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateCullFace.h b/Fwk/VizFwk/LibRender/cvfRenderStateCullFace.h similarity index 61% rename from VisualizationModules/LibRender/cvfRenderStateCullFace.h rename to Fwk/VizFwk/LibRender/cvfRenderStateCullFace.h index 627045a1b6..fb5935bae3 100644 --- a/VisualizationModules/LibRender/cvfRenderStateCullFace.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStateCullFace.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateDepth.cpp b/Fwk/VizFwk/LibRender/cvfRenderStateDepth.cpp similarity index 84% rename from VisualizationModules/LibRender/cvfRenderStateDepth.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStateDepth.cpp index 40ccb00928..b01757b7cb 100644 --- a/VisualizationModules/LibRender/cvfRenderStateDepth.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStateDepth.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderStateDepth.h" #include "cvfAssert.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateDepth.h b/Fwk/VizFwk/LibRender/cvfRenderStateDepth.h similarity index 70% rename from VisualizationModules/LibRender/cvfRenderStateDepth.h rename to Fwk/VizFwk/LibRender/cvfRenderStateDepth.h index 2cb95125ec..eaced266de 100644 --- a/VisualizationModules/LibRender/cvfRenderStateDepth.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStateDepth.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateFrontFace.cpp b/Fwk/VizFwk/LibRender/cvfRenderStateFrontFace.cpp similarity index 72% rename from VisualizationModules/LibRender/cvfRenderStateFrontFace.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStateFrontFace.cpp index 236ab1ae8f..5fb15973ed 100644 --- a/VisualizationModules/LibRender/cvfRenderStateFrontFace.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStateFrontFace.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderStateFrontFace.h" #include "cvfAssert.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateFrontFace.h b/Fwk/VizFwk/LibRender/cvfRenderStateFrontFace.h similarity index 56% rename from VisualizationModules/LibRender/cvfRenderStateFrontFace.h rename to Fwk/VizFwk/LibRender/cvfRenderStateFrontFace.h index 46c4004a4e..b39adc8f79 100644 --- a/VisualizationModules/LibRender/cvfRenderStateFrontFace.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStateFrontFace.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateLine.cpp b/Fwk/VizFwk/LibRender/cvfRenderStateLine.cpp similarity index 74% rename from VisualizationModules/LibRender/cvfRenderStateLine.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStateLine.cpp index 99bf80e56e..5c6458fb7e 100644 --- a/VisualizationModules/LibRender/cvfRenderStateLine.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStateLine.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderStateLine.h" #include "cvfAssert.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateLine.h b/Fwk/VizFwk/LibRender/cvfRenderStateLine.h similarity index 57% rename from VisualizationModules/LibRender/cvfRenderStateLine.h rename to Fwk/VizFwk/LibRender/cvfRenderStateLine.h index 16d2135559..d0228c2eec 100644 --- a/VisualizationModules/LibRender/cvfRenderStateLine.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStateLine.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderStatePoint.cpp b/Fwk/VizFwk/LibRender/cvfRenderStatePoint.cpp similarity index 81% rename from VisualizationModules/LibRender/cvfRenderStatePoint.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStatePoint.cpp index 006dc81fbf..b6bff4dcf6 100644 --- a/VisualizationModules/LibRender/cvfRenderStatePoint.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStatePoint.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderStatePoint.h" #include "cvfAssert.h" diff --git a/VisualizationModules/LibRender/cvfRenderStatePoint.h b/Fwk/VizFwk/LibRender/cvfRenderStatePoint.h similarity index 63% rename from VisualizationModules/LibRender/cvfRenderStatePoint.h rename to Fwk/VizFwk/LibRender/cvfRenderStatePoint.h index b77e266693..cd63fd5aba 100644 --- a/VisualizationModules/LibRender/cvfRenderStatePoint.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStatePoint.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderStatePolygonMode.cpp b/Fwk/VizFwk/LibRender/cvfRenderStatePolygonMode.cpp similarity index 79% rename from VisualizationModules/LibRender/cvfRenderStatePolygonMode.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStatePolygonMode.cpp index f6fef78c5f..4224172e94 100644 --- a/VisualizationModules/LibRender/cvfRenderStatePolygonMode.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStatePolygonMode.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderStatePolygonMode.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfRenderStatePolygonMode.h b/Fwk/VizFwk/LibRender/cvfRenderStatePolygonMode.h similarity index 63% rename from VisualizationModules/LibRender/cvfRenderStatePolygonMode.h rename to Fwk/VizFwk/LibRender/cvfRenderStatePolygonMode.h index 3d7b1c6d84..0bd73200fb 100644 --- a/VisualizationModules/LibRender/cvfRenderStatePolygonMode.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStatePolygonMode.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderStatePolygonOffset.cpp b/Fwk/VizFwk/LibRender/cvfRenderStatePolygonOffset.cpp similarity index 85% rename from VisualizationModules/LibRender/cvfRenderStatePolygonOffset.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStatePolygonOffset.cpp index ce0f893b30..f799eb25fa 100644 --- a/VisualizationModules/LibRender/cvfRenderStatePolygonOffset.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStatePolygonOffset.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfAssert.h" #include "cvfRenderStatePolygonOffset.h" diff --git a/VisualizationModules/LibRender/cvfRenderStatePolygonOffset.h b/Fwk/VizFwk/LibRender/cvfRenderStatePolygonOffset.h similarity index 65% rename from VisualizationModules/LibRender/cvfRenderStatePolygonOffset.h rename to Fwk/VizFwk/LibRender/cvfRenderStatePolygonOffset.h index 85f6fa97d8..677d49614f 100644 --- a/VisualizationModules/LibRender/cvfRenderStatePolygonOffset.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStatePolygonOffset.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateSet.cpp b/Fwk/VizFwk/LibRender/cvfRenderStateSet.cpp similarity index 80% rename from VisualizationModules/LibRender/cvfRenderStateSet.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStateSet.cpp index ad7cffd705..7865167ac6 100644 --- a/VisualizationModules/LibRender/cvfRenderStateSet.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStateSet.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfAssert.h" #include "cvfRenderStateSet.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateSet.h b/Fwk/VizFwk/LibRender/cvfRenderStateSet.h similarity index 58% rename from VisualizationModules/LibRender/cvfRenderStateSet.h rename to Fwk/VizFwk/LibRender/cvfRenderStateSet.h index 3915561290..a5cd22fee3 100644 --- a/VisualizationModules/LibRender/cvfRenderStateSet.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStateSet.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateStencil.cpp b/Fwk/VizFwk/LibRender/cvfRenderStateStencil.cpp similarity index 83% rename from VisualizationModules/LibRender/cvfRenderStateStencil.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStateStencil.cpp index db875c2057..ece30ab66b 100644 --- a/VisualizationModules/LibRender/cvfRenderStateStencil.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStateStencil.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderStateStencil.h" #include "cvfAssert.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateStencil.h b/Fwk/VizFwk/LibRender/cvfRenderStateStencil.h similarity index 78% rename from VisualizationModules/LibRender/cvfRenderStateStencil.h rename to Fwk/VizFwk/LibRender/cvfRenderStateStencil.h index 1ef2bacb1f..0b6623feec 100644 --- a/VisualizationModules/LibRender/cvfRenderStateStencil.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStateStencil.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateTextureBindings.cpp b/Fwk/VizFwk/LibRender/cvfRenderStateTextureBindings.cpp similarity index 89% rename from VisualizationModules/LibRender/cvfRenderStateTextureBindings.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStateTextureBindings.cpp index 5c3279916a..c65f157e8c 100644 --- a/VisualizationModules/LibRender/cvfRenderStateTextureBindings.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStateTextureBindings.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderStateTextureBindings.h" #include "cvfAssert.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateTextureBindings.h b/Fwk/VizFwk/LibRender/cvfRenderStateTextureBindings.h similarity index 68% rename from VisualizationModules/LibRender/cvfRenderStateTextureBindings.h rename to Fwk/VizFwk/LibRender/cvfRenderStateTextureBindings.h index d33447aa5f..7ece016631 100644 --- a/VisualizationModules/LibRender/cvfRenderStateTextureBindings.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStateTextureBindings.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateTracker.cpp b/Fwk/VizFwk/LibRender/cvfRenderStateTracker.cpp similarity index 87% rename from VisualizationModules/LibRender/cvfRenderStateTracker.cpp rename to Fwk/VizFwk/LibRender/cvfRenderStateTracker.cpp index 20100cbc62..250b9e5f5a 100644 --- a/VisualizationModules/LibRender/cvfRenderStateTracker.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderStateTracker.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderStateTracker.h" #include "cvfRenderStateSet.h" diff --git a/VisualizationModules/LibRender/cvfRenderStateTracker.h b/Fwk/VizFwk/LibRender/cvfRenderStateTracker.h similarity index 60% rename from VisualizationModules/LibRender/cvfRenderStateTracker.h rename to Fwk/VizFwk/LibRender/cvfRenderStateTracker.h index b85daeba1e..36b21596de 100644 --- a/VisualizationModules/LibRender/cvfRenderStateTracker.h +++ b/Fwk/VizFwk/LibRender/cvfRenderStateTracker.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderState_FF.cpp b/Fwk/VizFwk/LibRender/cvfRenderState_FF.cpp similarity index 96% rename from VisualizationModules/LibRender/cvfRenderState_FF.cpp rename to Fwk/VizFwk/LibRender/cvfRenderState_FF.cpp index f7b87e423e..86374ea4f7 100644 --- a/VisualizationModules/LibRender/cvfRenderState_FF.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderState_FF.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfOpenGL.h" #include "cvfColor4.h" diff --git a/VisualizationModules/LibRender/cvfRenderState_FF.h b/Fwk/VizFwk/LibRender/cvfRenderState_FF.h similarity index 88% rename from VisualizationModules/LibRender/cvfRenderState_FF.h rename to Fwk/VizFwk/LibRender/cvfRenderState_FF.h index 11227ba2bd..48a1b92981 100644 --- a/VisualizationModules/LibRender/cvfRenderState_FF.h +++ b/Fwk/VizFwk/LibRender/cvfRenderState_FF.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderState.h" diff --git a/VisualizationModules/LibRender/cvfRenderbufferObject.cpp b/Fwk/VizFwk/LibRender/cvfRenderbufferObject.cpp similarity index 82% rename from VisualizationModules/LibRender/cvfRenderbufferObject.cpp rename to Fwk/VizFwk/LibRender/cvfRenderbufferObject.cpp index e190c2011b..29bfc7d24d 100644 --- a/VisualizationModules/LibRender/cvfRenderbufferObject.cpp +++ b/Fwk/VizFwk/LibRender/cvfRenderbufferObject.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderbufferObject.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfRenderbufferObject.h b/Fwk/VizFwk/LibRender/cvfRenderbufferObject.h similarity index 64% rename from VisualizationModules/LibRender/cvfRenderbufferObject.h rename to Fwk/VizFwk/LibRender/cvfRenderbufferObject.h index fe7a4e347c..13beed9f78 100644 --- a/VisualizationModules/LibRender/cvfRenderbufferObject.h +++ b/Fwk/VizFwk/LibRender/cvfRenderbufferObject.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfSampler.cpp b/Fwk/VizFwk/LibRender/cvfSampler.cpp similarity index 80% rename from VisualizationModules/LibRender/cvfSampler.cpp rename to Fwk/VizFwk/LibRender/cvfSampler.cpp index 7a439ffcf2..7419b17302 100644 --- a/VisualizationModules/LibRender/cvfSampler.cpp +++ b/Fwk/VizFwk/LibRender/cvfSampler.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfSampler.h" diff --git a/VisualizationModules/LibRender/cvfSampler.h b/Fwk/VizFwk/LibRender/cvfSampler.h similarity index 73% rename from VisualizationModules/LibRender/cvfSampler.h rename to Fwk/VizFwk/LibRender/cvfSampler.h index f9d5428c58..bc5e191deb 100644 --- a/VisualizationModules/LibRender/cvfSampler.h +++ b/Fwk/VizFwk/LibRender/cvfSampler.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapper.cpp b/Fwk/VizFwk/LibRender/cvfScalarMapper.cpp similarity index 92% rename from VisualizationModules/LibRender/cvfScalarMapper.cpp rename to Fwk/VizFwk/LibRender/cvfScalarMapper.cpp index c707cf5748..974116937e 100644 --- a/VisualizationModules/LibRender/cvfScalarMapper.cpp +++ b/Fwk/VizFwk/LibRender/cvfScalarMapper.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfScalarMapper.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapper.h b/Fwk/VizFwk/LibRender/cvfScalarMapper.h similarity index 73% rename from VisualizationModules/LibRender/cvfScalarMapper.h rename to Fwk/VizFwk/LibRender/cvfScalarMapper.h index ea98e04b3d..13e82d0be4 100644 --- a/VisualizationModules/LibRender/cvfScalarMapper.h +++ b/Fwk/VizFwk/LibRender/cvfScalarMapper.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfBase.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapperContinuousLinear.cpp b/Fwk/VizFwk/LibRender/cvfScalarMapperContinuousLinear.cpp similarity index 65% rename from VisualizationModules/LibRender/cvfScalarMapperContinuousLinear.cpp rename to Fwk/VizFwk/LibRender/cvfScalarMapperContinuousLinear.cpp index f4849e3deb..4aca519def 100644 --- a/VisualizationModules/LibRender/cvfScalarMapperContinuousLinear.cpp +++ b/Fwk/VizFwk/LibRender/cvfScalarMapperContinuousLinear.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfScalarMapperContinuousLinear.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapperContinuousLinear.h b/Fwk/VizFwk/LibRender/cvfScalarMapperContinuousLinear.h similarity index 55% rename from VisualizationModules/LibRender/cvfScalarMapperContinuousLinear.h rename to Fwk/VizFwk/LibRender/cvfScalarMapperContinuousLinear.h index 774798afbe..e462e4441a 100644 --- a/VisualizationModules/LibRender/cvfScalarMapperContinuousLinear.h +++ b/Fwk/VizFwk/LibRender/cvfScalarMapperContinuousLinear.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfScalarMapperRangeBased.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapperContinuousLog.cpp b/Fwk/VizFwk/LibRender/cvfScalarMapperContinuousLog.cpp similarity index 76% rename from VisualizationModules/LibRender/cvfScalarMapperContinuousLog.cpp rename to Fwk/VizFwk/LibRender/cvfScalarMapperContinuousLog.cpp index 8cccdcae42..ebb43da216 100644 --- a/VisualizationModules/LibRender/cvfScalarMapperContinuousLog.cpp +++ b/Fwk/VizFwk/LibRender/cvfScalarMapperContinuousLog.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfScalarMapperContinuousLog.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapperContinuousLog.h b/Fwk/VizFwk/LibRender/cvfScalarMapperContinuousLog.h similarity index 57% rename from VisualizationModules/LibRender/cvfScalarMapperContinuousLog.h rename to Fwk/VizFwk/LibRender/cvfScalarMapperContinuousLog.h index eda29b7339..ba095b27fc 100644 --- a/VisualizationModules/LibRender/cvfScalarMapperContinuousLog.h +++ b/Fwk/VizFwk/LibRender/cvfScalarMapperContinuousLog.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfScalarMapperRangeBased.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapperDiscreteLinear.cpp b/Fwk/VizFwk/LibRender/cvfScalarMapperDiscreteLinear.cpp similarity index 76% rename from VisualizationModules/LibRender/cvfScalarMapperDiscreteLinear.cpp rename to Fwk/VizFwk/LibRender/cvfScalarMapperDiscreteLinear.cpp index febea0c299..38d7cb2376 100644 --- a/VisualizationModules/LibRender/cvfScalarMapperDiscreteLinear.cpp +++ b/Fwk/VizFwk/LibRender/cvfScalarMapperDiscreteLinear.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfScalarMapperDiscreteLinear.h" #include "cvfMath.h" #include "cvfTextureImage.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapperDiscreteLinear.h b/Fwk/VizFwk/LibRender/cvfScalarMapperDiscreteLinear.h similarity index 60% rename from VisualizationModules/LibRender/cvfScalarMapperDiscreteLinear.h rename to Fwk/VizFwk/LibRender/cvfScalarMapperDiscreteLinear.h index da8fcb5fd9..b1fa923487 100644 --- a/VisualizationModules/LibRender/cvfScalarMapperDiscreteLinear.h +++ b/Fwk/VizFwk/LibRender/cvfScalarMapperDiscreteLinear.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfScalarMapperRangeBased.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapperDiscreteLog.cpp b/Fwk/VizFwk/LibRender/cvfScalarMapperDiscreteLog.cpp similarity index 80% rename from VisualizationModules/LibRender/cvfScalarMapperDiscreteLog.cpp rename to Fwk/VizFwk/LibRender/cvfScalarMapperDiscreteLog.cpp index 564ec95c9c..204a02c817 100644 --- a/VisualizationModules/LibRender/cvfScalarMapperDiscreteLog.cpp +++ b/Fwk/VizFwk/LibRender/cvfScalarMapperDiscreteLog.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfScalarMapperDiscreteLog.h" #include "cvfScalarMapperDiscreteLinear.h" #include diff --git a/VisualizationModules/LibRender/cvfScalarMapperDiscreteLog.h b/Fwk/VizFwk/LibRender/cvfScalarMapperDiscreteLog.h similarity index 59% rename from VisualizationModules/LibRender/cvfScalarMapperDiscreteLog.h rename to Fwk/VizFwk/LibRender/cvfScalarMapperDiscreteLog.h index bba36fbbea..d7bc22fd58 100644 --- a/VisualizationModules/LibRender/cvfScalarMapperDiscreteLog.h +++ b/Fwk/VizFwk/LibRender/cvfScalarMapperDiscreteLog.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfScalarMapperRangeBased.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapperRangeBased.cpp b/Fwk/VizFwk/LibRender/cvfScalarMapperRangeBased.cpp similarity index 90% rename from VisualizationModules/LibRender/cvfScalarMapperRangeBased.cpp rename to Fwk/VizFwk/LibRender/cvfScalarMapperRangeBased.cpp index f2c41620e5..80ea76a0a6 100644 --- a/VisualizationModules/LibRender/cvfScalarMapperRangeBased.cpp +++ b/Fwk/VizFwk/LibRender/cvfScalarMapperRangeBased.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfScalarMapperRangeBased.h" #include "cvfMath.h" #include "cvfTextureImage.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapperRangeBased.h b/Fwk/VizFwk/LibRender/cvfScalarMapperRangeBased.h similarity index 71% rename from VisualizationModules/LibRender/cvfScalarMapperRangeBased.h rename to Fwk/VizFwk/LibRender/cvfScalarMapperRangeBased.h index 2a818fb75f..a4954b9847 100644 --- a/VisualizationModules/LibRender/cvfScalarMapperRangeBased.h +++ b/Fwk/VizFwk/LibRender/cvfScalarMapperRangeBased.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfScalarMapper.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapperUniformLevels.cpp b/Fwk/VizFwk/LibRender/cvfScalarMapperUniformLevels.cpp similarity index 91% rename from VisualizationModules/LibRender/cvfScalarMapperUniformLevels.cpp rename to Fwk/VizFwk/LibRender/cvfScalarMapperUniformLevels.cpp index 696cbadc75..9f7f36cb0e 100644 --- a/VisualizationModules/LibRender/cvfScalarMapperUniformLevels.cpp +++ b/Fwk/VizFwk/LibRender/cvfScalarMapperUniformLevels.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfMath.h" #include "cvfScalarMapperUniformLevels.h" diff --git a/VisualizationModules/LibRender/cvfScalarMapperUniformLevels.h b/Fwk/VizFwk/LibRender/cvfScalarMapperUniformLevels.h similarity index 67% rename from VisualizationModules/LibRender/cvfScalarMapperUniformLevels.h rename to Fwk/VizFwk/LibRender/cvfScalarMapperUniformLevels.h index f871277610..62af26473a 100644 --- a/VisualizationModules/LibRender/cvfScalarMapperUniformLevels.h +++ b/Fwk/VizFwk/LibRender/cvfScalarMapperUniformLevels.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfShader.cpp b/Fwk/VizFwk/LibRender/cvfShader.cpp similarity index 88% rename from VisualizationModules/LibRender/cvfShader.cpp rename to Fwk/VizFwk/LibRender/cvfShader.cpp index 057b15d75c..ca6ac8f549 100644 --- a/VisualizationModules/LibRender/cvfShader.cpp +++ b/Fwk/VizFwk/LibRender/cvfShader.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfShaderProgram.h" #include "cvfLogger.h" diff --git a/VisualizationModules/LibRender/cvfShader.h b/Fwk/VizFwk/LibRender/cvfShader.h similarity index 68% rename from VisualizationModules/LibRender/cvfShader.h rename to Fwk/VizFwk/LibRender/cvfShader.h index 44acac0233..be9e1a0ff5 100644 --- a/VisualizationModules/LibRender/cvfShader.h +++ b/Fwk/VizFwk/LibRender/cvfShader.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfShaderProgram.cpp b/Fwk/VizFwk/LibRender/cvfShaderProgram.cpp similarity index 96% rename from VisualizationModules/LibRender/cvfShaderProgram.cpp rename to Fwk/VizFwk/LibRender/cvfShaderProgram.cpp index 2ac80e90f1..a38b280a70 100644 --- a/VisualizationModules/LibRender/cvfShaderProgram.cpp +++ b/Fwk/VizFwk/LibRender/cvfShaderProgram.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfShaderProgram.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfShaderProgram.h b/Fwk/VizFwk/LibRender/cvfShaderProgram.h similarity index 83% rename from VisualizationModules/LibRender/cvfShaderProgram.h rename to Fwk/VizFwk/LibRender/cvfShaderProgram.h index 13df60d2e9..ce3cb06044 100644 --- a/VisualizationModules/LibRender/cvfShaderProgram.h +++ b/Fwk/VizFwk/LibRender/cvfShaderProgram.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfShader.h" diff --git a/VisualizationModules/LibRender/cvfShaderProgramGenerator.cpp b/Fwk/VizFwk/LibRender/cvfShaderProgramGenerator.cpp similarity index 92% rename from VisualizationModules/LibRender/cvfShaderProgramGenerator.cpp rename to Fwk/VizFwk/LibRender/cvfShaderProgramGenerator.cpp index 3bc0024782..6ddea19c88 100644 --- a/VisualizationModules/LibRender/cvfShaderProgramGenerator.cpp +++ b/Fwk/VizFwk/LibRender/cvfShaderProgramGenerator.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfShaderProgramGenerator.h" #include "cvfShaderProgram.h" diff --git a/VisualizationModules/LibRender/cvfShaderProgramGenerator.h b/Fwk/VizFwk/LibRender/cvfShaderProgramGenerator.h similarity index 73% rename from VisualizationModules/LibRender/cvfShaderProgramGenerator.h rename to Fwk/VizFwk/LibRender/cvfShaderProgramGenerator.h index 80cd8139ac..de5ae931e7 100644 --- a/VisualizationModules/LibRender/cvfShaderProgramGenerator.h +++ b/Fwk/VizFwk/LibRender/cvfShaderProgramGenerator.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfShaderSourceRepository.h" diff --git a/VisualizationModules/LibRender/cvfShaderSourceProvider.cpp b/Fwk/VizFwk/LibRender/cvfShaderSourceProvider.cpp similarity index 81% rename from VisualizationModules/LibRender/cvfShaderSourceProvider.cpp rename to Fwk/VizFwk/LibRender/cvfShaderSourceProvider.cpp index ed3b82fbfe..0563a03643 100644 --- a/VisualizationModules/LibRender/cvfShaderSourceProvider.cpp +++ b/Fwk/VizFwk/LibRender/cvfShaderSourceProvider.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfShaderSourceProvider.h" #include "cvfShaderProgram.h" diff --git a/VisualizationModules/LibRender/cvfShaderSourceProvider.h b/Fwk/VizFwk/LibRender/cvfShaderSourceProvider.h similarity index 61% rename from VisualizationModules/LibRender/cvfShaderSourceProvider.h rename to Fwk/VizFwk/LibRender/cvfShaderSourceProvider.h index 0acdb0020d..6658d16861 100644 --- a/VisualizationModules/LibRender/cvfShaderSourceProvider.h +++ b/Fwk/VizFwk/LibRender/cvfShaderSourceProvider.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfShaderSourceRepository.h" diff --git a/VisualizationModules/LibRender/cvfShaderSourceRepository.cpp b/Fwk/VizFwk/LibRender/cvfShaderSourceRepository.cpp similarity index 87% rename from VisualizationModules/LibRender/cvfShaderSourceRepository.cpp rename to Fwk/VizFwk/LibRender/cvfShaderSourceRepository.cpp index e5a4709b87..66a011a8c3 100644 --- a/VisualizationModules/LibRender/cvfShaderSourceRepository.cpp +++ b/Fwk/VizFwk/LibRender/cvfShaderSourceRepository.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfString.h" #include "cvfShaderSourceRepository.h" diff --git a/VisualizationModules/LibRender/cvfShaderSourceRepository.h b/Fwk/VizFwk/LibRender/cvfShaderSourceRepository.h similarity index 69% rename from VisualizationModules/LibRender/cvfShaderSourceRepository.h rename to Fwk/VizFwk/LibRender/cvfShaderSourceRepository.h index 24ab80841f..e20c7a4870 100644 --- a/VisualizationModules/LibRender/cvfShaderSourceRepository.h +++ b/Fwk/VizFwk/LibRender/cvfShaderSourceRepository.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfShaderSourceRepositoryFile.cpp b/Fwk/VizFwk/LibRender/cvfShaderSourceRepositoryFile.cpp similarity index 72% rename from VisualizationModules/LibRender/cvfShaderSourceRepositoryFile.cpp rename to Fwk/VizFwk/LibRender/cvfShaderSourceRepositoryFile.cpp index 9a2b2543b2..f4730e2146 100644 --- a/VisualizationModules/LibRender/cvfShaderSourceRepositoryFile.cpp +++ b/Fwk/VizFwk/LibRender/cvfShaderSourceRepositoryFile.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfShaderSourceRepositoryFile.h" diff --git a/VisualizationModules/LibRender/cvfShaderSourceRepositoryFile.h b/Fwk/VizFwk/LibRender/cvfShaderSourceRepositoryFile.h similarity index 54% rename from VisualizationModules/LibRender/cvfShaderSourceRepositoryFile.h rename to Fwk/VizFwk/LibRender/cvfShaderSourceRepositoryFile.h index 6f011a5ccd..5b6395d172 100644 --- a/VisualizationModules/LibRender/cvfShaderSourceRepositoryFile.h +++ b/Fwk/VizFwk/LibRender/cvfShaderSourceRepositoryFile.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfString.h" diff --git a/VisualizationModules/LibRender/cvfShaderSourceStrings.h b/Fwk/VizFwk/LibRender/cvfShaderSourceStrings.h similarity index 100% rename from VisualizationModules/LibRender/cvfShaderSourceStrings.h rename to Fwk/VizFwk/LibRender/cvfShaderSourceStrings.h diff --git a/VisualizationModules/LibRender/cvfTextDrawer.cpp b/Fwk/VizFwk/LibRender/cvfTextDrawer.cpp similarity index 93% rename from VisualizationModules/LibRender/cvfTextDrawer.cpp rename to Fwk/VizFwk/LibRender/cvfTextDrawer.cpp index 86a635d9a0..8106d4918a 100644 --- a/VisualizationModules/LibRender/cvfTextDrawer.cpp +++ b/Fwk/VizFwk/LibRender/cvfTextDrawer.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfTextDrawer.h" #include "cvfFont.h" @@ -35,6 +53,7 @@ #include "cvfRenderStateDepth.h" #include "cvfRenderStateBlending.h" #include "cvfRenderStatePolygonOffset.h" +#include "cvfOpenGLCapabilities.h" #ifndef CVF_OPENGL_ES #include "cvfRenderState_FF.h" @@ -331,8 +350,20 @@ void TextDrawer::doRender2d(OpenGLContext* oglContext, const MatrixState& matrix RenderStateLighting_FF light(false); light.applyOpenGL(oglContext); -#endif + + // The active texture may be set to something different than unit 0 if we end up using + // software rendering here, BUT the context actually has higher capabilities + // Must be set before any texture related OpenGL calls + if (oglContext->capabilities()->supportsOpenGL2()) + { + glActiveTexture(GL_TEXTURE0); + } + + // Will get turned on during rendering of text, but must be off for background and border + glDisable(GL_TEXTURE_2D); + projCam.applyOpenGL(); +#endif } else { @@ -399,7 +430,7 @@ void TextDrawer::doRender2d(OpenGLContext* oglContext, const MatrixState& matrix #ifndef CVF_OPENGL_ES glEnable(GL_COLOR_MATERIAL); glDisable(GL_TEXTURE_2D); - glColor4fv(m_backgroundColor.ptr()); + glColor3fv(m_backgroundColor.ptr()); glBegin(GL_TRIANGLE_FAN); glVertex3fv(v1); glVertex3fv(v2); diff --git a/VisualizationModules/LibRender/cvfTextDrawer.h b/Fwk/VizFwk/LibRender/cvfTextDrawer.h similarity index 74% rename from VisualizationModules/LibRender/cvfTextDrawer.h rename to Fwk/VizFwk/LibRender/cvfTextDrawer.h index 208bf507b2..00c4da1a35 100644 --- a/VisualizationModules/LibRender/cvfTextDrawer.h +++ b/Fwk/VizFwk/LibRender/cvfTextDrawer.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfTexture.cpp b/Fwk/VizFwk/LibRender/cvfTexture.cpp similarity index 95% rename from VisualizationModules/LibRender/cvfTexture.cpp rename to Fwk/VizFwk/LibRender/cvfTexture.cpp index b2eb74c5b6..c14b002bf2 100644 --- a/VisualizationModules/LibRender/cvfTexture.cpp +++ b/Fwk/VizFwk/LibRender/cvfTexture.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfTexture.h" #include "cvfTextureImage.h" diff --git a/VisualizationModules/LibRender/cvfTexture.h b/Fwk/VizFwk/LibRender/cvfTexture.h similarity index 79% rename from VisualizationModules/LibRender/cvfTexture.h rename to Fwk/VizFwk/LibRender/cvfTexture.h index 58353d1f3a..65155c6d88 100644 --- a/VisualizationModules/LibRender/cvfTexture.h +++ b/Fwk/VizFwk/LibRender/cvfTexture.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfTexture2D_FF.cpp b/Fwk/VizFwk/LibRender/cvfTexture2D_FF.cpp similarity index 88% rename from VisualizationModules/LibRender/cvfTexture2D_FF.cpp rename to Fwk/VizFwk/LibRender/cvfTexture2D_FF.cpp index c42339a723..4619ce446f 100644 --- a/VisualizationModules/LibRender/cvfTexture2D_FF.cpp +++ b/Fwk/VizFwk/LibRender/cvfTexture2D_FF.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfTexture2D_FF.h" #include "cvfTextureImage.h" diff --git a/VisualizationModules/LibRender/cvfTexture2D_FF.h b/Fwk/VizFwk/LibRender/cvfTexture2D_FF.h similarity index 68% rename from VisualizationModules/LibRender/cvfTexture2D_FF.h rename to Fwk/VizFwk/LibRender/cvfTexture2D_FF.h index 632a394c2c..17ada2503c 100644 --- a/VisualizationModules/LibRender/cvfTexture2D_FF.h +++ b/Fwk/VizFwk/LibRender/cvfTexture2D_FF.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfTextureImage.cpp b/Fwk/VizFwk/LibRender/cvfTextureImage.cpp similarity index 88% rename from VisualizationModules/LibRender/cvfTextureImage.cpp rename to Fwk/VizFwk/LibRender/cvfTextureImage.cpp index 9f44347604..46e081c0bc 100644 --- a/VisualizationModules/LibRender/cvfTextureImage.cpp +++ b/Fwk/VizFwk/LibRender/cvfTextureImage.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfTextureImage.h" @@ -199,10 +217,12 @@ void TextureImage::setPixel(uint x, uint y, const Color4ub& clr) CVF_TIGHT_ASSERT(y < m_height); const uint idx = 4*(y*m_width + x); - m_dataRgba[idx] = clr.r(); - m_dataRgba[idx + 1] = clr.g(); - m_dataRgba[idx + 2] = clr.b(); - m_dataRgba[idx + 3] = clr.a(); + const ubyte* data = clr.ptr(); + + m_dataRgba[idx] = data[0]; + m_dataRgba[idx + 1] = data[1]; + m_dataRgba[idx + 2] = data[2]; + m_dataRgba[idx + 3] = data[3]; } diff --git a/VisualizationModules/LibRender/cvfTextureImage.h b/Fwk/VizFwk/LibRender/cvfTextureImage.h similarity index 66% rename from VisualizationModules/LibRender/cvfTextureImage.h rename to Fwk/VizFwk/LibRender/cvfTextureImage.h index b50dc533e4..1d20933997 100644 --- a/VisualizationModules/LibRender/cvfTextureImage.h +++ b/Fwk/VizFwk/LibRender/cvfTextureImage.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/cvfUniform.cpp b/Fwk/VizFwk/LibRender/cvfUniform.cpp similarity index 92% rename from VisualizationModules/LibRender/cvfUniform.cpp rename to Fwk/VizFwk/LibRender/cvfUniform.cpp index 90e7b812ab..8b61c8317f 100644 --- a/VisualizationModules/LibRender/cvfUniform.cpp +++ b/Fwk/VizFwk/LibRender/cvfUniform.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfAssert.h" #include "cvfUniform.h" diff --git a/VisualizationModules/LibRender/cvfUniform.h b/Fwk/VizFwk/LibRender/cvfUniform.h similarity index 79% rename from VisualizationModules/LibRender/cvfUniform.h rename to Fwk/VizFwk/LibRender/cvfUniform.h index 7c7345cf8d..a849cd7936 100644 --- a/VisualizationModules/LibRender/cvfUniform.h +++ b/Fwk/VizFwk/LibRender/cvfUniform.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfVector4.h" diff --git a/VisualizationModules/LibRender/cvfUniformSet.cpp b/Fwk/VizFwk/LibRender/cvfUniformSet.cpp similarity index 78% rename from VisualizationModules/LibRender/cvfUniformSet.cpp rename to Fwk/VizFwk/LibRender/cvfUniformSet.cpp index 65e4b6d4fc..0064386b85 100644 --- a/VisualizationModules/LibRender/cvfUniformSet.cpp +++ b/Fwk/VizFwk/LibRender/cvfUniformSet.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfAssert.h" #include "cvfUniformSet.h" diff --git a/VisualizationModules/LibRender/cvfUniformSet.h b/Fwk/VizFwk/LibRender/cvfUniformSet.h similarity index 55% rename from VisualizationModules/LibRender/cvfUniformSet.h rename to Fwk/VizFwk/LibRender/cvfUniformSet.h index a4e57691f5..83844ca220 100644 --- a/VisualizationModules/LibRender/cvfUniformSet.h +++ b/Fwk/VizFwk/LibRender/cvfUniformSet.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfCollection.h" diff --git a/VisualizationModules/LibRender/cvfVertexAttribute.cpp b/Fwk/VizFwk/LibRender/cvfVertexAttribute.cpp similarity index 89% rename from VisualizationModules/LibRender/cvfVertexAttribute.cpp rename to Fwk/VizFwk/LibRender/cvfVertexAttribute.cpp index 176b320ad4..51c65fcd09 100644 --- a/VisualizationModules/LibRender/cvfVertexAttribute.cpp +++ b/Fwk/VizFwk/LibRender/cvfVertexAttribute.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfVertexAttribute.h" #include "cvfBufferObjectManaged.h" diff --git a/VisualizationModules/LibRender/cvfVertexAttribute.h b/Fwk/VizFwk/LibRender/cvfVertexAttribute.h similarity index 87% rename from VisualizationModules/LibRender/cvfVertexAttribute.h rename to Fwk/VizFwk/LibRender/cvfVertexAttribute.h index 4ebff0c65e..ee2fab4e50 100644 --- a/VisualizationModules/LibRender/cvfVertexAttribute.h +++ b/Fwk/VizFwk/LibRender/cvfVertexAttribute.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfVector4.h" diff --git a/VisualizationModules/LibRender/cvfVertexBundle.cpp b/Fwk/VizFwk/LibRender/cvfVertexBundle.cpp similarity index 96% rename from VisualizationModules/LibRender/cvfVertexBundle.cpp rename to Fwk/VizFwk/LibRender/cvfVertexBundle.cpp index eb0d559d64..1cb478310a 100644 --- a/VisualizationModules/LibRender/cvfVertexBundle.cpp +++ b/Fwk/VizFwk/LibRender/cvfVertexBundle.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfVertexBundle.h" #include "cvfBufferObjectManaged.h" diff --git a/VisualizationModules/LibRender/cvfVertexBundle.h b/Fwk/VizFwk/LibRender/cvfVertexBundle.h similarity index 82% rename from VisualizationModules/LibRender/cvfVertexBundle.h rename to Fwk/VizFwk/LibRender/cvfVertexBundle.h index a1ac1f1c31..1d1d398977 100644 --- a/VisualizationModules/LibRender/cvfVertexBundle.h +++ b/Fwk/VizFwk/LibRender/cvfVertexBundle.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfCollection.h" diff --git a/VisualizationModules/LibRender/cvfViewport.cpp b/Fwk/VizFwk/LibRender/cvfViewport.cpp similarity index 90% rename from VisualizationModules/LibRender/cvfViewport.cpp rename to Fwk/VizFwk/LibRender/cvfViewport.cpp index fdb6e9c99f..37ad09d3dd 100644 --- a/VisualizationModules/LibRender/cvfViewport.cpp +++ b/Fwk/VizFwk/LibRender/cvfViewport.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfViewport.h" #include "cvfOpenGL.h" diff --git a/VisualizationModules/LibRender/cvfViewport.h b/Fwk/VizFwk/LibRender/cvfViewport.h similarity index 65% rename from VisualizationModules/LibRender/cvfViewport.h rename to Fwk/VizFwk/LibRender/cvfViewport.h index b85899e8cb..d7d29981c1 100644 --- a/VisualizationModules/LibRender/cvfViewport.h +++ b/Fwk/VizFwk/LibRender/cvfViewport.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibRender/glew/GL/glew.h b/Fwk/VizFwk/LibRender/glew/GL/glew.h similarity index 100% rename from VisualizationModules/LibRender/glew/GL/glew.h rename to Fwk/VizFwk/LibRender/glew/GL/glew.h diff --git a/VisualizationModules/LibRender/glew/GL/glxew.h b/Fwk/VizFwk/LibRender/glew/GL/glxew.h similarity index 100% rename from VisualizationModules/LibRender/glew/GL/glxew.h rename to Fwk/VizFwk/LibRender/glew/GL/glxew.h diff --git a/VisualizationModules/LibRender/glew/GL/wglew.h b/Fwk/VizFwk/LibRender/glew/GL/wglew.h similarity index 100% rename from VisualizationModules/LibRender/glew/GL/wglew.h rename to Fwk/VizFwk/LibRender/glew/GL/wglew.h diff --git a/VisualizationModules/LibRender/glew/glew.c b/Fwk/VizFwk/LibRender/glew/glew.c similarity index 100% rename from VisualizationModules/LibRender/glew/glew.c rename to Fwk/VizFwk/LibRender/glew/glew.c diff --git a/VisualizationModules/LibRender/glsl/!AddingAndModifyingGlslFiles.txt b/Fwk/VizFwk/LibRender/glsl/!AddingAndModifyingGlslFiles.txt similarity index 100% rename from VisualizationModules/LibRender/glsl/!AddingAndModifyingGlslFiles.txt rename to Fwk/VizFwk/LibRender/glsl/!AddingAndModifyingGlslFiles.txt diff --git a/VisualizationModules/LibRender/glsl/calcClipDistances.glsl b/Fwk/VizFwk/LibRender/glsl/calcClipDistances.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/calcClipDistances.glsl rename to Fwk/VizFwk/LibRender/glsl/calcClipDistances.glsl diff --git a/VisualizationModules/LibRender/glsl/calcShadowCoord.glsl b/Fwk/VizFwk/LibRender/glsl/calcShadowCoord.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/calcShadowCoord.glsl rename to Fwk/VizFwk/LibRender/glsl/calcShadowCoord.glsl diff --git a/VisualizationModules/LibRender/glsl/checkDiscard_ClipDistances.glsl b/Fwk/VizFwk/LibRender/glsl/checkDiscard_ClipDistances.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/checkDiscard_ClipDistances.glsl rename to Fwk/VizFwk/LibRender/glsl/checkDiscard_ClipDistances.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_CenterLitSpherePoints.glsl b/Fwk/VizFwk/LibRender/glsl/fs_CenterLitSpherePoints.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_CenterLitSpherePoints.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_CenterLitSpherePoints.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_FixedColorMagenta.glsl b/Fwk/VizFwk/LibRender/glsl/fs_FixedColorMagenta.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_FixedColorMagenta.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_FixedColorMagenta.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_GaussianBlur.glsl b/Fwk/VizFwk/LibRender/glsl/fs_GaussianBlur.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_GaussianBlur.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_GaussianBlur.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_GradientTopBottom.glsl b/Fwk/VizFwk/LibRender/glsl/fs_GradientTopBottom.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_GradientTopBottom.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_GradientTopBottom.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_GradientTopMiddleBottom.glsl b/Fwk/VizFwk/LibRender/glsl/fs_GradientTopMiddleBottom.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_GradientTopMiddleBottom.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_GradientTopMiddleBottom.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_HighlightMix.glsl b/Fwk/VizFwk/LibRender/glsl/fs_HighlightMix.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_HighlightMix.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_HighlightMix.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_HighlightStencilBlur_v33.glsl b/Fwk/VizFwk/LibRender/glsl/fs_HighlightStencilBlur_v33.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_HighlightStencilBlur_v33.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_HighlightStencilBlur_v33.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_HighlightStencilDraw.glsl b/Fwk/VizFwk/LibRender/glsl/fs_HighlightStencilDraw.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_HighlightStencilDraw.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_HighlightStencilDraw.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_HighlightStencilMix_v33.glsl b/Fwk/VizFwk/LibRender/glsl/fs_HighlightStencilMix_v33.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_HighlightStencilMix_v33.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_HighlightStencilMix_v33.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_ParticleTraceComets.glsl b/Fwk/VizFwk/LibRender/glsl/fs_ParticleTraceComets.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_ParticleTraceComets.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_ParticleTraceComets.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_Shadow_v33.glsl b/Fwk/VizFwk/LibRender/glsl/fs_Shadow_v33.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_Shadow_v33.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_Shadow_v33.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_Standard.glsl b/Fwk/VizFwk/LibRender/glsl/fs_Standard.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_Standard.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_Standard.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_Text.glsl b/Fwk/VizFwk/LibRender/glsl/fs_Text.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_Text.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_Text.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_Unlit.glsl b/Fwk/VizFwk/LibRender/glsl/fs_Unlit.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_Unlit.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_Unlit.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_VectorDrawer.glsl b/Fwk/VizFwk/LibRender/glsl/fs_VectorDrawer.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_VectorDrawer.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_VectorDrawer.glsl diff --git a/VisualizationModules/LibRender/glsl/fs_Void.glsl b/Fwk/VizFwk/LibRender/glsl/fs_Void.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/fs_Void.glsl rename to Fwk/VizFwk/LibRender/glsl/fs_Void.glsl diff --git a/VisualizationModules/LibRender/glsl/gs_PassThroughTriangle_v33.glsl b/Fwk/VizFwk/LibRender/glsl/gs_PassThroughTriangle_v33.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/gs_PassThroughTriangle_v33.glsl rename to Fwk/VizFwk/LibRender/glsl/gs_PassThroughTriangle_v33.glsl diff --git a/VisualizationModules/LibRender/glsl/light_Headlight.glsl b/Fwk/VizFwk/LibRender/glsl/light_Headlight.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/light_Headlight.glsl rename to Fwk/VizFwk/LibRender/glsl/light_Headlight.glsl diff --git a/VisualizationModules/LibRender/glsl/light_Phong.glsl b/Fwk/VizFwk/LibRender/glsl/light_Phong.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/light_Phong.glsl rename to Fwk/VizFwk/LibRender/glsl/light_Phong.glsl diff --git a/VisualizationModules/LibRender/glsl/light_PhongDual.glsl b/Fwk/VizFwk/LibRender/glsl/light_PhongDual.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/light_PhongDual.glsl rename to Fwk/VizFwk/LibRender/glsl/light_PhongDual.glsl diff --git a/VisualizationModules/LibRender/glsl/light_SimpleHeadlight.glsl b/Fwk/VizFwk/LibRender/glsl/light_SimpleHeadlight.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/light_SimpleHeadlight.glsl rename to Fwk/VizFwk/LibRender/glsl/light_SimpleHeadlight.glsl diff --git a/VisualizationModules/LibRender/glsl/src_Color.glsl b/Fwk/VizFwk/LibRender/glsl/src_Color.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/src_Color.glsl rename to Fwk/VizFwk/LibRender/glsl/src_Color.glsl diff --git a/VisualizationModules/LibRender/glsl/src_Texture.glsl b/Fwk/VizFwk/LibRender/glsl/src_Texture.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/src_Texture.glsl rename to Fwk/VizFwk/LibRender/glsl/src_Texture.glsl diff --git a/VisualizationModules/LibRender/glsl/src_TextureFromPointCoord.glsl b/Fwk/VizFwk/LibRender/glsl/src_TextureFromPointCoord.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/src_TextureFromPointCoord.glsl rename to Fwk/VizFwk/LibRender/glsl/src_TextureFromPointCoord.glsl diff --git a/VisualizationModules/LibRender/glsl/src_TextureGlobalAlpha.glsl b/Fwk/VizFwk/LibRender/glsl/src_TextureGlobalAlpha.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/src_TextureGlobalAlpha.glsl rename to Fwk/VizFwk/LibRender/glsl/src_TextureGlobalAlpha.glsl diff --git a/VisualizationModules/LibRender/glsl/src_TextureRectFromFragCoord_v33.glsl b/Fwk/VizFwk/LibRender/glsl/src_TextureRectFromFragCoord_v33.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/src_TextureRectFromFragCoord_v33.glsl rename to Fwk/VizFwk/LibRender/glsl/src_TextureRectFromFragCoord_v33.glsl diff --git a/VisualizationModules/LibRender/glsl/src_TwoSidedColor.glsl b/Fwk/VizFwk/LibRender/glsl/src_TwoSidedColor.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/src_TwoSidedColor.glsl rename to Fwk/VizFwk/LibRender/glsl/src_TwoSidedColor.glsl diff --git a/VisualizationModules/LibRender/glsl/vs_DistanceScaledPoints.glsl b/Fwk/VizFwk/LibRender/glsl/vs_DistanceScaledPoints.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/vs_DistanceScaledPoints.glsl rename to Fwk/VizFwk/LibRender/glsl/vs_DistanceScaledPoints.glsl diff --git a/VisualizationModules/LibRender/glsl/vs_EnvironmentMapping.glsl b/Fwk/VizFwk/LibRender/glsl/vs_EnvironmentMapping.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/vs_EnvironmentMapping.glsl rename to Fwk/VizFwk/LibRender/glsl/vs_EnvironmentMapping.glsl diff --git a/VisualizationModules/LibRender/glsl/vs_FullScreenQuad.glsl b/Fwk/VizFwk/LibRender/glsl/vs_FullScreenQuad.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/vs_FullScreenQuad.glsl rename to Fwk/VizFwk/LibRender/glsl/vs_FullScreenQuad.glsl diff --git a/VisualizationModules/LibRender/glsl/vs_Minimal.glsl b/Fwk/VizFwk/LibRender/glsl/vs_Minimal.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/vs_Minimal.glsl rename to Fwk/VizFwk/LibRender/glsl/vs_Minimal.glsl diff --git a/VisualizationModules/LibRender/glsl/vs_MinimalTexture.glsl b/Fwk/VizFwk/LibRender/glsl/vs_MinimalTexture.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/vs_MinimalTexture.glsl rename to Fwk/VizFwk/LibRender/glsl/vs_MinimalTexture.glsl diff --git a/VisualizationModules/LibRender/glsl/vs_ParticleTraceComets.glsl b/Fwk/VizFwk/LibRender/glsl/vs_ParticleTraceComets.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/vs_ParticleTraceComets.glsl rename to Fwk/VizFwk/LibRender/glsl/vs_ParticleTraceComets.glsl diff --git a/VisualizationModules/LibRender/glsl/vs_Standard.glsl b/Fwk/VizFwk/LibRender/glsl/vs_Standard.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/vs_Standard.glsl rename to Fwk/VizFwk/LibRender/glsl/vs_Standard.glsl diff --git a/VisualizationModules/LibRender/glsl/vs_VectorDrawer.glsl b/Fwk/VizFwk/LibRender/glsl/vs_VectorDrawer.glsl similarity index 100% rename from VisualizationModules/LibRender/glsl/vs_VectorDrawer.glsl rename to Fwk/VizFwk/LibRender/glsl/vs_VectorDrawer.glsl diff --git a/VisualizationModules/LibViewing/CMakeLists.txt b/Fwk/VizFwk/LibViewing/CMakeLists.txt similarity index 100% rename from VisualizationModules/LibViewing/CMakeLists.txt rename to Fwk/VizFwk/LibViewing/CMakeLists.txt diff --git a/VisualizationModules/LibViewing/cvfClipPlaneSet.cpp b/Fwk/VizFwk/LibViewing/cvfClipPlaneSet.cpp similarity index 82% rename from VisualizationModules/LibViewing/cvfClipPlaneSet.cpp rename to Fwk/VizFwk/LibViewing/cvfClipPlaneSet.cpp index 1b76aab4c3..5f0aba5f0a 100644 --- a/VisualizationModules/LibViewing/cvfClipPlaneSet.cpp +++ b/Fwk/VizFwk/LibViewing/cvfClipPlaneSet.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfClipPlaneSet.h" #include "cvfUniformSet.h" diff --git a/VisualizationModules/LibViewing/cvfClipPlaneSet.h b/Fwk/VizFwk/LibViewing/cvfClipPlaneSet.h similarity index 61% rename from VisualizationModules/LibViewing/cvfClipPlaneSet.h rename to Fwk/VizFwk/LibViewing/cvfClipPlaneSet.h index 287d3e7a6c..54964765ff 100644 --- a/VisualizationModules/LibViewing/cvfClipPlaneSet.h +++ b/Fwk/VizFwk/LibViewing/cvfClipPlaneSet.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfPlane.h" diff --git a/VisualizationModules/LibViewing/cvfConstantFrameRate.cpp b/Fwk/VizFwk/LibViewing/cvfConstantFrameRate.cpp similarity index 89% rename from VisualizationModules/LibViewing/cvfConstantFrameRate.cpp rename to Fwk/VizFwk/LibViewing/cvfConstantFrameRate.cpp index cd0101fcf2..6fe6a3b3b7 100644 --- a/VisualizationModules/LibViewing/cvfConstantFrameRate.cpp +++ b/Fwk/VizFwk/LibViewing/cvfConstantFrameRate.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfConstantFrameRate.h" #include "cvfTrace.h" @@ -132,7 +150,7 @@ void ConstantFrameRate::attachRendering(Rendering* rendering) RenderQueueSorterTargetFramerate* rqs = new RenderQueueSorterTargetFramerate; m_rendering->setRenderQueueSorter(rqs); - // Currently, we need to enable pixel size culling in order to get CeeViz to + // Currently, we need to enable pixel size culling in order to // compute the screen projected areas of the part's bounding boxes m_rendering->cullSettings()->enablePixelSizeCulling(true); diff --git a/VisualizationModules/LibViewing/cvfConstantFrameRate.h b/Fwk/VizFwk/LibViewing/cvfConstantFrameRate.h similarity index 67% rename from VisualizationModules/LibViewing/cvfConstantFrameRate.h rename to Fwk/VizFwk/LibViewing/cvfConstantFrameRate.h index 1f85c12aa9..9270afe024 100644 --- a/VisualizationModules/LibViewing/cvfConstantFrameRate.h +++ b/Fwk/VizFwk/LibViewing/cvfConstantFrameRate.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRendering.h" diff --git a/VisualizationModules/LibViewing/cvfCullSettings.cpp b/Fwk/VizFwk/LibViewing/cvfCullSettings.cpp similarity index 75% rename from VisualizationModules/LibViewing/cvfCullSettings.cpp rename to Fwk/VizFwk/LibViewing/cvfCullSettings.cpp index 50b1db232d..6ff0083bbb 100644 --- a/VisualizationModules/LibViewing/cvfCullSettings.cpp +++ b/Fwk/VizFwk/LibViewing/cvfCullSettings.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfCullSettings.h" diff --git a/VisualizationModules/LibViewing/cvfCullSettings.h b/Fwk/VizFwk/LibViewing/cvfCullSettings.h similarity index 60% rename from VisualizationModules/LibViewing/cvfCullSettings.h rename to Fwk/VizFwk/LibViewing/cvfCullSettings.h index 421fb0cf60..f716a90a43 100644 --- a/VisualizationModules/LibViewing/cvfCullSettings.h +++ b/Fwk/VizFwk/LibViewing/cvfCullSettings.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfDynamicUniformSet.cpp b/Fwk/VizFwk/LibViewing/cvfDynamicUniformSet.cpp similarity index 59% rename from VisualizationModules/LibViewing/cvfDynamicUniformSet.cpp rename to Fwk/VizFwk/LibViewing/cvfDynamicUniformSet.cpp index f68a027fb4..f9f19d4211 100644 --- a/VisualizationModules/LibViewing/cvfDynamicUniformSet.cpp +++ b/Fwk/VizFwk/LibViewing/cvfDynamicUniformSet.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfDynamicUniformSet.h" #include "cvfRendering.h" diff --git a/VisualizationModules/LibViewing/cvfDynamicUniformSet.h b/Fwk/VizFwk/LibViewing/cvfDynamicUniformSet.h similarity index 53% rename from VisualizationModules/LibViewing/cvfDynamicUniformSet.h rename to Fwk/VizFwk/LibViewing/cvfDynamicUniformSet.h index d133664e7e..d716e17e68 100644 --- a/VisualizationModules/LibViewing/cvfDynamicUniformSet.h +++ b/Fwk/VizFwk/LibViewing/cvfDynamicUniformSet.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfEffect.cpp b/Fwk/VizFwk/LibViewing/cvfEffect.cpp similarity index 89% rename from VisualizationModules/LibViewing/cvfEffect.cpp rename to Fwk/VizFwk/LibViewing/cvfEffect.cpp index 9ce3c26a31..9711a02503 100644 --- a/VisualizationModules/LibViewing/cvfEffect.cpp +++ b/Fwk/VizFwk/LibViewing/cvfEffect.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfEffect.h" #include "cvfTexture.h" diff --git a/VisualizationModules/LibViewing/cvfEffect.h b/Fwk/VizFwk/LibViewing/cvfEffect.h similarity index 69% rename from VisualizationModules/LibViewing/cvfEffect.h rename to Fwk/VizFwk/LibViewing/cvfEffect.h index adbc123a3d..3aff88f455 100644 --- a/VisualizationModules/LibViewing/cvfEffect.h +++ b/Fwk/VizFwk/LibViewing/cvfEffect.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfFixedSizeTransform.cpp b/Fwk/VizFwk/LibViewing/cvfFixedSizeTransform.cpp similarity index 76% rename from VisualizationModules/LibViewing/cvfFixedSizeTransform.cpp rename to Fwk/VizFwk/LibViewing/cvfFixedSizeTransform.cpp index 6c0e754bda..fed21720d3 100644 --- a/VisualizationModules/LibViewing/cvfFixedSizeTransform.cpp +++ b/Fwk/VizFwk/LibViewing/cvfFixedSizeTransform.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfFixedSizeTransform.h" diff --git a/VisualizationModules/LibViewing/cvfFixedSizeTransform.h b/Fwk/VizFwk/LibViewing/cvfFixedSizeTransform.h similarity index 55% rename from VisualizationModules/LibViewing/cvfFixedSizeTransform.h rename to Fwk/VizFwk/LibViewing/cvfFixedSizeTransform.h index 6d5cd3bb9b..ba95891ed0 100644 --- a/VisualizationModules/LibViewing/cvfFixedSizeTransform.h +++ b/Fwk/VizFwk/LibViewing/cvfFixedSizeTransform.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfMatrix4.h" diff --git a/VisualizationModules/LibViewing/cvfGaussianBlur.cpp b/Fwk/VizFwk/LibViewing/cvfGaussianBlur.cpp similarity index 88% rename from VisualizationModules/LibViewing/cvfGaussianBlur.cpp rename to Fwk/VizFwk/LibViewing/cvfGaussianBlur.cpp index 80a02d785c..f2e30469e0 100644 --- a/VisualizationModules/LibViewing/cvfGaussianBlur.cpp +++ b/Fwk/VizFwk/LibViewing/cvfGaussianBlur.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfGaussianBlur.h" #include "cvfTexture.h" diff --git a/VisualizationModules/LibViewing/cvfGaussianBlur.h b/Fwk/VizFwk/LibViewing/cvfGaussianBlur.h similarity index 67% rename from VisualizationModules/LibViewing/cvfGaussianBlur.h rename to Fwk/VizFwk/LibViewing/cvfGaussianBlur.h index 19d1d98dc6..d4d0842a29 100644 --- a/VisualizationModules/LibViewing/cvfGaussianBlur.h +++ b/Fwk/VizFwk/LibViewing/cvfGaussianBlur.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfHitItem.cpp b/Fwk/VizFwk/LibViewing/cvfHitItem.cpp similarity index 76% rename from VisualizationModules/LibViewing/cvfHitItem.cpp rename to Fwk/VizFwk/LibViewing/cvfHitItem.cpp index 30edf05c65..e5e892e236 100644 --- a/VisualizationModules/LibViewing/cvfHitItem.cpp +++ b/Fwk/VizFwk/LibViewing/cvfHitItem.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfHitItem.h" #include "cvfPart.h" diff --git a/VisualizationModules/LibViewing/cvfHitItem.h b/Fwk/VizFwk/LibViewing/cvfHitItem.h similarity index 61% rename from VisualizationModules/LibViewing/cvfHitItem.h rename to Fwk/VizFwk/LibViewing/cvfHitItem.h index 8cde3051f4..12df67ca40 100644 --- a/VisualizationModules/LibViewing/cvfHitItem.h +++ b/Fwk/VizFwk/LibViewing/cvfHitItem.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfHitItemCollection.cpp b/Fwk/VizFwk/LibViewing/cvfHitItemCollection.cpp similarity index 80% rename from VisualizationModules/LibViewing/cvfHitItemCollection.cpp rename to Fwk/VizFwk/LibViewing/cvfHitItemCollection.cpp index a09b781205..eb658d50d6 100644 --- a/VisualizationModules/LibViewing/cvfHitItemCollection.cpp +++ b/Fwk/VizFwk/LibViewing/cvfHitItemCollection.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfHitItemCollection.h" diff --git a/VisualizationModules/LibViewing/cvfHitItemCollection.h b/Fwk/VizFwk/LibViewing/cvfHitItemCollection.h similarity index 57% rename from VisualizationModules/LibViewing/cvfHitItemCollection.h rename to Fwk/VizFwk/LibViewing/cvfHitItemCollection.h index 1c707c446c..342d108398 100644 --- a/VisualizationModules/LibViewing/cvfHitItemCollection.h +++ b/Fwk/VizFwk/LibViewing/cvfHitItemCollection.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfLibViewing.h b/Fwk/VizFwk/LibViewing/cvfLibViewing.h similarity index 57% rename from VisualizationModules/LibViewing/cvfLibViewing.h rename to Fwk/VizFwk/LibViewing/cvfLibViewing.h index 6e224a6415..2a872c6354 100644 --- a/VisualizationModules/LibViewing/cvfLibViewing.h +++ b/Fwk/VizFwk/LibViewing/cvfLibViewing.h @@ -1,24 +1,42 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + // Doxygen module definition -/// \ingroup CeeVizFramework +/// \ingroup VizFramework /// @{ /// \defgroup Viewing Viewing module /// @} diff --git a/VisualizationModules/LibViewing/cvfLocators.cpp b/Fwk/VizFwk/LibViewing/cvfLocators.cpp similarity index 90% rename from VisualizationModules/LibViewing/cvfLocators.cpp rename to Fwk/VizFwk/LibViewing/cvfLocators.cpp index 85e42c33c5..4b5a00668c 100644 --- a/VisualizationModules/LibViewing/cvfLocators.cpp +++ b/Fwk/VizFwk/LibViewing/cvfLocators.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfLocators.h" #include "cvfCamera.h" diff --git a/VisualizationModules/LibViewing/cvfLocators.h b/Fwk/VizFwk/LibViewing/cvfLocators.h similarity index 74% rename from VisualizationModules/LibViewing/cvfLocators.h rename to Fwk/VizFwk/LibViewing/cvfLocators.h index 1ccd5cccff..089a07f051 100644 --- a/VisualizationModules/LibViewing/cvfLocators.h +++ b/Fwk/VizFwk/LibViewing/cvfLocators.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfPlane.h" diff --git a/VisualizationModules/LibViewing/cvfManipulatorTrackball.cpp b/Fwk/VizFwk/LibViewing/cvfManipulatorTrackball.cpp similarity index 94% rename from VisualizationModules/LibViewing/cvfManipulatorTrackball.cpp rename to Fwk/VizFwk/LibViewing/cvfManipulatorTrackball.cpp index c522ccd120..5eeeaf2dfd 100644 --- a/VisualizationModules/LibViewing/cvfManipulatorTrackball.cpp +++ b/Fwk/VizFwk/LibViewing/cvfManipulatorTrackball.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfManipulatorTrackball.h" #include "cvfCamera.h" diff --git a/VisualizationModules/LibViewing/cvfManipulatorTrackball.h b/Fwk/VizFwk/LibViewing/cvfManipulatorTrackball.h similarity index 71% rename from VisualizationModules/LibViewing/cvfManipulatorTrackball.h rename to Fwk/VizFwk/LibViewing/cvfManipulatorTrackball.h index b444844050..6da737324e 100644 --- a/VisualizationModules/LibViewing/cvfManipulatorTrackball.h +++ b/Fwk/VizFwk/LibViewing/cvfManipulatorTrackball.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfModel.cpp b/Fwk/VizFwk/LibViewing/cvfModel.cpp similarity index 79% rename from VisualizationModules/LibViewing/cvfModel.cpp rename to Fwk/VizFwk/LibViewing/cvfModel.cpp index d8333d2429..bed66bb88d 100644 --- a/VisualizationModules/LibViewing/cvfModel.cpp +++ b/Fwk/VizFwk/LibViewing/cvfModel.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfModel.h" #include "cvfOpenGLContext.h" diff --git a/VisualizationModules/LibViewing/cvfModel.h b/Fwk/VizFwk/LibViewing/cvfModel.h similarity index 67% rename from VisualizationModules/LibViewing/cvfModel.h rename to Fwk/VizFwk/LibViewing/cvfModel.h index 52c9f5bb48..cd303f1da1 100644 --- a/VisualizationModules/LibViewing/cvfModel.h +++ b/Fwk/VizFwk/LibViewing/cvfModel.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfCollection.h" diff --git a/VisualizationModules/LibViewing/cvfModelBasicList.cpp b/Fwk/VizFwk/LibViewing/cvfModelBasicList.cpp similarity index 93% rename from VisualizationModules/LibViewing/cvfModelBasicList.cpp rename to Fwk/VizFwk/LibViewing/cvfModelBasicList.cpp index 085ff6188a..946aaa64f3 100644 --- a/VisualizationModules/LibViewing/cvfModelBasicList.cpp +++ b/Fwk/VizFwk/LibViewing/cvfModelBasicList.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfModelBasicList.h" #include "cvfPart.h" diff --git a/VisualizationModules/LibViewing/cvfModelBasicList.h b/Fwk/VizFwk/LibViewing/cvfModelBasicList.h similarity index 69% rename from VisualizationModules/LibViewing/cvfModelBasicList.h rename to Fwk/VizFwk/LibViewing/cvfModelBasicList.h index 20537e3214..4f26a5c04b 100644 --- a/VisualizationModules/LibViewing/cvfModelBasicList.h +++ b/Fwk/VizFwk/LibViewing/cvfModelBasicList.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfModel.h" diff --git a/VisualizationModules/LibViewing/cvfModelBasicTree.cpp b/Fwk/VizFwk/LibViewing/cvfModelBasicTree.cpp similarity index 95% rename from VisualizationModules/LibViewing/cvfModelBasicTree.cpp rename to Fwk/VizFwk/LibViewing/cvfModelBasicTree.cpp index 3b5ff97ff4..3c314f2310 100644 --- a/VisualizationModules/LibViewing/cvfModelBasicTree.cpp +++ b/Fwk/VizFwk/LibViewing/cvfModelBasicTree.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfModelBasicTree.h" #include "cvfPart.h" diff --git a/VisualizationModules/LibViewing/cvfModelBasicTree.h b/Fwk/VizFwk/LibViewing/cvfModelBasicTree.h similarity index 79% rename from VisualizationModules/LibViewing/cvfModelBasicTree.h rename to Fwk/VizFwk/LibViewing/cvfModelBasicTree.h index 9853eb999d..008be0e30d 100644 --- a/VisualizationModules/LibViewing/cvfModelBasicTree.h +++ b/Fwk/VizFwk/LibViewing/cvfModelBasicTree.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfModelBasicList.h" diff --git a/VisualizationModules/LibViewing/cvfPart.cpp b/Fwk/VizFwk/LibViewing/cvfPart.cpp similarity index 93% rename from VisualizationModules/LibViewing/cvfPart.cpp rename to Fwk/VizFwk/LibViewing/cvfPart.cpp index 1096f366f7..77ca76d751 100644 --- a/VisualizationModules/LibViewing/cvfPart.cpp +++ b/Fwk/VizFwk/LibViewing/cvfPart.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfPart.h" #include "cvfDrawable.h" diff --git a/VisualizationModules/LibViewing/cvfPart.h b/Fwk/VizFwk/LibViewing/cvfPart.h similarity index 77% rename from VisualizationModules/LibViewing/cvfPart.h rename to Fwk/VizFwk/LibViewing/cvfPart.h index 4cdf404caf..997a4dba52 100644 --- a/VisualizationModules/LibViewing/cvfPart.h +++ b/Fwk/VizFwk/LibViewing/cvfPart.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfPartHighlighter.cpp b/Fwk/VizFwk/LibViewing/cvfPartHighlighter.cpp similarity index 94% rename from VisualizationModules/LibViewing/cvfPartHighlighter.cpp rename to Fwk/VizFwk/LibViewing/cvfPartHighlighter.cpp index 3570c13617..8ba35959fb 100644 --- a/VisualizationModules/LibViewing/cvfPartHighlighter.cpp +++ b/Fwk/VizFwk/LibViewing/cvfPartHighlighter.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfPartHighlighter.h" #include "cvfRenderSequence.h" diff --git a/VisualizationModules/LibViewing/cvfPartHighlighter.h b/Fwk/VizFwk/LibViewing/cvfPartHighlighter.h similarity index 79% rename from VisualizationModules/LibViewing/cvfPartHighlighter.h rename to Fwk/VizFwk/LibViewing/cvfPartHighlighter.h index ea88af85d8..2b48495eba 100644 --- a/VisualizationModules/LibViewing/cvfPartHighlighter.h +++ b/Fwk/VizFwk/LibViewing/cvfPartHighlighter.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfPartRenderHintCollection.cpp b/Fwk/VizFwk/LibViewing/cvfPartRenderHintCollection.cpp similarity index 85% rename from VisualizationModules/LibViewing/cvfPartRenderHintCollection.cpp rename to Fwk/VizFwk/LibViewing/cvfPartRenderHintCollection.cpp index 04a70c172b..7044cf5c17 100644 --- a/VisualizationModules/LibViewing/cvfPartRenderHintCollection.cpp +++ b/Fwk/VizFwk/LibViewing/cvfPartRenderHintCollection.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfPartRenderHintCollection.h" diff --git a/VisualizationModules/LibViewing/cvfPartRenderHintCollection.h b/Fwk/VizFwk/LibViewing/cvfPartRenderHintCollection.h similarity index 68% rename from VisualizationModules/LibViewing/cvfPartRenderHintCollection.h rename to Fwk/VizFwk/LibViewing/cvfPartRenderHintCollection.h index 29d07d7142..d49e922155 100644 --- a/VisualizationModules/LibViewing/cvfPartRenderHintCollection.h +++ b/Fwk/VizFwk/LibViewing/cvfPartRenderHintCollection.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfCollection.h" diff --git a/VisualizationModules/LibViewing/cvfPerformanceInfo.cpp b/Fwk/VizFwk/LibViewing/cvfPerformanceInfo.cpp similarity index 80% rename from VisualizationModules/LibViewing/cvfPerformanceInfo.cpp rename to Fwk/VizFwk/LibViewing/cvfPerformanceInfo.cpp index 9232a7da13..490e875325 100644 --- a/VisualizationModules/LibViewing/cvfPerformanceInfo.cpp +++ b/Fwk/VizFwk/LibViewing/cvfPerformanceInfo.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfPerformanceInfo.h" #include "cvfMath.h" diff --git a/VisualizationModules/LibViewing/cvfPerformanceInfo.h b/Fwk/VizFwk/LibViewing/cvfPerformanceInfo.h similarity index 69% rename from VisualizationModules/LibViewing/cvfPerformanceInfo.h rename to Fwk/VizFwk/LibViewing/cvfPerformanceInfo.h index 275c6c16c9..1143de9b07 100644 --- a/VisualizationModules/LibViewing/cvfPerformanceInfo.h +++ b/Fwk/VizFwk/LibViewing/cvfPerformanceInfo.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once namespace cvf { diff --git a/VisualizationModules/LibViewing/cvfRayIntersectSpec.cpp b/Fwk/VizFwk/LibViewing/cvfRayIntersectSpec.cpp similarity index 77% rename from VisualizationModules/LibViewing/cvfRayIntersectSpec.cpp rename to Fwk/VizFwk/LibViewing/cvfRayIntersectSpec.cpp index 011a20a707..74087bf214 100644 --- a/VisualizationModules/LibViewing/cvfRayIntersectSpec.cpp +++ b/Fwk/VizFwk/LibViewing/cvfRayIntersectSpec.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRayIntersectSpec.h" #include "cvfRay.h" diff --git a/VisualizationModules/LibViewing/cvfRayIntersectSpec.h b/Fwk/VizFwk/LibViewing/cvfRayIntersectSpec.h similarity index 59% rename from VisualizationModules/LibViewing/cvfRayIntersectSpec.h rename to Fwk/VizFwk/LibViewing/cvfRayIntersectSpec.h index 146089fefb..3e7c12b96c 100644 --- a/VisualizationModules/LibViewing/cvfRayIntersectSpec.h +++ b/Fwk/VizFwk/LibViewing/cvfRayIntersectSpec.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfRenderEngine.cpp b/Fwk/VizFwk/LibViewing/cvfRenderEngine.cpp similarity index 93% rename from VisualizationModules/LibViewing/cvfRenderEngine.cpp rename to Fwk/VizFwk/LibViewing/cvfRenderEngine.cpp index 2c9ef45986..1869342b8f 100644 --- a/VisualizationModules/LibViewing/cvfRenderEngine.cpp +++ b/Fwk/VizFwk/LibViewing/cvfRenderEngine.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderEngine.h" #include "cvfRenderQueue.h" diff --git a/VisualizationModules/LibViewing/cvfRenderEngine.h b/Fwk/VizFwk/LibViewing/cvfRenderEngine.h similarity index 71% rename from VisualizationModules/LibViewing/cvfRenderEngine.h rename to Fwk/VizFwk/LibViewing/cvfRenderEngine.h index d1d15afeb1..7ecf542883 100644 --- a/VisualizationModules/LibViewing/cvfRenderEngine.h +++ b/Fwk/VizFwk/LibViewing/cvfRenderEngine.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfMatrix4.h" diff --git a/VisualizationModules/LibViewing/cvfRenderQueue.cpp b/Fwk/VizFwk/LibViewing/cvfRenderQueue.cpp similarity index 82% rename from VisualizationModules/LibViewing/cvfRenderQueue.cpp rename to Fwk/VizFwk/LibViewing/cvfRenderQueue.cpp index e5895c7888..3264d240e5 100644 --- a/VisualizationModules/LibViewing/cvfRenderQueue.cpp +++ b/Fwk/VizFwk/LibViewing/cvfRenderQueue.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderQueue.h" diff --git a/VisualizationModules/LibViewing/cvfRenderQueue.h b/Fwk/VizFwk/LibViewing/cvfRenderQueue.h similarity index 73% rename from VisualizationModules/LibViewing/cvfRenderQueue.h rename to Fwk/VizFwk/LibViewing/cvfRenderQueue.h index 79899e0e6b..f1e2d553c3 100644 --- a/VisualizationModules/LibViewing/cvfRenderQueue.h +++ b/Fwk/VizFwk/LibViewing/cvfRenderQueue.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfRenderQueueBuilder.cpp b/Fwk/VizFwk/LibViewing/cvfRenderQueueBuilder.cpp similarity index 88% rename from VisualizationModules/LibViewing/cvfRenderQueueBuilder.cpp rename to Fwk/VizFwk/LibViewing/cvfRenderQueueBuilder.cpp index 6f1f608668..fc39e82522 100644 --- a/VisualizationModules/LibViewing/cvfRenderQueueBuilder.cpp +++ b/Fwk/VizFwk/LibViewing/cvfRenderQueueBuilder.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderQueueBuilder.h" #include "cvfRenderQueue.h" diff --git a/VisualizationModules/LibViewing/cvfRenderQueueBuilder.h b/Fwk/VizFwk/LibViewing/cvfRenderQueueBuilder.h similarity index 66% rename from VisualizationModules/LibViewing/cvfRenderQueueBuilder.h rename to Fwk/VizFwk/LibViewing/cvfRenderQueueBuilder.h index f2124f900b..f93e4e38e3 100644 --- a/VisualizationModules/LibViewing/cvfRenderQueueBuilder.h +++ b/Fwk/VizFwk/LibViewing/cvfRenderQueueBuilder.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfRenderQueueSorter.cpp b/Fwk/VizFwk/LibViewing/cvfRenderQueueSorter.cpp similarity index 92% rename from VisualizationModules/LibViewing/cvfRenderQueueSorter.cpp rename to Fwk/VizFwk/LibViewing/cvfRenderQueueSorter.cpp index 324ba49b01..d1c8341909 100644 --- a/VisualizationModules/LibViewing/cvfRenderQueueSorter.cpp +++ b/Fwk/VizFwk/LibViewing/cvfRenderQueueSorter.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderQueueSorter.h" #include "cvfRenderQueue.h" diff --git a/VisualizationModules/LibViewing/cvfRenderQueueSorter.h b/Fwk/VizFwk/LibViewing/cvfRenderQueueSorter.h similarity index 74% rename from VisualizationModules/LibViewing/cvfRenderQueueSorter.h rename to Fwk/VizFwk/LibViewing/cvfRenderQueueSorter.h index 158281483d..9eb439eb0e 100644 --- a/VisualizationModules/LibViewing/cvfRenderQueueSorter.h +++ b/Fwk/VizFwk/LibViewing/cvfRenderQueueSorter.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfRenderSequence.cpp b/Fwk/VizFwk/LibViewing/cvfRenderSequence.cpp similarity index 91% rename from VisualizationModules/LibViewing/cvfRenderSequence.cpp rename to Fwk/VizFwk/LibViewing/cvfRenderSequence.cpp index 13982c6ba8..b510222bc7 100644 --- a/VisualizationModules/LibViewing/cvfRenderSequence.cpp +++ b/Fwk/VizFwk/LibViewing/cvfRenderSequence.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRenderSequence.h" #include "cvfRendering.h" @@ -318,7 +336,7 @@ void RenderSequence::preRenderApplyExpectedOpenGLState(OpenGLContext* oglContext // These settings differ from OpenGL defaults, - // but form a suitable starting point for rendering with CeeViz + // but form a suitable starting point for rendering // ------------------------------------------------ // TODO Work out a proper solution for this diff --git a/VisualizationModules/LibViewing/cvfRenderSequence.h b/Fwk/VizFwk/LibViewing/cvfRenderSequence.h similarity index 67% rename from VisualizationModules/LibViewing/cvfRenderSequence.h rename to Fwk/VizFwk/LibViewing/cvfRenderSequence.h index 8902ef8a35..95ca1a5411 100644 --- a/VisualizationModules/LibViewing/cvfRenderSequence.h +++ b/Fwk/VizFwk/LibViewing/cvfRenderSequence.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfRendering.cpp b/Fwk/VizFwk/LibViewing/cvfRendering.cpp similarity index 97% rename from VisualizationModules/LibViewing/cvfRendering.cpp rename to Fwk/VizFwk/LibViewing/cvfRendering.cpp index 013d5769ec..bf931824d1 100644 --- a/VisualizationModules/LibViewing/cvfRendering.cpp +++ b/Fwk/VizFwk/LibViewing/cvfRendering.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfRendering.h" #include "cvfScene.h" diff --git a/VisualizationModules/LibViewing/cvfRendering.h b/Fwk/VizFwk/LibViewing/cvfRendering.h similarity index 86% rename from VisualizationModules/LibViewing/cvfRendering.h rename to Fwk/VizFwk/LibViewing/cvfRendering.h index e652e8b482..f70a3f1cab 100644 --- a/VisualizationModules/LibViewing/cvfRendering.h +++ b/Fwk/VizFwk/LibViewing/cvfRendering.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfRenderEngine.h" diff --git a/VisualizationModules/LibViewing/cvfScene.cpp b/Fwk/VizFwk/LibViewing/cvfScene.cpp similarity index 86% rename from VisualizationModules/LibViewing/cvfScene.cpp rename to Fwk/VizFwk/LibViewing/cvfScene.cpp index 8ba50f9211..acc1275c9f 100644 --- a/VisualizationModules/LibViewing/cvfScene.cpp +++ b/Fwk/VizFwk/LibViewing/cvfScene.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfScene.h" #include "cvfModel.h" diff --git a/VisualizationModules/LibViewing/cvfScene.h b/Fwk/VizFwk/LibViewing/cvfScene.h similarity index 65% rename from VisualizationModules/LibViewing/cvfScene.h rename to Fwk/VizFwk/LibViewing/cvfScene.h index 3f922b9c84..e86272bc56 100644 --- a/VisualizationModules/LibViewing/cvfScene.h +++ b/Fwk/VizFwk/LibViewing/cvfScene.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfObject.h" diff --git a/VisualizationModules/LibViewing/cvfSingleQuadRenderingGenerator.cpp b/Fwk/VizFwk/LibViewing/cvfSingleQuadRenderingGenerator.cpp similarity index 86% rename from VisualizationModules/LibViewing/cvfSingleQuadRenderingGenerator.cpp rename to Fwk/VizFwk/LibViewing/cvfSingleQuadRenderingGenerator.cpp index a145745f8d..2eceecb98c 100644 --- a/VisualizationModules/LibViewing/cvfSingleQuadRenderingGenerator.cpp +++ b/Fwk/VizFwk/LibViewing/cvfSingleQuadRenderingGenerator.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfSingleQuadRenderingGenerator.h" #include "cvfPrimitiveSetIndexedUShort.h" diff --git a/VisualizationModules/LibViewing/cvfSingleQuadRenderingGenerator.h b/Fwk/VizFwk/LibViewing/cvfSingleQuadRenderingGenerator.h similarity index 62% rename from VisualizationModules/LibViewing/cvfSingleQuadRenderingGenerator.h rename to Fwk/VizFwk/LibViewing/cvfSingleQuadRenderingGenerator.h index 9d75aaf8f2..d5798cf54e 100644 --- a/VisualizationModules/LibViewing/cvfSingleQuadRenderingGenerator.h +++ b/Fwk/VizFwk/LibViewing/cvfSingleQuadRenderingGenerator.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfCollection.h" diff --git a/VisualizationModules/LibViewing/cvfTransform.cpp b/Fwk/VizFwk/LibViewing/cvfTransform.cpp similarity index 85% rename from VisualizationModules/LibViewing/cvfTransform.cpp rename to Fwk/VizFwk/LibViewing/cvfTransform.cpp index c69146e7b2..c86c0e5752 100644 --- a/VisualizationModules/LibViewing/cvfTransform.cpp +++ b/Fwk/VizFwk/LibViewing/cvfTransform.cpp @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #include "cvfBase.h" #include "cvfTransform.h" #include "cvfBoundingBox.h" diff --git a/VisualizationModules/LibViewing/cvfTransform.h b/Fwk/VizFwk/LibViewing/cvfTransform.h similarity index 65% rename from VisualizationModules/LibViewing/cvfTransform.h rename to Fwk/VizFwk/LibViewing/cvfTransform.h index d60bd393dd..8f4f88c307 100644 --- a/VisualizationModules/LibViewing/cvfTransform.h +++ b/Fwk/VizFwk/LibViewing/cvfTransform.h @@ -1,22 +1,40 @@ //################################################################################################## // // Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. // //################################################################################################## + #pragma once #include "cvfMatrix4.h" diff --git a/OctavePlugin/CMakeLists.txt b/OctavePlugin/CMakeLists.txt index bfc5962f28..1624b153c0 100644 --- a/OctavePlugin/CMakeLists.txt +++ b/OctavePlugin/CMakeLists.txt @@ -140,18 +140,26 @@ else() # Copy Octave generated *.oct files to application folder, will make it possible to use Octave functions # directly from the location of the ResInsight binaries - if (MSVC) + if (true) foreach (oct_bin ${OCTAVE_BINARY_OCT_FILES}) get_filename_component(Filename "${oct_bin}" NAME) - add_custom_command(TARGET octave_plugins POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${oct_bin}" - "${CMAKE_CURRENT_BINARY_DIR}/../ApplicationCode/$/${Filename}" - ) + if(MSVC) + add_custom_command(TARGET octave_plugins POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${oct_bin}" + "${CMAKE_CURRENT_BINARY_DIR}/../ApplicationCode/$/${Filename}" + ) + else() + add_custom_command(TARGET octave_plugins POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${oct_bin}" + "${CMAKE_CURRENT_BINARY_DIR}/../ApplicationCode/${Filename}" + ) + endif() endforeach( oct_bin ) - endif(MSVC) + endif() # Make ResInsight dependant on Octave, makes it easiser to debug Octave functionality by compiling ResInsight add_dependencies(ResInsight octave_plugins) diff --git a/OctavePlugin/OctaveScripts/OctaveInterfaceTest.m b/OctavePlugin/OctaveScripts/OctaveInterfaceTest.m new file mode 100644 index 0000000000..63ddcb9753 --- /dev/null +++ b/OctavePlugin/OctaveScripts/OctaveInterfaceTest.m @@ -0,0 +1,328 @@ +### The case with caseid 1 has to be selected/active in ResInsight when running this test-script +### Coarsening and Dual porosity is not exercised by this tes yet. We need models + +### CaseInfo riGetCurrentCase() +%!test +%! printf ("===== Testing ====> riGetCurrentCase\n"); +%! caseInfo = riGetCurrentCase(); +%! assert ( caseInfo.CaseId == 1 ); +%! assert ( caseInfo.CaseName == "BRUGGE_0000" ); +%! assert ( caseInfo.CaseType == "SourceCase" ); +%! assert ( caseInfo.CaseGroupId == 0 ); + +### Vector[CaseInfo] riGetSelectedCases() +%!test +%! printf ("===== Testing ====> riGetSelectedCases\n"); +%! caseInfoVector1 = riGetSelectedCases(); +%! assert ( caseInfoVector1.CaseId == 1 ); +%! assert ( caseInfoVector1.CaseName == "BRUGGE_0000" ); +%! assert ( caseInfoVector1.CaseType == "SourceCase" ); +%! assert ( caseInfoVector1.CaseGroupId == 0 ); + + +### Vector[CaseGroupInfo] riGetCaseGroups() +%!test +%! printf ("===== Testing ====> riGetCaseGroups\n"); +%! caseGroupInfoVector = riGetCaseGroups(); +%! assert (rows(caseGroupInfoVector) == 2); +%! assert (caseGroupInfoVector(2).CaseGroupId == 1); +%! assert (caseGroupInfoVector(2).CaseGroupName == "Grid Case Group 2"); + +### Vector[CaseInfo] riGetCases([CaseGroupId]) +%!test +%! printf ("===== Testing ====> riGetCases\n"); +%! caseInfoVector3 = riGetCases(); +%! assert(rows(caseInfoVector3) == 10); +%! assert(caseInfoVector3(2).CaseName == "BRUGGE_0040"); +%! assert(caseInfoVector3(2).CaseType == "ResultCase"); +%! assert(caseInfoVector3(3).CaseType == "StatisticsCase"); +%! assert(caseInfoVector3(4).CaseType == "SourceCase"); +%! caseinfoVector3 = riGetCases(1); +%! assert(rows(caseinfoVector3) == 3); + + +### Matrix[numActiveCells][9] riGetActiveCellInfo([CaseId], [PorosityModel = "Matrix"|"Fracture"] ) +%!test +%! printf ("===== Testing ====> riGetActiveCellInfo\n"); +%! ACInfo1 = riGetActiveCellInfo(); +%! assert(rows(ACInfo1) == 43374); +%! assert(columns(ACInfo1) == 9); +%! ACInfo2 = riGetActiveCellInfo("Matrix"); +%! assert(ACInfo1 == ACInfo2); +%! ACInfo3 = riGetActiveCellInfo(1, "Matrix"); +%! assert(ACInfo1 == ACInfo3); +%! ACInfo4 = riGetActiveCellInfo(1); +%! assert(ACInfo1 == ACInfo4); + +### Matrix[numCoarseGroups][6] riGetCoarseningInfo([CaseId]) +%!test +%! printf ("===== Testing ====> riGetCoarseningInfo\n"); +%! CoarseInfo1 = riGetCoarseningInfo(); +%! assert(rows(CoarseInfo1) == 0); +%! assert(columns(CoarseInfo1) == 6); +%! CoarseInfo2 = riGetCoarseningInfo(1); +%! assert(CoarseInfo1 == CoarseInfo2); + +### Matrix[numGrids][3] riGetGridDimensions([CaseId]) +%!test +%! printf ("===== Testing ====> riGetGridDimensions\n"); +%! GridDims1 = riGetGridDimensions(); +%! assert(rows(GridDims1) == 1); +%! assert(columns(GridDims1) == 3); + +%! GridDims2 = riGetGridDimensions(0); +%! assert(rows(GridDims2) == 2); +%! assert(columns(GridDims2) == 3); +%! assert( GridDims2(2,1) == 12); +%! assert( GridDims2(2,3) == 36); + +### Vector[TimeStepDate] riGetTimestepDates([CaseId]) +%!test +%! printf ("===== Testing ====> riGetTimestepDates\n"); +%! TimeStepDates1 = riGetTimeStepDates(); +%! assert(rows(TimeStepDates1) == 11); +%! assert(TimeStepDates1(2).Year == 1997); +%! assert(TimeStepDates1(2).Month == 01); +%! assert(TimeStepDates1(2).Day == 31); +%! assert(TimeStepDates1(2).Hour == 0); +%! assert(TimeStepDates1(2).Minute == 0); +%! assert(TimeStepDates1(2).Second == 0); +%! TimeStepDates2 = riGetTimeStepDates(1); +%! assert(TimeStepDates2(7).Year == 1997); +%! assert(TimeStepDates2(7).Month == 06); +%! assert(TimeStepDates2(7).Day == 30); +%! assert(TimeStepDates2(7).Hour == 0); +%! assert(TimeStepDates2(7).Minute == 0); +%! assert(TimeStepDates2(7).Second == 0); + +### Vector[DecimalDay] riGetTimestepDays([CaseId]) +%!test +%! printf ("===== Testing ====> riGetTimestepDays\n"); +%! TimeStepDays1 = riGetTimeStepDays(); +%! assert(TimeStepDays1(1) == 0); +%! assert(TimeStepDays1(2) == 30); +%! assert(rows(TimeStepDays1) == 11); +%! TimeStepDays2 = riGetTimeStepDays(1); +%! assert(rows(TimeStepDays2) == 11); + + +### Vector[PropertyInfo] riGetPropertyNames([CaseId] ], [PorosityModel = "Matrix"|"Fracture"]) +%!xtest +%! printf ("===== Testing ====> riGetPropertyNames\n"); +%! PropertyInfos1 = riGetPropertyNames(); +%! PropertyInfos2 = riGetPropertyNames(1); +%! PropertyInfos3 = riGetPropertyNames("Matrix"); +%! PropertyInfos4 = riGetPropertyNames(1, "Matrix"); +%! assert(rows(PropertyInfos1) == 26) +%! assert(PropertyInfos1(1).PropName == "PRESSURE"); +%! assert(PropertyInfos1(1).PropType == "DynamicNative"); +%! assert(PropertyInfos1(26).PropType == "StaticNative"); + +### Matrix[numActiveCells][numTimestepsRequested] riGetActiveCellProperty([CaseId], PropertyName, [RequestedTimeSteps], [PorosityModel = "Matrix"|"Fracture"]) +%!test +%! printf ("===== Testing ====> riGetActiveCellProperty\n"); +%! ActivePropData1 = riGetActiveCellProperty("SOIL"); +%! assert (rows(ActivePropData1) == rows(riGetActiveCellInfo())); +%! assert (columns(ActivePropData1) == rows(riGetTimeStepDays())); +%! ActivePropData2 = riGetActiveCellProperty("SOIL", "Matrix"); +%! assert (ActivePropData2 == ActivePropData1); +%! ActivePropData3 = riGetActiveCellProperty("SOIL", [1,3]); +%! assert (columns(ActivePropData3) == 2); +%! assert (ActivePropData3(:,2) == ActivePropData1(:,3)); +%! ActivePropData4 = riGetActiveCellProperty("SOIL", [1,3], "Matrix"); +%! assert (ActivePropData3 == ActivePropData4); +%! ActivePropData5 = riGetActiveCellProperty(1, "SOIL"); +%! assert (ActivePropData5 == ActivePropData1); +%! ActivePropData6 = riGetActiveCellProperty(1, "SOIL", [1,3]); +%! assert (ActivePropData6 == ActivePropData3); +%! ActivePropData7 = riGetActiveCellProperty(1, "SOIL", [1,3], "Matrix"); +%! assert (ActivePropData7 == ActivePropData3); +%! ActivePropData8 = riGetActiveCellProperty(1, "SOIL", "Matrix"); +%! assert (ActivePropData8 == ActivePropData1); + +### Matrix[numI][numJ][numK][numTimestepsRequested] riGetGridProperty([CaseId], GridIndex , PropertyName, [RequestedTimeSteps], [PorosityModel = "Matrix"|"Fracture"]) +%!test +%! printf ("===== Testing ====> riGetGridProperty\n"); +%! GridProps1 = riGetGridProperty( 0 , "SOIL" ); +%! assert( ndims (GridProps1) == 4); +%! [ni, nj, nk, nts ] = size(GridProps1); +%! disp(nts); +%! assert(nts == 11); +%! assert(ni == 139); +%! assert(nj == 48); +%! assert(nk == 9); +%! assert(GridProps1(62,30,1,3), 0.59058, 0.00001); + +%! GridProps2 = riGetGridProperty( 0 , "SOIL", [1,3]); +%! assert( ndims (GridProps2) == 4); +%! [ni, nj, nk, nts ] = size(GridProps2); +%! assert(nts == 2); +%! assert(ni == 139); +%! assert(nj == 48); +%! assert(nk == 9); +%! assert(GridProps2(62,30,1,2), 0.59058, 0.00001); + +%! GridProps3 = riGetGridProperty( 0 , "SOIL", [1,3], "Matrix"); +%! GridProps4 = riGetGridProperty( 0 , "SOIL", "Matrix"); +%! GridProps5 = riGetGridProperty(1, 0 , "SOIL" ); +%! GridProps6 = riGetGridProperty(1, 0 , "SOIL", [1,3]); +%! GridProps7 = riGetGridProperty(1, 0 , "SOIL", [1,3], "Matrix"); +%! GridProps8 = riGetGridProperty(1, 0 , "SOIL", "Matrix"); + +%! assert(GridProps3 == GridProps2); +%! assert(GridProps4 == GridProps1); +%! assert(GridProps5 == GridProps1); +%! assert(GridProps6 == GridProps2); +%! assert(GridProps7 == GridProps2); +%! assert(GridProps8 == GridProps1); + + + ### riSetActiveCellProperty( Matrix[numActiveCells][numTimeSteps], [CaseId], PropertyName, [TimeStepIndices], [PorosityModel = "Matrix"|"Fracture"]) +%!test +%! printf ("===== Testing ====> riSetActiveCellProperty\n"); +%! ActivePropData1 = riGetActiveCellProperty("SOIL"); +%! ActivePropData3 = riGetActiveCellProperty("SOIL", [1,3]); + +%! riSetActiveCellProperty( ActivePropData1, "PropertyName1" ); +%! riSetActiveCellProperty( ActivePropData3, "PropertyName2", [1,3]); +%! riSetActiveCellProperty( ActivePropData3, "PropertyName3", [1,3], "Matrix"); +%! riSetActiveCellProperty( ActivePropData1, "PropertyName4", "Matrix"); +%! riSetActiveCellProperty( ActivePropData1, 1, "PropertyName5" ); +%! riSetActiveCellProperty( ActivePropData3, 1, "PropertyName6", [1,3]); +%! riSetActiveCellProperty( ActivePropData3, 1, "PropertyName7", [1,3], "Matrix"); +%! riSetActiveCellProperty( ActivePropData1, 1, "PropertyName8", "Matrix"); + +%! assert(ActivePropData1 == riGetActiveCellProperty("PropertyName1")); +%! assert(ActivePropData3 == riGetActiveCellProperty("PropertyName2", [1,3])); +%! assert(ActivePropData3 == riGetActiveCellProperty("PropertyName3", [1,3])); +%! assert(ActivePropData1 == riGetActiveCellProperty("PropertyName4", "Matrix")); +%! assert(ActivePropData1 == riGetActiveCellProperty("PropertyName5")); +%! assert(ActivePropData3 == riGetActiveCellProperty( 1, "PropertyName6", [1,3])); +%! assert(ActivePropData3 == riGetActiveCellProperty( 1, "PropertyName7", [1,3], "Matrix")); +%! assert(ActivePropData1 == riGetActiveCellProperty( 1, "PropertyName8", "Matrix")); + +### riSetGridProperty( Matrix[numI][numJ][numK][numTimeSteps], [CaseId], GridIndex, PropertyName, [TimeStepIndices], [PorosityModel = "Matrix"|"Fracture"]) +%!test +%! printf ("===== Testing ====> riSetGridProperty\n"); +%! GridProps1 = riGetGridProperty( 0 , "SOIL" ); +%! GridProps2 = riGetGridProperty( 0 , "SOIL", [1,3]); + +%! riSetGridProperty( GridProps1, 0, "PropertyName11" ); +%! riSetGridProperty( GridProps2, 0, "PropertyName12", [1,3]); +%! riSetGridProperty( GridProps2, 0, "PropertyName13", [1,3], "Matrix"); +%! riSetGridProperty( GridProps1, 0, "PropertyName14", "Matrix"); +%! riSetGridProperty( GridProps1, 1, 0, "PropertyName15" ); +%! riSetGridProperty( GridProps2, 1, 0, "PropertyName16", [1,3]); +%! riSetGridProperty( GridProps2, 1, 0, "PropertyName17", [1,3], "Matrix"); +%! riSetGridProperty( GridProps1, 1, 0, "PropertyName18", "Matrix"); + +%! assert(GridProps1 == riGetGridProperty( 0, "PropertyName11")); +%! assert(GridProps2 == riGetGridProperty( 0, "PropertyName12", [1,3])); +%! assert(GridProps2 == riGetGridProperty( 0, "PropertyName13", [1,3], "Matrix")); +%! assert(GridProps1 == riGetGridProperty( 0, "PropertyName14", "Matrix")); +%! assert(GridProps1 == riGetGridProperty( 1, 0, "PropertyName15")); +%! assert(GridProps2 == riGetGridProperty( 1, 0, "PropertyName16", [1,3])); +%! assert(GridProps2 == riGetGridProperty( 1, 0, "PropertyName17", [1,3], "Matrix")); +%! assert(GridProps1 == riGetGridProperty( 1, 0, "PropertyName18", "Matrix")); + + +### Matrix[numI][numJ][numK][3] riGetCellCenters([CaseId], GridIndex) +%!test +%! printf ("===== Testing ====> riGetCellCenters\n"); +%! CellCenters1 = riGetCellCenters(0); +%! CellCenters2 = riGetCellCenters(1, 0); +%! assert( ndims (CellCenters1) == 4); +%! [ni, nj, nk, idx ] = size(CellCenters1); +%! assert(idx == 3); +%! assert(ni == 139); +%! assert(nj == 48); +%! assert(nk == 9); +%! assert(CellCenters1(62,30,1, 1), 3489.2, 0.1); +%! assert(CellCenters1(62,30,1, 2), 1.5909e+004, 0.1); +%! assert(CellCenters1(62,30,1, 3), -5458.8, 0.1); +%! assert(CellCenters1 == CellCenters2); + + + +### Matrix[ActiveCells][3] riGetActiveCellCenters([CaseId], [PorosityModel = "Matrix"|"Fracture"]) +%!test +%! printf ("===== Testing ====> riGetActiveCellCenters\n"); +%! ActiveCellCenters1 = riGetActiveCellCenters(); +%! ActiveCellCenters2 = riGetActiveCellCenters("Matrix"); +%! ActiveCellCenters3 = riGetActiveCellCenters(1, "Matrix"); + +%! assert (rows(ActiveCellCenters1), rows(riGetActiveCellInfo())); +%! assert (columns(ActiveCellCenters1) == 3); +%! assert (ActiveCellCenters1(500,:) ,[3493.7, 9184.6, -6074.4], [0.1, 0.1, 0.1]); +%! assert (ActiveCellCenters1 == ActiveCellCenters2); +%! assert (ActiveCellCenters1 == ActiveCellCenters3); + + +### Matrix[numI][numJ][numK][8][3] riGetCellCorners([CaseId], GridIndex) +%!test +%! printf ("===== Testing ====> riGetCellCorners\n"); +%! CellCorners1 = riGetCellCorners(0); +%! CellCorners2 = riGetCellCorners(1, 0); + +%! assert( ndims (CellCorners1) == 5); +%! [ni, nj, nk, cidx, idx ] = size(CellCorners1); +%! assert(idx == 3); +%! assert(cidx == 8); +%! assert(ni == 139); +%! assert(nj == 48); +%! assert(nk == 9); +%! assert(CellCorners1(62,30,1, 1, 1), 3207.4, 0.1); +%! assert(CellCorners1(62,30,1, 1, 2), 1.5781e+004, 1); +%! assert(CellCorners1(62,30,1, 1, 3), -5466.1, 0.1); +%! assert (CellCorners1 == CellCorners2); + + +### Matrix[ActiveCells][8][3] riGetActiveCellCorners([CaseId], [PorosityModel = "Matrix"|"Fracture"]) +%!test +%! printf ("===== Testing ====> riGetActiveCellCorners\n"); +%! ActiveCellCorners1 = riGetActiveCellCorners(); +%! ActiveCellCorners2 = riGetActiveCellCorners(1); +%! ActiveCellCorners3 = riGetActiveCellCorners(1, "Matrix"); +%! ActiveCellCorners4 = riGetActiveCellCorners("Matrix"); + +%! assert( ndims (ActiveCellCorners1) == 3); +%! [nactive, cidx, idx ] = size(ActiveCellCorners1); +%! assert(idx == 3); +%! assert(cidx == 8); +%! assert(nactive , rows(riGetActiveCellInfo())); + +%! assert(ActiveCellCorners1(500,1, 1), 3207.2, 0.1); +%! assert(ActiveCellCorners1(500,1, 2), 9080.7, 0.1); +%! assert(ActiveCellCorners1(500,1, 3), -6076.8, 0.1); +%! assert (ActiveCellCorners1 , ActiveCellCorners2); +%! assert (ActiveCellCorners1 , ActiveCellCorners3); +%! assert (ActiveCellCorners1 , ActiveCellCorners4); + +### Vector[WellNames] riGetWellNames([CaseId]) +%!xtest +%! printf ("===== Testing ====> riGetWellNames\n"); +%! WellNames1 = riGetWellNames(); +%! WellNames2 = riGetWellNames(1); +%! assert (rows(WellNames1), 113); +%! assert (WellNames1{113}, "P20-03"); +%! assert (rows(WellNames1) == rows(WellNames2)); +%! assert (WellNames2{113}, "P20-03"); + +### Vector[WellCellInfo] riGetWellCells([CaseId], WellName, TimeStep) +%!xtest +%! printf ("===== Testing ====> riGetWellCells\n"); +%! WellNames1 = riGetWellNames(); +%! WellCellInfos1 = riGetWellCells(1, WellNames1{1}, 3); +%! WellCellInfos2 = riGetWellCells(WellNames1{1}, 3); + + +### Vector[WellStatus] riGetWellStatus ([CaseId], WellName, [RequestedTimeSteps]) +%!xtest +%! printf ("===== Testing ====> riGetWellStatus\n"); +%! WellNames1 = riGetWellNames(); +%! WellStatuses1 = riGetWellStatus(1, WellNames1{1}, [1,3]); +%! disp(WellStatuses1(1)); +%! WellStatuses2 = riGetWellStatus( WellNames1{1}, [1,3]); +%! WellStatuses3 = riGetWellStatus(WellNames1{1}); + +endif \ No newline at end of file diff --git a/OctavePlugin/OctaveScripts/ResInsightIterfaceUnitTest.m b/OctavePlugin/OctaveScripts/ResInsightIterfaceUnitTest.m new file mode 100644 index 0000000000..ef2855d5ae --- /dev/null +++ b/OctavePlugin/OctaveScripts/ResInsightIterfaceUnitTest.m @@ -0,0 +1,154 @@ +### The case with caseid 1 has to be selected/active in ResInsight when running this test-script +### Coarsening and Dual porosity is not exercised by this tes yet. We need models + +if (1) +test OctaveInterfaceTest.m +else + +### CaseInfo riGetCurrentCase() +printf ("===== Testing ====> riGetCurrentCase\n"); +caseInfo = riGetCurrentCase(); +disp(caseInfo); + + +### Vector[CaseInfo] riGetSelectedCases() +printf ("===== Testing ====> riGetSelectedCases\n"); +caseInfoVector1 = riGetSelectedCases(); +disp(caseInfoVector1); + +if(0) + +### Vector[CaseGroupInfo] riGetCaseGroups() +printf ("===== Testing ====> riGetCaseGroups\n"); +caseGroupInfoVector = riGetCaseGroups(); + +### Vector[CaseInfo] riGetCases([CaseGroupId]) +printf ("===== Testing ====> riGetCases\n"); +caseinfoVector2 = riGetCases(); +caseinfoVector3 = riGetCases(caseGroupInfoVector(2).CaseGroupId); + +### Matrix[numActiveCells][9] riGetActiveCellInfo([CaseId], [PorosityModel = "Matrix"|"Fracture"] ) +printf ("===== Testing ====> riGetActiveCellInfo\n"); +ACInfo1 = riGetActiveCellInfo(); +ACInfo2 = riGetActiveCellInfo("Matrix"); +ACInfo3 = riGetActiveCellInfo(1, "Matrix"); + +### Matrix[numCoarseGroups][6] riGetCoarseningInfo([CaseId]) +printf ("===== Testing ====> riGetCoarseningInfo\n"); +CoarseInfo1 = riGetCoarseningInfo(); +CoarseInfo2 = riGetCoarseningInfo(1); + +### Matrix[numGrids][3] riGetGridDimensions([CaseId]) +printf ("===== Testing ====> riGetGridDimensions\n"); +GridDims1 = riGetGridDimensions(); +GridDims2 = riGetGridDimensions(1); + +### Vector[TimeStepDate] riGetTimestepDates([CaseId]) +printf ("===== Testing ====> riGetTimestepDates\n"); +TimeStepDates1 = riGetTimeStepDates(); +TimeStepDates2 = riGetTimeStepDates(1); + +### Vector[DecimalDay] riGetTimestepDays([CaseId]) +printf ("===== Testing ====> riGetTimestepDays\n"); +TimeStepDays1 = riGetTimeStepDays(); +TimeStepDays2 = riGetTimeStepDays(1); + +### Vector[PropertyInfo] riGetPropertyNames([CaseId] ], [PorosityModel = "Matrix"|"Fracture"]) +printf ("===== Testing ====> riGetPropertyNames\n"); +PropertyInfos1 = riGetPropertyNames(); +PropertyInfos2 = riGetPropertyNames(1); +PropertyInfos3 = riGetPropertyNames("Matrix"); +PropertyInfos4 = riGetPropertyNames(1, "Matrix"); + +### Matrix[numActiveCells][numTimestepsRequested] riGetActiveCellProperty([CaseId], PropertyName, [RequestedTimeSteps], [PorosityModel = "Matrix"|"Fracture"]) +printf ("===== Testing ====> riGetActiveCellProperty\n"); +ActivePropData1 = riGetActiveCellProperty("SOIL"); +ActivePropData2 = riGetActiveCellProperty("SOIL", "Matrix"); +ActivePropData3 = riGetActiveCellProperty("SOIL", [1,3]); +ActivePropData4 = riGetActiveCellProperty("SOIL", [1,3], "Matrix"); + +ActivePropData5 = riGetActiveCellProperty(1, "SOIL"); +ActivePropData6 = riGetActiveCellProperty(1, "SOIL", [1,3]); +ActivePropData7 = riGetActiveCellProperty(1, "SOIL", [1,3], "Matrix"); +ActivePropData8 = riGetActiveCellProperty(1, "SOIL", "Matrix"); + +### Matrix[numI][numJ][numK][numTimestepsRequested] riGetGridProperty([CaseId], GridIndex , PropertyName, [RequestedTimeSteps], [PorosityModel = "Matrix"|"Fracture"]) +printf ("===== Testing ====> riGetGridProperty\n"); +GridProps1 = riGetGridProperty( 0 , "SOIL" ); +GridProps2 = riGetGridProperty( 0 , "SOIL", [1,3]); +GridProps3 = riGetGridProperty( 0 , "SOIL", [1,3], "Matrix"); +GridProps4 = riGetGridProperty( 0 , "SOIL", "Matrix"); +GridProps5 = riGetGridProperty(1, 0 , "SOIL" ); +GridProps6 = riGetGridProperty(1, 0 , "SOIL", [1,3]); +GridProps7 = riGetGridProperty(1, 0 , "SOIL", [1,3], "Matrix"); +GridProps8 = riGetGridProperty(1, 0 , "SOIL", "Matrix"); + + +### riSetActiveCellProperty( Matrix[numActiveCells][numTimeSteps], [CaseId], PropertyName, [TimeStepIndices], [PorosityModel = "Matrix"|"Fracture"]) +printf ("===== Testing ====> riSetActiveCellProperty\n"); +riSetActiveCellProperty( ActivePropData1, "PropertyName1" ); + +riSetActiveCellProperty( ActivePropData3, "PropertyName2", [1,3]); +riSetActiveCellProperty( ActivePropData3, "PropertyName3", [1,3], "Matrix"); +riSetActiveCellProperty( ActivePropData1, "PropertyName4", "Matrix"); +riSetActiveCellProperty( ActivePropData1, 1, "PropertyName5" ); +riSetActiveCellProperty( ActivePropData3, 1, "PropertyName6", [1,3]); +riSetActiveCellProperty( ActivePropData3, 1, "PropertyName7", [1,3], "Matrix"); +riSetActiveCellProperty( ActivePropData1, 1, "PropertyName8", "Matrix"); + +### riSetGridProperty( Matrix[numI][numJ][numK][numTimeSteps], [CaseId], GridIndex, PropertyName, [TimeStepIndices], [PorosityModel = "Matrix"|"Fracture"]) +printf ("===== Testing ====> riSetGridProperty\n"); +riSetGridProperty( GridProps1, 0, "PropertyName11" ); +riSetGridProperty( GridProps2, 0, "PropertyName12", [1,3]); +riSetGridProperty( GridProps2, 0, "PropertyName13", [1,3], "Matrix"); +riSetGridProperty( GridProps1, 0, "PropertyName14", "Matrix"); +riSetGridProperty( GridProps1, 1, 0, "PropertyName15" ); +riSetGridProperty( GridProps2, 1, 0, "PropertyName16", [1,3]); +riSetGridProperty( GridProps2, 1, 0, "PropertyName17", [1,3], "Matrix"); +riSetGridProperty( GridProps1, 1, 0, "PropertyName18", "Matrix"); + + +### Matrix[numI][numJ][numK][3] riGetCellCenters([CaseId], GridIndex) +printf ("===== Testing ====> riGetCellCenters\n"); +CellCenters1 = riGetCellCenters(0); +CellCenters2 = riGetCellCenters(1, 0); + +### Matrix[ActiveCells][3] riGetActiveCellCenters([CaseId], [PorosityModel = "Matrix"|"Fracture"]) +printf ("===== Testing ====> riGetActiveCellCenters\n"); +ActiveCellCenters1 = riGetActiveCellCenters(); +ActiveCellCenters2 = riGetActiveCellCenters("Matrix"); +ActiveCellCenters3 = riGetActiveCellCenters(1, "Matrix"); + +### Matrix[numI][numJ][numK][8][3] riGetCellCorners([CaseId], GridIndex) +printf ("===== Testing ====> riGetCellCorners\n"); +CellCorners1 = riGetCellCorners(0); +CellCorners2 = riGetCellCorners(1, 0); + +### Matrix[ActiveCells][8][3] riGetActiveCellCorners([CaseId], [PorosityModel = "Matrix"|"Fracture"]) +printf ("===== Testing ====> riGetActiveCellCorners\n"); +ActiveCellCorners1 = riGetActiveCellCorners(); +ActiveCellCorners2 = riGetActiveCellCorners(1); +ActiveCellCorners3 = riGetActiveCellCorners(1, "Matrix"); +ActiveCellCorners4 = riGetActiveCellCorners("Matrix"); + +### Vector[WellNames] riGetWellNames([CaseId]) +printf ("===== Testing ====> riGetWellNames\n"); + +WellNames1 = riGetWellNames(); +WellNames2 = riGetWellNames(1); + +### Vector[WellCellInfo] riGetWellCells([CaseId], WellName, TimeStep) +printf ("===== Testing ====> riGetWellCells\n"); +WellCellInfos1 = riGetWellCells(1, WellNames1(1,:), 3); +WellCellInfos2 = riGetWellCells(WellNames1(1,:), 3); + + +### Vector[WellStatus] riGetWellStatus ([CaseId], WellName, [RequestedTimeSteps]) +printf ("===== Testing ====> riGetWellStatus\n"); +WellStatuses1 = riGetWellStatus(1, WellNames1(1,:), [1,3]); +disp(WellStatuses1(1)); +WellStatuses2 = riGetWellStatus( WellNames1(1,:), [1,3]); +WellStatuses3 = riGetWellStatus(WellNames1(1,:)); + +endif +endif \ No newline at end of file diff --git a/OctavePlugin/riGetActiveCellCenters.cpp b/OctavePlugin/riGetActiveCellCenters.cpp index 2505a8bc00..90c1631f30 100644 --- a/OctavePlugin/riGetActiveCellCenters.cpp +++ b/OctavePlugin/riGetActiveCellCenters.cpp @@ -33,7 +33,7 @@ void getActiveCellCenters(NDArray& cellCenterValues, const QString &hostName, qu while (socket.bytesAvailable() < (int)(2 * sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetActiveCellCorners.cpp b/OctavePlugin/riGetActiveCellCorners.cpp index 69f6ac136a..6fb285cc4a 100644 --- a/OctavePlugin/riGetActiveCellCorners.cpp +++ b/OctavePlugin/riGetActiveCellCorners.cpp @@ -33,7 +33,7 @@ void getActiveCellCorners(NDArray& cellCornerValues, const QString &hostName, qu while (socket.bytesAvailable() < (int)(2 * sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetActiveCellInfo.cpp b/OctavePlugin/riGetActiveCellInfo.cpp index dbf278ef23..824134e0f7 100644 --- a/OctavePlugin/riGetActiveCellInfo.cpp +++ b/OctavePlugin/riGetActiveCellInfo.cpp @@ -33,7 +33,7 @@ void getActiveCellInfo(int32NDArray& activeCellInfo, const QString &hostName, qu while (socket.bytesAvailable() < (int)(2*sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -177,10 +177,7 @@ DEFUN_DLD (riGetActiveCellInfo, args, nargout, { porosityModel = args(1).char_matrix_value().row_as_string(0).c_str(); } - } - - - octave_stdout << "Porosity: " << porosityModel.toStdString() << " CaseId : " << caseId << std::endl; + } getActiveCellInfo(propertyFrames, "127.0.0.1", 40001, caseId, porosityModel); diff --git a/OctavePlugin/riGetActiveCellProperty.cpp b/OctavePlugin/riGetActiveCellProperty.cpp index b23929121e..a936b82d96 100644 --- a/OctavePlugin/riGetActiveCellProperty.cpp +++ b/OctavePlugin/riGetActiveCellProperty.cpp @@ -38,7 +38,7 @@ void getActiveCellProperty(Matrix& propertyFrames, const QString &serverName, qu while (socket.bytesAvailable() < (int)(2*sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -168,8 +168,8 @@ DEFUN_DLD (riGetActiveCellProperty, args, nargout, } // Check if we have a Requested TimeSteps - - if (!(nargin > argIndices[2] && args(argIndices[2]).is_matrix_type())) + + if (!(nargin > argIndices[2] && args(argIndices[2]).is_matrix_type() && !args(argIndices[2]).is_string())) { argIndices[2] = -1; for (size_t aIdx = 3; aIdx < argIndices.size(); ++aIdx) diff --git a/OctavePlugin/riGetCaseGroups.cpp b/OctavePlugin/riGetCaseGroups.cpp index 18578f3f9d..d1e9b896e5 100644 --- a/OctavePlugin/riGetCaseGroups.cpp +++ b/OctavePlugin/riGetCaseGroups.cpp @@ -31,7 +31,7 @@ void getCaseGroups(std::vector& groupNames, std::vector& groupIds, // Get response. First wait for the header while (socket.bytesAvailable() < (int)(2*sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; @@ -49,7 +49,7 @@ void getCaseGroups(std::vector& groupNames, std::vector& groupIds, // Get response. Read all data for command while (socket.bytesAvailable() < (int)byteCount) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetCases.cpp b/OctavePlugin/riGetCases.cpp index 1cb3dda737..5fb681ac01 100644 --- a/OctavePlugin/riGetCases.cpp +++ b/OctavePlugin/riGetCases.cpp @@ -33,7 +33,7 @@ void getCases(std::vector& caseIds, std::vector& caseNames, std while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -45,7 +45,7 @@ void getCases(std::vector& caseIds, std::vector& caseNames, std while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetCellCenters.cpp b/OctavePlugin/riGetCellCenters.cpp index 371021fedd..cb65de3d01 100644 --- a/OctavePlugin/riGetCellCenters.cpp +++ b/OctavePlugin/riGetCellCenters.cpp @@ -33,7 +33,7 @@ void getCellCenters(NDArray& cellCenterValues, const QString &hostName, quint16 while (socket.bytesAvailable() < (int)(5 * sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetCellCorners.cpp b/OctavePlugin/riGetCellCorners.cpp index ba24454bbe..ee8f810239 100644 --- a/OctavePlugin/riGetCellCorners.cpp +++ b/OctavePlugin/riGetCellCorners.cpp @@ -33,7 +33,7 @@ void getCellCorners(NDArray& cellCornerValues, const QString &hostName, quint16 while (socket.bytesAvailable() < (int)(5 * sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetCoarseningInfo.cpp b/OctavePlugin/riGetCoarseningInfo.cpp index 7d4e4a3a92..1961bcc786 100644 --- a/OctavePlugin/riGetCoarseningInfo.cpp +++ b/OctavePlugin/riGetCoarseningInfo.cpp @@ -33,7 +33,7 @@ void getCoarseningInfo(int32NDArray& coarseningInfo, const QString &hostName, qu while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -46,8 +46,8 @@ void getCoarseningInfo(int32NDArray& coarseningInfo, const QString &hostName, qu quint64 boxCount = byteCount / (6 * sizeof(qint32)); dim_vector dv (1, 1); - dv(0) = 6; - dv(1) = boxCount; + dv(0) = boxCount; + dv(1) = 6; coarseningInfo.resize(dv); @@ -67,12 +67,12 @@ void getCoarseningInfo(int32NDArray& coarseningInfo, const QString &hostName, qu socketStream >> k1; socketStream >> k2; - coarseningInfo(0, i) = i1; - coarseningInfo(1, i) = i2; - coarseningInfo(2, i) = j1; - coarseningInfo(3, i) = j2; - coarseningInfo(4, i) = k1; - coarseningInfo(5, i) = k2; + coarseningInfo(i, 0) = i1; + coarseningInfo(i, 1) = i2; + coarseningInfo(i, 2) = j1; + coarseningInfo(i, 3) = j2; + coarseningInfo(i, 4) = k1; + coarseningInfo(i, 5) = k2; } return; diff --git a/OctavePlugin/riGetCurrentCase.cpp b/OctavePlugin/riGetCurrentCase.cpp index 395d85d56d..80b0ffe4ac 100644 --- a/OctavePlugin/riGetCurrentCase.cpp +++ b/OctavePlugin/riGetCurrentCase.cpp @@ -33,7 +33,7 @@ void getCurrentCase(qint64& caseId, QString& caseName, QString& caseType, qint64 while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -45,7 +45,7 @@ void getCurrentCase(qint64& caseId, QString& caseName, QString& caseType, qint64 while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetGridDimensions.cpp b/OctavePlugin/riGetGridDimensions.cpp index c42d007fb1..83e123dacb 100644 --- a/OctavePlugin/riGetGridDimensions.cpp +++ b/OctavePlugin/riGetGridDimensions.cpp @@ -33,7 +33,7 @@ void getGridDimensions(int32NDArray& gridDimensions, const QString &hostName, qu while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -46,8 +46,8 @@ void getGridDimensions(int32NDArray& gridDimensions, const QString &hostName, qu quint64 gridCount = byteCount / (3 * sizeof(quint64)); dim_vector dv (1, 1); - dv(0) = 3; - dv(1) = gridCount; + dv(0) = gridCount; + dv(1) = 3; gridDimensions.resize(dv); @@ -61,9 +61,9 @@ void getGridDimensions(int32NDArray& gridDimensions, const QString &hostName, qu socketStream >> jCount; socketStream >> kCount; - gridDimensions(0, i) = iCount; - gridDimensions(1, i) = jCount; - gridDimensions(2, i) = kCount; + gridDimensions(i, 0) = iCount; + gridDimensions(i, 1) = jCount; + gridDimensions(i, 2) = kCount; } QString tmp = QString("riGetGridDimensions : Read grid dimensions"); diff --git a/OctavePlugin/riGetGridProperty.cpp b/OctavePlugin/riGetGridProperty.cpp index 5e1bcf7d09..3771341644 100644 --- a/OctavePlugin/riGetGridProperty.cpp +++ b/OctavePlugin/riGetGridProperty.cpp @@ -5,8 +5,6 @@ void getGridProperty(NDArray& propertyFrames, const QString &serverName, quint16 serverPort, const int& caseId, int gridIdx, QString propertyName, const int32NDArray& requestedTimeSteps, QString porosityModel) { - const int Timeout = riOctavePlugin::shortTimeOutMilliSecs; - QTcpSocket socket; socket.connectToHost(serverName, serverPort); @@ -40,7 +38,7 @@ void getGridProperty(NDArray& propertyFrames, const QString &serverName, quint16 while (socket.bytesAvailable() < (int)(4*sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -170,7 +168,7 @@ DEFUN_DLD (riGetGridProperty, args, nargout, // Check if we have a Requested TimeSteps - if (!(nargin > argIndices[3] && args(argIndices[3]).is_matrix_type())) + if (!(nargin > argIndices[3] && args(argIndices[3]).is_matrix_type() && !args(argIndices[3]).is_string())) { argIndices[3] = -1; for (size_t aIdx = 3; aIdx < argIndices.size(); ++aIdx) diff --git a/OctavePlugin/riGetMainGridDimensions.cpp b/OctavePlugin/riGetMainGridDimensions.cpp index 538173af5a..329b57a5f3 100644 --- a/OctavePlugin/riGetMainGridDimensions.cpp +++ b/OctavePlugin/riGetMainGridDimensions.cpp @@ -33,7 +33,7 @@ void getMainGridDimensions(int32NDArray& gridDimensions, const QString &hostName while (socket.bytesAvailable() < (int)(3*sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetPropertyNames.cpp b/OctavePlugin/riGetPropertyNames.cpp index f21eeb6ddb..1d1309521c 100644 --- a/OctavePlugin/riGetPropertyNames.cpp +++ b/OctavePlugin/riGetPropertyNames.cpp @@ -35,7 +35,7 @@ void getPropertyNames(std::vector& propNames, std::vector& pro while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -50,7 +50,7 @@ void getPropertyNames(std::vector& propNames, std::vector& pro while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetSelectedCases.cpp b/OctavePlugin/riGetSelectedCases.cpp index c99cd8957b..a7379c666d 100644 --- a/OctavePlugin/riGetSelectedCases.cpp +++ b/OctavePlugin/riGetSelectedCases.cpp @@ -33,7 +33,7 @@ void getSelectedCases(std::vector& caseIds, std::vector& caseNa while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -45,7 +45,7 @@ void getSelectedCases(std::vector& caseIds, std::vector& caseNa while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetTimeStepDates.cpp b/OctavePlugin/riGetTimeStepDates.cpp index b4d04ceb82..fbfe5dbf8f 100644 --- a/OctavePlugin/riGetTimeStepDates.cpp +++ b/OctavePlugin/riGetTimeStepDates.cpp @@ -41,7 +41,7 @@ void getTimeStepDates( std::vector& yearValues, while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -53,7 +53,7 @@ void getTimeStepDates( std::vector& yearValues, while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetTimeStepDays.cpp b/OctavePlugin/riGetTimeStepDays.cpp index b13ee43e9d..03d8e55508 100644 --- a/OctavePlugin/riGetTimeStepDays.cpp +++ b/OctavePlugin/riGetTimeStepDays.cpp @@ -14,7 +14,7 @@ void getTimeStepDates( std::vector& decimalDays, QTcpSocket socket; socket.connectToHost(serverName, serverPort); - if (!socket.waitForConnected(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -35,7 +35,7 @@ void getTimeStepDates( std::vector& decimalDays, while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -47,7 +47,7 @@ void getTimeStepDates( std::vector& decimalDays, while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riGetWellCells.cpp b/OctavePlugin/riGetWellCells.cpp index 52cf93de7b..3183345d28 100644 --- a/OctavePlugin/riGetWellCells.cpp +++ b/OctavePlugin/riGetWellCells.cpp @@ -43,7 +43,7 @@ void getWellCells( std::vector& cellIs, while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -60,7 +60,7 @@ void getWellCells( std::vector& cellIs, while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; @@ -71,7 +71,7 @@ void getWellCells( std::vector& cellIs, quint64 cellCount; socketStream >> cellCount; - octave_stdout << "riGetWellCells2: Num cells = " << cellCount << std::endl; + octave_stdout << "riGetWellCells: Number of cells in well " << wellName.toLatin1().data() << " : " << cellCount << std::endl; cellIs .reserve(cellCount); cellJs .reserve(cellCount); diff --git a/OctavePlugin/riGetWellNames.cpp b/OctavePlugin/riGetWellNames.cpp index df72d3dc66..aa73a0f274 100644 --- a/OctavePlugin/riGetWellNames.cpp +++ b/OctavePlugin/riGetWellNames.cpp @@ -35,7 +35,7 @@ void getWellNames(std::vector& wellNames, const QString &hostName, quin while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -50,7 +50,7 @@ void getWellNames(std::vector& wellNames, const QString &hostName, quin while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; @@ -112,16 +112,13 @@ DEFUN_DLD (riGetWellNames, args, nargout, // Create cells with N items for each field in the data structure - //charMatrix octaveWellNames; string_vector octaveWellNames; for (size_t i = 0; i < caseCount; i++) { octaveWellNames.append(wellNames[i].toStdString()); } - // Build a map between the field name and field cell values - - return octave_value(octaveWellNames); + return octave_value(Cell(octaveWellNames)); } return octave_value(); diff --git a/OctavePlugin/riGetWellStatus.cpp b/OctavePlugin/riGetWellStatus.cpp index 2b51d8d7de..55b22d7826 100644 --- a/OctavePlugin/riGetWellStatus.cpp +++ b/OctavePlugin/riGetWellStatus.cpp @@ -43,7 +43,7 @@ void getWellStatus(std::vector& wellTypes, std::vector& wellStatus while (socket.bytesAvailable() < (int)(sizeof(quint64))) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for header: ") + socket.errorString()).toLatin1().data()); return; @@ -55,7 +55,7 @@ void getWellStatus(std::vector& wellTypes, std::vector& wellStatus while (socket.bytesAvailable() < (int)(byteCount)) { - if (!socket.waitForReadyRead(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForReadyRead(riOctavePlugin::longTimeOutMilliSecs)) { error((("Waiting for data: ") + socket.errorString()).toLatin1().data()); return; diff --git a/OctavePlugin/riSetActiveCellProperty.cpp b/OctavePlugin/riSetActiveCellProperty.cpp index 1c60484bba..4953f25778 100644 --- a/OctavePlugin/riSetActiveCellProperty.cpp +++ b/OctavePlugin/riSetActiveCellProperty.cpp @@ -78,7 +78,7 @@ void setEclipseProperty(const Matrix& propertyFrames, const QString &hostName, q if (socket.bytesToWrite() && socket.state() != QAbstractSocket::ConnectedState) { - error("riSetActiveCellProperty : ResInsight refused to accept the data. Maybe the dimentions or porosity model is wrong"); + error("riSetActiveCellProperty : ResInsight refused to accept the data. Maybe the dimensions or porosity model is wrong"); } return; } @@ -92,6 +92,8 @@ DEFUN_DLD (riSetActiveCellProperty, args, nargout, "\n" "Interprets the supplied matrix as a property set defined for the active cells in the case, " "and puts the data into ResInsight as a \"Generated\" property with the name \"PropertyName\"." + "The \"TimeStepIndices\" argument is used to \"label\" all the time steps present in the supplied data matrix," + "and must thus be complete. The time step data will then be put into ResInsight at the time steps requested." "If the CaseId is not defined, ResInsight’s Current Case is used." ) { @@ -146,7 +148,7 @@ DEFUN_DLD (riSetActiveCellProperty, args, nargout, // Check if we have a Requested TimeSteps - if (!(nargin > argIndices[3] && args(argIndices[3]).is_matrix_type())) + if (!(nargin > argIndices[3] && args(argIndices[3]).is_matrix_type() && !args(argIndices[3]).is_string())) { argIndices[3] = -1; for (size_t aIdx = 4; aIdx < argIndices.size(); ++aIdx) diff --git a/OctavePlugin/riSetGridProperty.cpp b/OctavePlugin/riSetGridProperty.cpp index 0fd8174b04..04773e8804 100644 --- a/OctavePlugin/riSetGridProperty.cpp +++ b/OctavePlugin/riSetGridProperty.cpp @@ -9,7 +9,7 @@ void setEclipseProperty(const NDArray& propertyFrames, const QString &hostName, QTcpSocket socket; socket.connectToHost(hostName, port); - if (!socket.waitForConnected(riOctavePlugin::shortTimeOutMilliSecs)) + if (!socket.waitForConnected(riOctavePlugin::connectTimeOutMilliSecs)) { error((("Connection: ") + socket.errorString()).toLatin1().data()); return; @@ -112,6 +112,7 @@ DEFUN_DLD (riSetGridProperty, args, nargout, "\triSetGridProperty( Matrix[numI][numJ][numK][numTimeSteps], [CaseId], GridIndex, PropertyName, [TimeStepIndices], [PorosityModel = \"Matrix\"|\"Fracture\"] ) \n" "\n" "Interprets the supplied matrix as a property set defined for all cells in one of the grids in a case, and puts the data into ResInsight as a \"Generated\" property with the name \"PropertyName\".\n" + "The \"TimeStepIndices\" argument is used to \"label\" all the time steps present in the supplied data matrix, and must thus be complete. The time step data will then be put into ResInsight at the time steps requested." "If the CaseId is not defined, ResInsight’s Current Case is used.\n" ) { @@ -176,7 +177,7 @@ DEFUN_DLD (riSetGridProperty, args, nargout, // Check if we have a Requested TimeSteps - if (!(nargin > argIndices[4] && args(argIndices[4]).is_matrix_type())) + if (!(nargin > argIndices[4] && args(argIndices[4]).is_matrix_type() && !args(argIndices[4]).is_string())) { argIndices[4] = -1; for (size_t aIdx = 5; aIdx < argIndices.size(); ++aIdx) diff --git a/OctavePlugin/riSettings.h b/OctavePlugin/riSettings.h index b6f84da8cd..bc7220e845 100644 --- a/OctavePlugin/riSettings.h +++ b/OctavePlugin/riSettings.h @@ -20,9 +20,9 @@ namespace riOctavePlugin { - const int connectTimeOutMilliSecs = 5000; - const int shortTimeOutMilliSecs = 5000; - const int longTimeOutMilliSecs = 60000; + const int connectTimeOutMilliSecs = 5000; + const int shortTimeOutMilliSecs = 5000; + const int longTimeOutMilliSecs = 6000000; // Octave data structure : CaseInfo char caseInfo_CaseId[] = "CaseId"; @@ -40,7 +40,7 @@ namespace riOctavePlugin // Octave data structure : CaseGroupInfo char caseGroupInfo_CaseGroupId[] = "CaseGroupId"; - char caseGroupInfo_CaseGroupName[] = "CaseName"; + char caseGroupInfo_CaseGroupName[] = "CaseGroupName"; // Octave data structure : WellCellInfo char wellCellInfo_I[] = "I"; diff --git a/README b/README index 6bf1e649cc..a586f29019 100644 --- a/README +++ b/README @@ -1,26 +1,36 @@ -These are the release notes for ResInsight. +This is the README file for ResInsight. -ResInsight is a 3D viewer and post processing tool for reservoir models. It has been co-developed by Statoil and Ceetron with the aim to provide a versatile tool for professionals who need to visualize and process reservoir models. The software is copyrighted by Ceetron and Statoil and licensed under GPL 3+. See COPYING for details. +ResInsight is a 3D viewer and post processing tool for reservoir models. It has been co-developed by Statoil and Ceetron AS / Ceetron Solutions AS with the aim to provide a versatile tool for professionals who need to visualize and process reservoir models. The software is copyrighted by Ceetron and Statoil and licensed under GPL 3+. See COPYING for details. + +DEPENDENCIES +ResInsight uses the Ensambles/ert library to access eclipse result files, and the two projects collaborates closely. The source code of the approved ert library version is embedded in the ResInsight source code tree, making downloading and building simple. +ResInsight also features an interface to Octave, making it possible to retrieve data from ResInsight, process them using Octave, and write them back into ResInsight for viewing. If you want to build ResInsight with this feature, you need to install Octave. + +http://www.gnu.org/software/octave/ +https://github.com/Ensembles/ert ON WHAT PLATFORMS DOES IT RUN? -ResInsight is designed cross-platform from the start. Efforts have been made to ensure that code will compile and run on linux and windows platforms. It will probably also compile and run on osx should anybody be interested in that. +ResInsight is designed cross-platform from the start. Efforts have been made to ensure that code will compile and run on linux and windows platforms, but the tested platforms are currently 64 bit RHE 5, RHE 6 and Windows 7. + +There has been attemts to make ResInsight build and run on OSX as well, but the tweaks needed (submitted by Roland Kaufmann) is not yet incorporated. DOCUMENTATION No efforts to provide documentation has been made yet. DOWNLOADING RESINSIGHT - git clone git://github.com/OPM/ResInsight.git + git clone git://github.com/OPM/ResInsight.git CONTRIBUTION -Please use master branch for contributions and pull requests. Please do not use branch 'internal' for contributions. +Contributions are very welcome, although it might take some time for the team to accept pull requests that is not in the main line of the projects focus. Please use the dev branch for contributions and pull requests, as it is the branch dedicated to the day to day development. The master branch is used as a branch for distributing the latest stable release. +Release branches that might pop up are dedicated bug fix branches for the release in question. BUILDING RESINSIGHT - Linux ResInsight uses the cmake build system and requires cmake version 2.8 or higher. Moreover, you need version 4.7.3 of Qt or newer, look below for dependecy list. An out-of-tree build is typically done with - mkdir ResInsight/build - cd ResInsight/build - cmake .. - make - make install + mkdir ResInsight/build + cd ResInsight/build + cmake .. + make + make install You will find the ResInsight binary under the Install directory in your build directory. BUILDING RESINSIGHT - Windows @@ -32,5 +42,5 @@ Set the build variables and click "Configure" again. Click "Generate", and a project file will be created in the build directory DEPENDENCIES FOR DEBIAN BASED DISTRIBUTIONS - sudo apt-get install git cmake build-essential octave octave-headers qt4-dev-tools -If you are running Ubuntu 12.10 or newer, you will need to replace octave-headers with liboctave-dev in the line above. \ No newline at end of file + sudo apt-get install git cmake build-essential octave octave-headers qt4-dev-tools +If you are running Ubuntu 12.10 or newer, you will need to replace octave-headers with liboctave-dev in the line above. diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index f728820177..2492b9b17c 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -1,7 +1,7 @@ set(CMAKE_MAJOR_VERSION 0) set(CMAKE_MINOR_VERSION 9) -set(CMAKE_PATCH_VERSION 28) +set(CMAKE_PATCH_VERSION 30) set(PRODUCTVER ${CMAKE_MAJOR_VERSION},${CMAKE_MINOR_VERSION},0,${CMAKE_PATCH_VERSION}) set(STRPRODUCTVER ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}) diff --git a/TestModels/OctaveUnitTestProject.rsp b/TestModels/OctaveUnitTestProject.rsp new file mode 100644 index 0000000000..f7e3092b00 --- /dev/null +++ b/TestModels/OctaveUnitTestProject.rsp @@ -0,0 +1,2957 @@ + + + + C:/gitRoot/OPM/ResInsight/TestModels/OctaveUnitTestProject.rsp + 0.9.29 + 11 + 3 + + + + + + + TEST10K_FLT_LGR_NNC + 0 + + + + + DYNAMIC_NATIVE + MATRIX_MODEL + SOIL + + + 8 + 2 + FIXED + NORMAL + LinearContinuous + AUTOMATIC_ALLTIMESTEPS + 1 + 0 + SOIL + + + + + + + + + True + True + True + + + 8 + 2 + FIXED + PINK_WHITE + LinearContinuous + AUTOMATIC_ALLTIMESTEPS + 1 + 0 + + + + + + + + True + True + True + True + + + View 1 + 5 + True + 0 + True + + + True + True + True + 1 + WELLHEAD_POS_TOP_COLUMN + 0.890196 0.890196 0.890196 + OPEN_IN_VISIBLE_CELLS + 0.1 + 12 + FORCE_ALL_OFF + False + K_DIRECTION + 0.5 + True + + + GP1 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + GI1 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + GP2 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + + + + + + True + + + + + + True + + + FULL_MESH + SURFACE + 10 + True + False + False + 0.752941 0.823529 0.870588 + 1 0 0 -1233.79 0 1 0 -1598.74 0 0 1 -5667 0 0 0 1 + + + + + + + + + + + + + + + False + False + C:\gitRoot\OPM\ResInsight\TestModels\TEST10K_FLT_LGR_NNC\TEST10K_FLT_LGR_NNC.EGRID + + + BRUGGE_0040 + 6 + + + + + DYNAMIC_NATIVE + MATRIX_MODEL + SOIL + + + 8 + 2 + FIXED + NORMAL + LinearContinuous + AUTOMATIC_ALLTIMESTEPS + 1 + 0 + SOIL + + + + + + + + + True + True + True + + + 8 + 2 + FIXED + PINK_WHITE + LinearContinuous + AUTOMATIC_ALLTIMESTEPS + 1 + 0 + + + + + + + + True + True + True + True + + + View 1 + 5 + True + 0 + True + + + True + True + True + 1 + WELLHEAD_POS_TOP_COLUMN + 0.898039 0.898039 0.898039 + OPEN_IN_VISIBLE_CELLS + 0.1 + 12 + FORCE_ALL_OFF + False + K_DIRECTION + 0.5 + True + + + I01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I04 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I05 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I06 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I07 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I08 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I09 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I10 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P04 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P05 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P06 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P07 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P08 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P09 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P10 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P11 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P12 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P13 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P14 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P15 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P16 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P17 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P18 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P19 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P20 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I01-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I01-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I01-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I02-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I02-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I02-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I03-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I03-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I03-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I04-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I04-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I04-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I05-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I05-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I05-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I06-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I06-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I06-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I07-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I07-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I07-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I08-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I08-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I08-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I09-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I09-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I09-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I10-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I10-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I10-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P01-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P01-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P01-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P02-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P02-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P02-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P03-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P03-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P03-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P04-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P04-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P04-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P05-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P05-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P06-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P06-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P07-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P07-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P07-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P08-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P08-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P08-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P09-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P10-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P10-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P11-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P11-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P11-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P12-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P12-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P12-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P13-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P13-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P13-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P14-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P14-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P15-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P15-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P16-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P16-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P16-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P17-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P17-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P17-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P18-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P18-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P18-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P19-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P19-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P19-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P20-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P20-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P20-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + + + + + + True + + + + + + True + + + FULL_MESH + SURFACE + 10 + True + False + False + 0.752941 0.823529 0.870588 + 0.0886273 -0.975863 0.199593 5826.88 -0.026925 0.197962 0.97984 -15330.1 -0.995701 -0.0922146 -0.0087303 -23559.7 0 0 0 1 + + + + + + + + + + + + + + + False + False + C:\gitRoot\OPM\ResInsight\TestModels\Case_with_10_timesteps\Real40\BRUGGE_0040.EGRID + + + + + Grid Case Group + 0 + + + + + Statistics 1 + 2 + + + + + + + + + + + + + + False + False + PRESSURE + PERMX PORO + + + + + + + True + InterpolatedObservationPercentile + 10 + 50 + 90 + None + + + + + + + + + BRUGGE_0000 + 1 + + + + + DYNAMIC_NATIVE + MATRIX_MODEL + PRESSURE + + + 8 + 2 + FIXED + NORMAL + LinearContinuous + AUTOMATIC_ALLTIMESTEPS + 1 + 0 + PRESSURE + + + + + 8 + 2 + FIXED + NORMAL + LinearContinuous + AUTOMATIC_ALLTIMESTEPS + 1 + 0 + + + + 8 + 2 + FIXED + NORMAL + LinearContinuous + AUTOMATIC_ALLTIMESTEPS + 1 + 0 + SOIL + + + 8 + 2 + FIXED + NORMAL + LinearContinuous + AUTOMATIC_ALLTIMESTEPS + 1 + 0 + SWAT + + + + + + + + True + True + True + + + 8 + 2 + FIXED + PINK_WHITE + LinearContinuous + AUTOMATIC_ALLTIMESTEPS + 1 + 0 + + + + + + + + True + True + True + True + + + View 1 + 5 + True + 0 + True + + + True + True + True + 1 + WELLHEAD_POS_TOP_COLUMN + 0.890196 0.890196 0.890196 + OPEN_IN_VISIBLE_CELLS + 0.1 + 12 + FORCE_ALL_OFF + False + K_DIRECTION + 0.5 + True + + + I01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I04 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I05 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I06 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I07 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I08 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I09 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I10 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P04 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P05 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P06 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P07 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P08 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P09 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P10 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P11 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P12 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P13 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P14 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P15 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P16 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P17 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P18 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P19 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P20 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I01-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I01-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I01-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I02-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I02-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I02-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I03-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I03-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I03-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I04-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I04-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I04-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I05-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I05-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I05-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I06-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I06-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I06-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I07-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I07-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I07-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I08-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I08-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I08-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I09-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I09-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I09-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I10-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I10-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + I10-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P01-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P01-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P01-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P02-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P02-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P02-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P03-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P03-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P03-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P04-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P04-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P04-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P05-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P05-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P06-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P06-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P07-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P07-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P07-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P08-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P08-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P08-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P09-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P10-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P10-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P11-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P11-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P11-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P12-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P12-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P12-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P13-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P13-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P13-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P14-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P14-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P15-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P15-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P16-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P16-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P16-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P17-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P17-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P17-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P18-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P18-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P18-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P19-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P19-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P19-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P20-01 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P20-02 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + P20-03 + True + True + True + 1 + 0.588 0.588 0.804 + True + False + + + + + + + + True + + + + + + True + + + FULL_MESH + SURFACE + 10 + True + False + False + 0.752941 0.823529 0.870588 + 1 0 0 -31314.5 0 1 0 -26550.5 0 0 1 -64567.3 0 0 0 1 + + + + + + + + + + + + + + + False + False + C:/gitRoot/OPM/ResInsight/TestModels/Case_with_10_timesteps/Real0/BRUGGE_0000.EGRID + + + BRUGGE_0010 + 3 + + + + + + + + + + + + + + False + False + C:/gitRoot/OPM/ResInsight/TestModels/Case_with_10_timesteps/Real10/BRUGGE_0010.EGRID + + + BRUGGE_0030 + 4 + + + + + + + + + + + + + + False + False + C:/gitRoot/OPM/ResInsight/TestModels/Case_with_10_timesteps/Real30/BRUGGE_0030.EGRID + + + BRUGGE_0040 + 5 + + + + + + + + + + + + + + False + False + C:/gitRoot/OPM/ResInsight/TestModels/Case_with_10_timesteps/Real40/BRUGGE_0040.EGRID + + + + + + + Grid Case Group 2 + 1 + + + + + Statistics 1 + 7 + + + + + + + + + + + + + + False + False + PRESSURE + PERMX PORO + + + + + + + True + InterpolatedObservationPercentile + 10 + 50 + 90 + None + + + + + + + + + BRUGGE_0000 + 8 + + + + + + + + + + + + + + False + False + C:/gitRoot/OPM/ResInsight/TestModels/Case_with_10_timesteps/Real0/BRUGGE_0000.EGRID + + + BRUGGE_0010 + 9 + + + + + + + + + + + + + + False + False + C:/gitRoot/OPM/ResInsight/TestModels/Case_with_10_timesteps/Real10/BRUGGE_0010.EGRID + + + + + + + + + + + True + 0.870588 0.870588 0.870588 + ALL_ON + 0.1 + True + 100 + + + + + + + + + + + + C:\gitRoot\OPM\ResInsight\OctavePlugin\OctaveScripts + + + C:\gitRoot\OPM\ResInsight\OctavePlugin\OctaveScripts\InputPropTest.m + + + C:\gitRoot\OPM\ResInsight\OctavePlugin\OctaveScripts\kaverage.m + + + C:\gitRoot\OPM\ResInsight\OctavePlugin\OctaveScripts\kslice.m + + + C:\gitRoot\OPM\ResInsight\OctavePlugin\OctaveScripts\LGRSOIL.m + + + C:\gitRoot\OPM\ResInsight\OctavePlugin\OctaveScripts\ResInsightIterfaceUnitTest.m + + + C:\gitRoot\OPM\ResInsight\OctavePlugin\OctaveScripts\SatNum.m + + + C:\gitRoot\OPM\ResInsight\OctavePlugin\OctaveScripts\SoilTimeDiff.m + + + + + + + + -1-1001000;-1-10010;-1-10020100000;-1-100201000;-1-1002010;-1-10020;-1-100;-1-12000;-1-120 + + + True + True + UTM_FILTER_OFF + 0 + 0 + 0 + 0 + + + + + 0 0;2 0;1 0;0 0 + diff --git a/ThirdParty/Ert/devel/CMakeLists.txt b/ThirdParty/Ert/devel/CMakeLists.txt index 86be8c5fa0..55f727f46b 100644 --- a/ThirdParty/Ert/devel/CMakeLists.txt +++ b/ThirdParty/Ert/devel/CMakeLists.txt @@ -10,10 +10,13 @@ option( BUILD_TESTS "Should the tests be built" OFF) option( BUILD_APPLICATIONS "Should we build small utility applications" OFF) option( BUILD_ECL_SUMMARY "Build the commandline application ecl_summary" OFF) option( BUILD_PYTHON "Run py_compile on the python wrappers" OFF) +option( BUILD_SHARED_LIBS "Build shared libraries" ON ) option( INSTALL_ERT "Should anything be installed when issuing make install?" ON) - +option( ERT_BUILD_GUI "Should the pyQt based gui be compiled and installed" OFF ) +option( ERT_USE_OPENMP "Use OpenMP - currently only in EclGrid" ON) include( CheckFunctionExists ) +include( CheckTypeSize ) ENABLE_TESTING() if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") @@ -26,6 +29,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") add_definitions( -DWINDOWS_LFS ) endif() + # Treat warnings as errors if not on Windows if (ERT_WINDOWS) set( CMAKE_C_FLAGS "-O2" ) @@ -35,30 +39,43 @@ else() set( CMAKE_CXX_FLAGS "-g -Wall -O2 ") endif() +if (ERT_USE_OPENMP) + find_package(OpenMP) + if (OPENMP_FOUND) + message(STATUS "Enabling OpenMP support") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS}") + else() + message(STATUS "OpenMP package not found - OpenMP disabled") + endif() +endif() + + include(cmake/ert_check.cmake) include(cmake/ert_find.cmake) include(cmake/Modules/UseMultiArch.cmake) include(cmake/ert_link.cmake) -set( INSTALL_GROUP "" CACHE STRING "Group to install as - blank to install as current group") +set(INSTALL_GROUP "" CACHE STRING "Group to install as - blank to install as current group") set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin) -if (MSVC) - set( LIBRARY_TYPE STATIC ) - set( SHARED_LIB OFF ) + +if (BUILD_SHARED_LIBS) + set( LIBRARY_TYPE SHARED ) else() - if (INSTALL_ERT) - set( LIBRARY_TYPE SHARED ) - set( SHARED_LIB ON ) - else() - set( LIBRARY_TYPE STATIC ) - set( SHARED_LIB OFF ) - endif(INSTALL_ERT) + set( LIBRARY_TYPE STATIC ) + if (BUILD_ERT) + message(FATAL_ERROR "The full ERT application must be built with shared libraries") + endif() + if (BUILD_PYTHON) + message(FATAL_ERROR "The Python wrappers require shared libraries") + endif() endif() - if (MSVC) add_definitions( -D__func__="\\"????\\"") endif() @@ -67,12 +84,10 @@ endif() if (ERT_LINUX) set( NEED_LIBM TRUE ) set( LINK_STATIC FALSE ) - set( NEED_LIBDL ON ) add_definitions( -DHAVE_PROC ) else() set( NEED_LIBM FALSE ) set( LINK_STATIC TRUE ) - set( NEED_LIBDL OFF ) endif() @@ -105,8 +120,6 @@ add_subdirectory( libecl_well ) #----------------------------------------------------------------- if (BUILD_ERT) #----------------------------------------------------------------- - option(USE_LSF "Include support for LSF" ON) - include_directories( ${PROJECT_SOURCE_DIR}/libconfig/include ) add_subdirectory( libconfig ) diff --git a/ThirdParty/Ert/devel/cmake/Tests/test_mktime_before1970.c b/ThirdParty/Ert/devel/cmake/Tests/test_mktime_before1970.c new file mode 100644 index 0000000000..93bac8e75f --- /dev/null +++ b/ThirdParty/Ert/devel/cmake/Tests/test_mktime_before1970.c @@ -0,0 +1,21 @@ +#include +#include +#include + +int main(int argc, char ** argv) { + struct tm ts; + ts.tm_sec = 0; + ts.tm_min = 0; + ts.tm_hour = 0; + ts.tm_mday = 1; + ts.tm_mon = 0; + ts.tm_year = 0; + ts.tm_isdst = -1; + { + time_t t = mktime( &ts ); + if (t == -1) + exit(1); + else + exit(0); + } +} diff --git a/ThirdParty/Ert/devel/cmake/create_cmakelists.py b/ThirdParty/Ert/devel/cmake/create_cmakelists.py new file mode 100644 index 0000000000..a7e5faf58b --- /dev/null +++ b/ThirdParty/Ert/devel/cmake/create_cmakelists.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python + +from os import listdir +from os.path import isfile, join, isdir +import sys + + + +def findFilesAndDirectories(directory): + all_files = listdir(directory) + files = [] + directories = [] + for f in all_files: + path = join(directory, f) + if isfile(path) and not f == "CMakeLists.txt": + files.append(f) + if isdir(path): + directories.append(f) + + return sorted(files), sorted(directories) + + +def findRelativeModulePath(directory): + """@type directory: str""" + index = directory.rfind("python/") + index += len("python/") + return directory[index:len(directory)] + +def createPythonSources(files): + result = "" + + if len(files) > 0: + result = "set(PYTHON_SOURCES\n" + + files = [f for f in files if f.endswith(".py")] + + for f in files: + result += " " + str(f) + "\n" + + if len(files) > 0: + result += ")" + + return result + +def addSubDirectories(directories): + result = "" + + for d in directories: + result += "add_subdirectory(" + str(d) + ")\n" + + return result + +def addPythonPackage(relative_module_path): + module_name = ".".join(relative_module_path.split("/")) + template = "add_python_package(\"Python %s\" ${PYTHON_INSTALL_PREFIX}/%s \"${PYTHON_SOURCES}\" True)" + + return template % (module_name, relative_module_path) + + +files, directories = findFilesAndDirectories(sys.argv[1]) +module_path = findRelativeModulePath(sys.argv[1]) + +output_file = join(sys.argv[1], "CMakeLists.txt") +with open(output_file, "w+") as text_file: + text_file.write(createPythonSources(files)) + text_file.write("\n\n") + text_file.write(addPythonPackage(module_path)) + text_file.write("\n\n") + text_file.write(addSubDirectories(directories)) + + diff --git a/ThirdParty/Ert/devel/cmake/ert_check.cmake b/ThirdParty/Ert/devel/cmake/ert_check.cmake index 13817386cb..2e01480253 100644 --- a/ThirdParty/Ert/devel/cmake/ert_check.cmake +++ b/ThirdParty/Ert/devel/cmake/ert_check.cmake @@ -43,6 +43,18 @@ if (HAVE_GETUID) add_definitions( -DHAVE_GETUID ) endif() +check_function_exists( _chdir HAVE_WINDOWS_CHDIR) +if (HAVE_WINDOWS_CHDIR) + add_definitions( -DHAVE_WINDOWS_CHDIR) +else() + check_function_exists( chdir HAVE_CHDIR) + if (HAVE_CHDIR) + add_definitions( -DHAVE_CHDIR) + else() + message(FATAL_ERROR "Could not find chdir() / _chdir() functions") + endif() +endif() + check_function_exists( localtime_r HAVE_LOCALTIME_R ) if (HAVE_LOCALTIME_R) add_definitions( -DHAVE_LOCALTIME_R ) @@ -128,5 +140,14 @@ if (ISREG_POSIX) add_definitions( -DHAVE_ISREG ) endif() +check_type_size(time_t SIZE_OF_TIME_T) +if (${SIZE_OF_TIME_T} EQUAL 8) + try_run( RUN_RESULT COMPILE_RESULT ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/cmake/Tests/test_mktime_before1970.c ) + if (RUN_RESULT) + add_defintions( -DTIME_T_64BIT_ACCEPT_PRE1970 ) + endif() +endif() + set( CMAKE_C_FLAGS ${CMAKE_C_FLAGS_main} ) set( CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_main} ) + diff --git a/ThirdParty/Ert/devel/cmake/ert_find.cmake b/ThirdParty/Ert/devel/cmake/ert_find.cmake index 3057b8baf1..801134ded0 100644 --- a/ThirdParty/Ert/devel/cmake/ert_find.cmake +++ b/ThirdParty/Ert/devel/cmake/ert_find.cmake @@ -1,3 +1,15 @@ +set(NEED_LIBDL OFF) +find_library( DL_LIBRARY NAMES dl ) +find_path( DLFUNC_HEADER dlfcn.h ) +if (DL_LIBRARY AND DLFUNC_HEADER) + set(CMAKE_REQUIRED_LIBRARIES dl) + + check_function_exists( dladdr HAVE_DLADDR ) + if (HAVE_DLADDR) + add_definitions( -DHAVE_DLADDR ) + set(NEED_LIBDL ON) + endif() +endif() #----------------------------------------------------------------- find_library( ZLIB_LIBRARY NAMES z ) find_path( ZLIB_HEADER zlib.h /usr/include ) @@ -66,6 +78,9 @@ if (GETOPT_HEADER) endif() #----------------------------------------------------------------- find_path( UNISTD_HEADER unistd.h /usr/include ) +if (UNISTD_HEADER) + add_definitions( -DHAVE_UNISTD ) +endif() if (ERT_WINDOWS) find_library( SHLWAPI_LIBRARY NAMES Shlwapi ) diff --git a/ThirdParty/Ert/devel/libanalysis/cmake/ert_module.cmake b/ThirdParty/Ert/devel/libanalysis/cmake/ert_module.cmake index 0a9c5e5413..db3857f401 100644 --- a/ThirdParty/Ert/devel/libanalysis/cmake/ert_module.cmake +++ b/ThirdParty/Ert/devel/libanalysis/cmake/ert_module.cmake @@ -1,8 +1,8 @@ -function( ert_module module args source_files ) - - set( build_file ${CMAKE_CURRENT_BINARY_DIR}/${module}.so ) +function( ert_module target args source_files ) + + set( build_file ${target}.so ) set( depends analysis ) - set( arg_string "${module} ${args}") + set( arg_string "${target} ${args}") separate_arguments( arg_list UNIX_COMMAND "${arg_string}") foreach (src_file ${source_files} ) list(APPEND arg_list ${CMAKE_CURRENT_SOURCE_DIR}/${src_file} ) @@ -16,6 +16,8 @@ function( ert_module module args source_files ) DEPENDS ${depends}) install(FILES ${build_file} DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + get_filename_component( module ${target} NAME ) add_custom_target( ${module} ALL DEPENDS ${build_file} ) endfunction() diff --git a/ThirdParty/Ert/devel/libanalysis/include/ert/analysis/analysis_module.h b/ThirdParty/Ert/devel/libanalysis/include/ert/analysis/analysis_module.h index b177e402f1..157688fe29 100644 --- a/ThirdParty/Ert/devel/libanalysis/include/ert/analysis/analysis_module.h +++ b/ThirdParty/Ert/devel/libanalysis/include/ert/analysis/analysis_module.h @@ -22,6 +22,7 @@ extern "C" { #endif +#include #include @@ -38,11 +39,22 @@ extern "C" { */ -#define ANALYSIS_NEED_ED 1 -#define ANALYSIS_USE_A 4 // The module will read the content of A - but not modify it. -#define ANALYSIS_UPDATE_A 8 // The update will be based on modifying A directly, and not on an X matrix. -#define ANALYSIS_SCALE_DATA 16 -#define ANALYSIS_ITERABLE 32 // The module can bu uused as an iterative smoother. +typedef enum { + ANALYSIS_NEED_ED = 1, + ANALYSIS_USE_A = 4, // The module will read the content of A - but not modify it. + ANALYSIS_UPDATE_A = 8, // The update will be based on modifying A directly, and not on an X matrix. + ANALYSIS_SCALE_DATA = 16, + ANALYSIS_ITERABLE = 32 // The module can bu used as an iterative smoother. +} analysis_module_flag_enum; + + +#define ANALYSIS_MODULE_FLAG_ENUM_SIZE 5 +#define ANALYSIS_MODULE_FLAG_ENUM_DEFS {.value = ANALYSIS_NEED_ED , .name = "ANALYSIS_NEED_ED"},\ + {.value = ANALYSIS_USE_A , .name = "ANALYSIS_USE_A"},\ + {.value = ANALYSIS_UPDATE_A , .name = "ANALYSIS_UPDATE_A"},\ + {.value = ANALYSIS_SCALE_DATA , .name = "ANALYSIS_SCALE_DATA"},\ + {.value = ANALYSIS_ITERABLE , .name = "ANALYSIS_ITERABLE"} + #define EXTERNAL_MODULE_NAME "analysis_table" #define EXTERNAL_MODULE_SYMBOL analysis_table @@ -96,13 +108,18 @@ extern "C" { bool analysis_module_set_var( analysis_module_type * module , const char * var_name , const char * string_value ); const char * analysis_module_get_table_name( const analysis_module_type * module); const char * analysis_module_get_name( const analysis_module_type * module ); - bool analysis_module_get_option( const analysis_module_type * module , long flag); + bool analysis_module_check_option( const analysis_module_type * module , long flag); void analysis_module_complete_update( analysis_module_type * module ); bool analysis_module_has_var( const analysis_module_type * module , const char * var ); double analysis_module_get_double( const analysis_module_type * module , const char * var); int analysis_module_get_int( const analysis_module_type * module , const char * var); void * analysis_module_get_ptr( const analysis_module_type * module , const char * var); + const char * analysis_module_flag_enum_iget( int index, int * value); + + + + UTIL_IS_INSTANCE_HEADER( analysis_module ); #ifdef __cplusplus } diff --git a/ThirdParty/Ert/devel/libanalysis/include/ert/analysis/enkf_linalg.h b/ThirdParty/Ert/devel/libanalysis/include/ert/analysis/enkf_linalg.h index 4556efa532..f4bc8e0911 100644 --- a/ThirdParty/Ert/devel/libanalysis/include/ert/analysis/enkf_linalg.h +++ b/ThirdParty/Ert/devel/libanalysis/include/ert/analysis/enkf_linalg.h @@ -99,7 +99,7 @@ void enkf_linalg_rml_enkfX3(matrix_type *X3, matrix_type *VdTr, double *Wdr,matr void enkf_linalg_rml_enkfdA(matrix_type *dA1,matrix_type *Dm,matrix_type *X3); double enkf_linalg_data_mismatch(matrix_type *D , matrix_type *R , matrix_type *Sk); -void enkf_linalg_Covariance(matrix_type *Cd, matrix_type *E, double nsc ,int nrobs); +void enkf_linalg_Covariance(matrix_type *Cd, const matrix_type *E, double nsc ,int nrobs); void enkf_linalg_rml_enkfAm(matrix_type * Um, double * Wm,int nsign1); void enkf_linalg_rml_enkfX4 (matrix_type *X4,matrix_type *Am, matrix_type *A); diff --git a/ThirdParty/Ert/devel/libanalysis/modules/CMakeLists.txt b/ThirdParty/Ert/devel/libanalysis/modules/CMakeLists.txt index c9c8accf5a..bb54f40ec4 100644 --- a/ThirdParty/Ert/devel/libanalysis/modules/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libanalysis/modules/CMakeLists.txt @@ -4,4 +4,9 @@ set( RML_SOURCE_FILES rml_enkf.c rml_enkf_common.c ) -ert_module( rml_enkf ${args} "${RML_SOURCE_FILES}") +set( RMLI_SOURCE_FILES + rml_enkf_imodel.c + rml_enkf_common.c ) + +ert_module( ${LIBRARY_OUTPUT_PATH}/rml_enkf ${args} "${RML_SOURCE_FILES}") +ert_module( ${LIBRARY_OUTPUT_PATH}/rmli_enkf ${args} "${RMLI_SOURCE_FILES}") diff --git a/ThirdParty/Ert/devel/libanalysis/modules/rml_enkf.c b/ThirdParty/Ert/devel/libanalysis/modules/rml_enkf.c index f48e94aa2f..ef08576f8d 100644 --- a/ThirdParty/Ert/devel/libanalysis/modules/rml_enkf.c +++ b/ThirdParty/Ert/devel/libanalysis/modules/rml_enkf.c @@ -89,11 +89,10 @@ struct rml_enkf_data_struct { long option_flags; int iteration_nr; // Keep track of the outer iteration loop - double lamda; // parameter to control the search direction in Marquardt levenberg optimization + double lambda; // parameter to control the search direction in Marquardt levenberg optimization double Sk; // Objective function value double Std; // Standard Deviation of the Objective function matrix_type *state; - matrix_type *Cd; }; @@ -143,7 +142,6 @@ void * rml_enkf_data_alloc( rng_type * rng) { data->option_flags = ANALYSIS_NEED_ED + ANALYSIS_UPDATE_A + ANALYSIS_ITERABLE; data->iteration_nr = 0; data->Std = 0; - data->Cd = NULL; data->state = NULL; return data; } @@ -152,9 +150,6 @@ void * rml_enkf_data_alloc( rng_type * rng) { void rml_enkf_data_free( void * module_data ) { rml_enkf_data_type * data = rml_enkf_data_safe_cast( module_data ); - if (data->Cd != NULL) - matrix_free( data->Cd ); - if (data->state != NULL) matrix_free( data->state ); @@ -165,6 +160,19 @@ void rml_enkf_data_free( void * module_data ) { +/* + About the matrix Cd: The matrix Cd is calculated based on the content + of the E input matrix. In the original implementation this matrix was + only calculated in the first iteration, and then reused between subsequent + iterations. + + Due to deactivating outliers the number of active observations can change + from one iteration to the next, if the matrix Cd is then reused between + iterations we will get a matrix size mismatch in the linear algebra. In the + current implementation the Cd matrix is recalculated based on the E input + for each iteration. + */ + void rml_enkf_updateA(void * module_data , matrix_type * A , matrix_type * S , @@ -181,6 +189,7 @@ void rml_enkf_updateA(void * module_data , int ens_size = matrix_get_columns( S ); int nrobs = matrix_get_rows( S ); + matrix_type * Cd = matrix_alloc( nrobs , nrobs); double nsc = 1/sqrt(ens_size-1); matrix_type * Skm = matrix_alloc(matrix_get_columns(D),matrix_get_columns(D)); FILE *fp = util_fopen("rml_enkf_output","a"); @@ -191,82 +200,76 @@ void rml_enkf_updateA(void * module_data , double * Wd = util_calloc( nrmin , sizeof * Wd ); - - + Cd = matrix_alloc( nrobs, nrobs ); + enkf_linalg_Covariance(Cd ,E ,nsc, nrobs); + matrix_inv(Cd); + if (data->iteration_nr == 0) { - data->Cd = matrix_alloc( nrobs, nrobs ); - enkf_linalg_Covariance(data->Cd ,E ,nsc, nrobs); - matrix_inv(data->Cd); - - Sk_new = enkf_linalg_data_mismatch(D,data->Cd,Skm); //Calculate the intitial data mismatch term - Std_new= matrix_diag_std(Skm,Sk_new); - data->lamda =pow(10,floor(log10(Sk_new/(2*nrobs)))); + Sk_new = enkf_linalg_data_mismatch(D,Cd,Skm); //Calculate the intitial data mismatch term + Std_new = matrix_diag_std(Skm,Sk_new); + data->lambda = pow(10,floor(log10(Sk_new/(2*nrobs)))); data->state = matrix_realloc_copy(data->state , A); - rml_enkf_common_initA__(A,S,data->Cd,E,D,truncation,data->lamda,Ud,Wd,VdT); - data->Sk = Sk_new; - data->Std=Std_new; + rml_enkf_common_initA__(A,S,Cd,E,D,truncation,data->lambda,Ud,Wd,VdT); + data->Sk = Sk_new; + data->Std = Std_new; printf("Prior Objective function value is %5.3f \n", data->Sk); fprintf(fp,"Iteration number\t Lamda Value \t Current Mean (OB FN) \t Old Mean\t Current Stddev\n"); fprintf(fp, "\n\n"); fprintf(fp,"%d \t\t NA \t %5.5f \t \t %5.5f \n",data->iteration_nr, Sk_new, Std_new); - } - - else + } else { + Sk_new = enkf_linalg_data_mismatch(D , Cd , Skm); //Calculate the intitial data mismatch term + Std_new= matrix_diag_std(Skm,Sk_new); + printf(" Current Objective function value is %5.3f \n\n",Sk_new); + printf("The old Objective function value is %5.3f \n", data->Sk); + + + if ((Sk_new< (data->Sk)) && (Std_new< (data->Std))) { - Sk_new = enkf_linalg_data_mismatch(D,data->Cd,Skm); //Calculate the intitial data mismatch term - Std_new= matrix_diag_std(Skm,Sk_new); - printf(" Current Objective function value is %5.3f \n\n",Sk_new); - printf("The old Objective function value is %5.3f \n", data->Sk); - + if ( (1- (Sk_new/data->Sk)) < .0001) // check convergence ** model change norm has to be added in this!! + data-> iteration_nr = 16; - if ((Sk_new< (data->Sk)) && (Std_new< (data->Std))) - { - if ( (1- (Sk_new/data->Sk)) < .0001) // check convergence ** model change norm has to be added in this!! - data-> iteration_nr = 16; + fprintf(fp,"%d \t\t %5.5f \t %5.5f \t %5.5f \t %5.5f \n",data->iteration_nr,data->lambda, Sk_new,data->Sk, Std_new); + data->lambda = data->lambda / 10 ; + data->Std = Std_new; + data->state = matrix_realloc_copy(data->state , A); + data->Sk = Sk_new; + rml_enkf_common_initA__(A,S,Cd,E,D,truncation,data->lambda,Ud,Wd,VdT); + } + else if((Sk_new< (data->Sk)) && (Std_new > (data->Std))) + { + if ( (1- (Sk_new/data->Sk)) < .0001) // check convergence ** model change norm has to be added in this!! + data-> iteration_nr = 16; - fprintf(fp,"%d \t\t %5.5f \t %5.5f \t %5.5f \t %5.5f \n",data->iteration_nr,data->lamda, Sk_new,data->Sk, Std_new); - data->lamda = data->lamda / 10 ; - data->Std = Std_new; - data->state = matrix_realloc_copy(data->state , A); - data->Sk = Sk_new; - rml_enkf_common_initA__(A,S,data->Cd,E,D,truncation,data->lamda,Ud,Wd,VdT); - } - else if((Sk_new< (data->Sk)) && (Std_new > (data->Std))) - { - if ( (1- (Sk_new/data->Sk)) < .0001) // check convergence ** model change norm has to be added in this!! - data-> iteration_nr = 16; - - - fprintf(fp,"%d \t\t %5.5f \t %5.5f \t %5.5f \t %5.5f \n",data->iteration_nr,data->lamda, Sk_new,data->Sk, Std_new); - data->lamda = data->lamda; // Here we are not updating lamda! - data->Std=Std_new; - data->state = matrix_realloc_copy(data->state , A); - data->Sk = Sk_new; - rml_enkf_common_initA__(A,S,data->Cd,E,D,truncation,data->lamda,Ud,Wd,VdT); + + fprintf(fp,"%d \t\t %5.5f \t %5.5f \t %5.5f \t %5.5f \n",data->iteration_nr,data->lambda, Sk_new,data->Sk, Std_new); + data->Std=Std_new; + data->state = matrix_realloc_copy(data->state , A); + data->Sk = Sk_new; + rml_enkf_common_initA__(A,S,Cd,E,D,truncation,data->lambda,Ud,Wd,VdT); + } + else { + fprintf(fp,"%d \t\t %5.5f \t %5.5f \t %5.5f \t %5.5f \n",data->iteration_nr,data->lambda, Sk_new,data->Sk, Std_new); + printf("The previous step is rejected !!\n"); + data->lambda = data ->lambda * 4; + matrix_assign( A , data->state ); + rml_enkf_common_initA__(A,S,Cd,E,D,truncation,data->lambda,Ud,Wd,VdT); + data->iteration_nr--; } - else { - fprintf(fp,"%d \t\t %5.5f \t %5.5f \t %5.5f \t %5.5f \n",data->iteration_nr,data->lamda, Sk_new,data->Sk, Std_new); - printf("The previous step is rejected !!\n"); - data->lamda = data ->lamda * 4; - matrix_assign( A , data->state ); - rml_enkf_common_initA__(A,S,data->Cd,E,D,truncation,data->lamda,Ud,Wd,VdT); - data->iteration_nr--; - } } data->iteration_nr++; - - //setting the lower bound for lamda - if (data->lamda <.01) - data->lamda= .01; + + // setting the lower bound for lambda + if (data->lambda <.01) + data->lambda= .01; printf ("The current iteration number is %d \n ", data->iteration_nr); - + matrix_free(Cd); matrix_free(Ud); matrix_free(VdT); matrix_free(Skm); diff --git a/ThirdParty/Ert/devel/libanalysis/src/rml_enkf_imodel.c b/ThirdParty/Ert/devel/libanalysis/modules/rml_enkf_imodel.c similarity index 98% rename from ThirdParty/Ert/devel/libanalysis/src/rml_enkf_imodel.c rename to ThirdParty/Ert/devel/libanalysis/modules/rml_enkf_imodel.c index 56490aa87f..bdb86037af 100644 --- a/ThirdParty/Ert/devel/libanalysis/src/rml_enkf_imodel.c +++ b/ThirdParty/Ert/devel/libanalysis/modules/rml_enkf_imodel.c @@ -32,9 +32,10 @@ #include #include #include -#include #include +#include + /* A random 'magic' integer id which is used for run-time type checking of the input data. @@ -139,7 +140,7 @@ void * rml_enkf_imodel_data_alloc( rng_type * rng) { rml_enkf_imodel_set_truncation( data , DEFAULT_ENKF_TRUNCATION_ ); rml_enkf_imodel_set_subspace_dimension( data , DEFAULT_SUBSPACE_DIMENSION ); - data->option_flags = ANALYSIS_NEED_ED + ANALYSIS_UPDATE_A; + data->option_flags = ANALYSIS_NEED_ED + ANALYSIS_UPDATE_A + ANALYSIS_ITERABLE; data->iteration_nr = 0; data->Std = 0; return data; @@ -473,7 +474,6 @@ long rml_enkf_imodel_get_options( void * arg , long flag ) { bool rml_enkf_imodel_has_var( const void * arg, const char * var_name) { - const rml_enkf_imodel_data_type * module_data = rml_enkf_imodel_data_safe_cast_const( arg ); { if (strcmp(var_name , "ITER") == 0) return true; diff --git a/ThirdParty/Ert/devel/libanalysis/script/ert_module b/ThirdParty/Ert/devel/libanalysis/script/ert_module index d0b240f0b8..931fb97590 100644 --- a/ThirdParty/Ert/devel/libanalysis/script/ert_module +++ b/ThirdParty/Ert/devel/libanalysis/script/ert_module @@ -4,7 +4,7 @@ import os import os.path from optparse import OptionParser -ert_root = os.path.realpath( os.path.join(os.path.dirname( os.path.abspath( __file__)) , "../") ) +ert_root = os.path.realpath( os.path.join(os.path.dirname( os.path.realpath( os.path.abspath( __file__))) , "../") ) #----------------------------------------------------------------- diff --git a/ThirdParty/Ert/devel/libanalysis/src/CMakeLists.txt b/ThirdParty/Ert/devel/libanalysis/src/CMakeLists.txt index c191fd8e1f..868b339fc8 100644 --- a/ThirdParty/Ert/devel/libanalysis/src/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libanalysis/src/CMakeLists.txt @@ -6,25 +6,13 @@ set_target_properties( analysis PROPERTIES COMPILE_DEFINITIONS INTERNAL_LINK) set_target_properties( analysis PROPERTIES VERSION 1.0 SOVERSION 1.0 ) target_link_libraries( analysis ert_util ) -if (NEED_LIBDL) - target_link_libraries( analysis dl ) -endif() +target_link_libraries( analysis dl ) if (USE_RUNPATH) add_runpath( analysis ) endif() -## List of modules -#set( CMAKE_SHARED_MODULE_PREFIX "" ) -##add_library( std_enkf MODULE std_enkf.c ) -#add_library( sqrt_enkf MODULE sqrt_enkf.c ) -#add_library( rml_enkf MODULE rml_enkf.c rml_enkf_common.c ) -# -#ert_module( std_enkf std_enkf.c ) - - - #----------------------------------------------------------------- if (INSTALL_ERT) diff --git a/ThirdParty/Ert/devel/libanalysis/src/analysis_module.c b/ThirdParty/Ert/devel/libanalysis/src/analysis_module.c index 44eb25f351..ee03682c8a 100644 --- a/ThirdParty/Ert/devel/libanalysis/src/analysis_module.c +++ b/ThirdParty/Ert/devel/libanalysis/src/analysis_module.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -81,9 +82,12 @@ static analysis_module_type * analysis_module_alloc_empty( const char * user_nam module->get_int = NULL; module->get_double = NULL; module->get_ptr = NULL; - module->user_name = util_alloc_string_copy( user_name ); - module->symbol_table = util_alloc_string_copy( symbol_table ); - module->lib_name = util_alloc_string_copy( lib_name ); + module->alloc = NULL; + + module->user_name = util_alloc_string_copy( user_name ); + module->symbol_table = util_alloc_string_copy( symbol_table ); + module->lib_name = util_alloc_string_copy( lib_name ); + return module; } @@ -119,7 +123,7 @@ static analysis_module_type * analysis_module_alloc__( rng_type * rng , module->get_double = table->get_double; module->get_ptr = table->get_ptr; - if (module->alloc != NULL) + if (module->alloc) module->module_data = module->alloc( rng ); if (!analysis_module_internal_check( module )) { @@ -213,6 +217,7 @@ bool analysis_module_internal( const analysis_module_type * module ) { /*****************************************************************/ static UTIL_SAFE_CAST_FUNCTION( analysis_module , ANALYSIS_MODULE_TYPE_ID ) +UTIL_IS_INSTANCE_FUNCTION( analysis_module , ANALYSIS_MODULE_TYPE_ID ) void analysis_module_free( analysis_module_type * module ) { @@ -372,13 +377,16 @@ bool analysis_module_set_var( analysis_module_type * module , const char * var_n } -bool analysis_module_get_option( const analysis_module_type * module , long flag) { - return (flag & module->get_options( module->module_data , flag )); +bool analysis_module_check_option( const analysis_module_type * module , long flag) { + if ((flag & module->get_options( module->module_data , flag )) == flag) + return true; + else + return false; } bool analysis_module_has_var( const analysis_module_type * module , const char * var) { - if (module->has_var != NULL) + if (module->has_var) return module->has_var( module->module_data , var ); else return false; @@ -422,3 +430,11 @@ void * analysis_module_get_ptr( const analysis_module_type * module , const char return NULL; } + + +/*****************************************************************/ + +const char * analysis_module_flag_enum_iget( int index, int * value) { + return util_enum_iget( index , ANALYSIS_MODULE_FLAG_ENUM_SIZE , (const util_enum_element_type []) { ANALYSIS_MODULE_FLAG_ENUM_DEFS }, value); +} + diff --git a/ThirdParty/Ert/devel/libanalysis/src/enkf_linalg.c b/ThirdParty/Ert/devel/libanalysis/src/enkf_linalg.c index 1a3dc53c0b..8d85ecd463 100644 --- a/ThirdParty/Ert/devel/libanalysis/src/enkf_linalg.c +++ b/ThirdParty/Ert/devel/libanalysis/src/enkf_linalg.c @@ -180,8 +180,6 @@ int enkf_linalg_svdS(const matrix_type * S , } } - printf("PCA completed: Number of significant terms = %d\n",num_significant); - /* Inverting the significant singular values */ for (i = 0; i < num_significant; i++) inv_sig0[i] = 1.0 / sig0[i]; @@ -700,9 +698,15 @@ double enkf_linalg_data_mismatch(matrix_type *D , matrix_type *R , matrix_type * { matrix_type * tmp = matrix_alloc (matrix_get_columns(D), matrix_get_columns(R)); double mean; - + + printf("-----------------------------------------------------------------\n"); + printf("%s:%d Calling matrix_dgemm() \n",__func__ , __LINE__); + // C A B matrix_dgemm(tmp, D, R,true, false, 1.0, 0.0); + printf("-----------------------------------------------------------------\n"); + printf("%s:%d Calling matrix_dgemm() \n",__func__ , __LINE__); matrix_dgemm(Sk, tmp, D, false, false, 1.0, 0.0); + printf("-----------------------------------------------------------------\n"); printf("The data mismatch computed"); @@ -712,7 +716,7 @@ double enkf_linalg_data_mismatch(matrix_type *D , matrix_type *R , matrix_type * return mean; } -void enkf_linalg_Covariance(matrix_type *Cd, matrix_type *E, double nsc ,int nrobs) +void enkf_linalg_Covariance(matrix_type *Cd, const matrix_type *E, double nsc ,int nrobs) { matrix_matlab_dump( E, "matrixE.dat"); printf("Starting Dgemm for EE(T)\n"); diff --git a/ThirdParty/Ert/devel/libanalysis/tests/CMakeLists.txt b/ThirdParty/Ert/devel/libanalysis/tests/CMakeLists.txt index 6f1e600b95..0ac23b67ff 100644 --- a/ThirdParty/Ert/devel/libanalysis/tests/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libanalysis/tests/CMakeLists.txt @@ -1 +1,9 @@ -add_test( analysis_rml_enkf_module ${EXECUTABLE_OUTPUT_PATH}/ert_module_test ${PROJECT_BINARY_DIR}/libanalysis/modules/rml_enkf.so ) +add_test( analysis_module_test_RML ${EXECUTABLE_OUTPUT_PATH}/ert_module_test ${LIBRARY_OUTPUT_PATH}/rml_enkf.so ) +add_test( analysis_module_test_RMLI ${EXECUTABLE_OUTPUT_PATH}/ert_module_test ${LIBRARY_OUTPUT_PATH}/rmli_enkf.so ) + + +add_executable(analysis_test_external_module analysis_test_external_module.c ) +target_link_libraries( analysis_test_external_module analysis util test_util ) + +add_test( analysis_module_rml ${EXECUTABLE_OUTPUT_PATH}/analysis_test_external_module "RML_ENKF" ${LIBRARY_OUTPUT_PATH}/rml_enkf.so 41 ITER) +add_test( analysis_module_rmli ${EXECUTABLE_OUTPUT_PATH}/analysis_test_external_module "RMLI_ENKF" ${LIBRARY_OUTPUT_PATH}/rmli_enkf.so 41 ITER) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/libanalysis/tests/analysis_test_external_module.c b/ThirdParty/Ert/devel/libanalysis/tests/analysis_test_external_module.c new file mode 100644 index 0000000000..3f0b50b387 --- /dev/null +++ b/ThirdParty/Ert/devel/libanalysis/tests/analysis_test_external_module.c @@ -0,0 +1,62 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'analysis_test_external_module.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + +#include + +#include +#include +#include + +#include + + + +void load_module( rng_type * rng , const char * user_name , const char * lib_name, const char * options_str , int nvar , const char ** var_list) { + long flags = strtol(options_str , NULL , 10); + analysis_module_type * analysis_module = analysis_module_alloc_external(rng , user_name , lib_name); + + printf("Loading:%s \n" , lib_name); + test_assert_string_equal( EXTERNAL_MODULE_NAME , analysis_module_get_table_name(analysis_module)); + if (util_is_abs_path(lib_name)) + test_assert_string_equal( lib_name , analysis_module_get_lib_name(analysis_module)); + + test_assert_true( analysis_module_is_instance( analysis_module)); + for (int i=0; i < nvar; i++) { + printf("has_var(%s) \n" , var_list[i]); + test_assert_true( analysis_module_has_var(analysis_module , var_list[i])); + } + test_assert_false( analysis_module_has_var(analysis_module , "DoesNotHaveThisVariable")); + test_assert_true( analysis_module_check_option( analysis_module , flags)); + flags += 1; + test_assert_false( analysis_module_check_option( analysis_module , flags)); + analysis_module_free( analysis_module); +} + + +int main(int argc , char ** argv) { + const char * user_name = argv[1]; + const char * lib_name = argv[2]; + const char * options_str = argv[3]; + int nvar = argc - 4; + rng_type * rng = rng_alloc( MZRAN , INIT_DEFAULT); + + load_module(rng , user_name , lib_name , options_str , nvar , (const char **) &argv[4]); + rng_free( rng ); + + exit(0); +} diff --git a/ThirdParty/Ert/devel/libconfig/src/config.c b/ThirdParty/Ert/devel/libconfig/src/config.c index 4b9acc6771..705b93f781 100644 --- a/ThirdParty/Ert/devel/libconfig/src/config.c +++ b/ThirdParty/Ert/devel/libconfig/src/config.c @@ -648,7 +648,7 @@ static void config_parse__(config_type * config , current_path_elm = config_add_path_elm( config , config_path ); path_stack_push_cwd( path_stack ); if (config_path != NULL) { - chdir( config_path ); + util_chdir( config_path ); free( config_path ); } } diff --git a/ThirdParty/Ert/devel/libconfig/tests/config_include_test.c b/ThirdParty/Ert/devel/libconfig/tests/config_include_test.c index d1afa66261..c2eb86c4a1 100644 --- a/ThirdParty/Ert/devel/libconfig/tests/config_include_test.c +++ b/ThirdParty/Ert/devel/libconfig/tests/config_include_test.c @@ -46,7 +46,7 @@ void parse_test(config_type * config , util_alloc_file_components( config_file , &config_path , NULL , NULL); path_stack_push( path_stack , NULL ); if (root_path != NULL) - chdir( root_path ); + util_chdir( root_path ); config_abs_path = util_alloc_abs_path( config_path ); config_rel_path = util_alloc_rel_path( NULL , config_abs_path); diff --git a/ThirdParty/Ert/devel/libconfig/tests/config_path_elm.c b/ThirdParty/Ert/devel/libconfig/tests/config_path_elm.c index f1d759214b..6b1217ae04 100644 --- a/ThirdParty/Ert/devel/libconfig/tests/config_path_elm.c +++ b/ThirdParty/Ert/devel/libconfig/tests/config_path_elm.c @@ -36,13 +36,13 @@ int main(int argc , char ** argv) { #endif - test_work_area_type * work_area = test_work_area_alloc( "config_path_elm" , true ); + test_work_area_type * work_area = test_work_area_alloc( "config_path_elm" ); const char * root = test_work_area_get_cwd( work_area ); char * abs_path = util_alloc_filename( root , "rel/path" , NULL); char * abs_true = util_alloc_filename( root , "rel/path/XXX" , NULL); char * path_true2 = util_alloc_filename( root , "rel/path/XXX" , NULL); - chdir( test_work_area_get_original_cwd( work_area )); + util_chdir( test_work_area_get_original_cwd( work_area )); config_root_path_type * root_path = config_root_path_alloc( root ); { config_path_elm_type * path_elm = config_path_elm_alloc( root_path , rel_path ); @@ -71,7 +71,7 @@ int main(int argc , char ** argv) { } config_root_path_free( root_path ); - chdir( root ); + util_chdir( root ); root_path = config_root_path_alloc( NULL ); { config_path_elm_type * path_elm = config_path_elm_alloc( root_path , rel_path ); diff --git a/ThirdParty/Ert/devel/libecl/applications/ecl_quantile.c b/ThirdParty/Ert/devel/libecl/applications/ecl_quantile.c index a1207eb4a8..e52b704b2f 100644 --- a/ThirdParty/Ert/devel/libecl/applications/ecl_quantile.c +++ b/ThirdParty/Ert/devel/libecl/applications/ecl_quantile.c @@ -832,7 +832,7 @@ int main( int argc , char ** argv ) { char * config_path; util_alloc_file_components( config_arg , &config_path , NULL , NULL); if (config_path != NULL) { - chdir( config_path ); + util_chdir( config_path ); free( config_path ); } } else { diff --git a/ThirdParty/Ert/devel/libecl/include/ert/ecl/ecl_util.h b/ThirdParty/Ert/devel/libecl/include/ert/ecl/ecl_util.h index 7644599c9b..1b6fc75bee 100644 --- a/ThirdParty/Ert/devel/libecl/include/ert/ecl/ecl_util.h +++ b/ThirdParty/Ert/devel/libecl/include/ert/ecl/ecl_util.h @@ -173,6 +173,8 @@ bool ecl_util_fmt_file(const char * filename , bool * __fmt_file); char * ecl_util_alloc_exfilename_anyfmt(const char * path, const char * base , ecl_file_enum file_type , bool start_fmt , int report_nr); int ecl_util_get_month_nr(const char * month_name); int ecl_util_fname_report_cmp(const void *f1, const void *f2); +time_t ecl_util_make_date(int mday , int month , int year); +time_t ecl_util_make_date__(int mday , int month , int year, int * year_offset); bool ecl_util_valid_basename( const char * basename ); const char * ecl_util_get_phase_name( ecl_phase_enum phase ); diff --git a/ThirdParty/Ert/devel/libecl/src/CMakeLists.txt b/ThirdParty/Ert/devel/libecl/src/CMakeLists.txt index 67195441ec..5c800d163c 100644 --- a/ThirdParty/Ert/devel/libecl/src/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libecl/src/CMakeLists.txt @@ -13,21 +13,6 @@ set_target_properties( ecl PROPERTIES VERSION 1.0 SOVERSION 1.0 ) if (USE_RUNPATH) add_runpath( ecl ) endif() - -#----------------------------------------------------------------- -set( OPENMP OFF ) -option(USE_OPENMP "Include OpenMP support" OFF) -if (USE_OPENMP) - INCLUDE(CheckCCompilerFlag) - CHECK_C_COMPILER_FLAG(-fopenmp OPENMP) -endif() - -if (OPENMP) - add_definitions( -DHAVE_OPENMP -fopenmp ) - target_link_libraries( ecl gomp ) -else() - add_definitions( -fno-openmp ) -endif() target_link_libraries( ecl ert_geometry ert_util ) #----------------------------------------------------------------- diff --git a/ThirdParty/Ert/devel/libecl/src/ecl_grid.c b/ThirdParty/Ert/devel/libecl/src/ecl_grid.c index 0bb505218b..d146fd6ad7 100644 --- a/ThirdParty/Ert/devel/libecl/src/ecl_grid.c +++ b/ThirdParty/Ert/devel/libecl/src/ecl_grid.c @@ -42,13 +42,6 @@ #include #include -/* - If openmp is enabled the main loop in ecl_grid_init_GRDECL_data is - parallelized with openmp. -*/ -#ifdef HAVE_OPENMP -#include -#endif /** this function implements functionality to load eclispe grid files, diff --git a/ThirdParty/Ert/devel/libecl/src/ecl_rft_node.c b/ThirdParty/Ert/devel/libecl/src/ecl_rft_node.c index 090f4ba05c..c04d4f2e7b 100644 --- a/ThirdParty/Ert/devel/libecl/src/ecl_rft_node.c +++ b/ThirdParty/Ert/devel/libecl/src/ecl_rft_node.c @@ -225,7 +225,7 @@ ecl_rft_node_type * ecl_rft_node_alloc(const ecl_file_type * rft) { /* Time information. */ { int * time = ecl_kw_get_int_ptr( date_kw ); - rft_node->recording_date = util_make_date( time[DATE_DAY_INDEX] , time[DATE_MONTH_INDEX] , time[DATE_YEAR_INDEX] ); + rft_node->recording_date = ecl_util_make_date( time[DATE_DAY_INDEX] , time[DATE_MONTH_INDEX] , time[DATE_YEAR_INDEX] ); } rft_node->days = ecl_kw_iget_float( ecl_file_iget_named_kw( rft , TIME_KW , 0 ) , 0); if (ecl_file_has_kw( rft , CONLENST_KW)) diff --git a/ThirdParty/Ert/devel/libecl/src/ecl_rsthead.c b/ThirdParty/Ert/devel/libecl/src/ecl_rsthead.c index b0baf402ed..6de0b3985a 100644 --- a/ThirdParty/Ert/devel/libecl/src/ecl_rsthead.c +++ b/ThirdParty/Ert/devel/libecl/src/ecl_rsthead.c @@ -26,7 +26,7 @@ static time_t rsthead_date( int day , int month , int year) { - return util_make_date( day , month, year ); + return ecl_util_make_date( day , month, year ); } diff --git a/ThirdParty/Ert/devel/libecl/src/ecl_smspec.c b/ThirdParty/Ert/devel/libecl/src/ecl_smspec.c index 1519207f3f..0db3827c1f 100644 --- a/ThirdParty/Ert/devel/libecl/src/ecl_smspec.c +++ b/ThirdParty/Ert/devel/libecl/src/ecl_smspec.c @@ -1058,9 +1058,9 @@ static void ecl_smspec_fread_header(ecl_smspec_type * ecl_smspec, const char * h { int * date = ecl_kw_get_int_ptr(startdat); - ecl_smspec->sim_start_time = util_make_date(date[STARTDAT_DAY_INDEX] , - date[STARTDAT_MONTH_INDEX] , - date[STARTDAT_YEAR_INDEX]); + ecl_smspec->sim_start_time = ecl_util_make_date(date[STARTDAT_DAY_INDEX] , + date[STARTDAT_MONTH_INDEX] , + date[STARTDAT_YEAR_INDEX]); } ecl_smspec->grid_dims[0] = ecl_kw_iget_int(dimens , DIMENS_SMSPEC_NX_INDEX ); diff --git a/ThirdParty/Ert/devel/libecl/src/ecl_util.c b/ThirdParty/Ert/devel/libecl/src/ecl_util.c index f28fb9abce..2eb325bbba 100644 --- a/ThirdParty/Ert/devel/libecl/src/ecl_util.c +++ b/ThirdParty/Ert/devel/libecl/src/ecl_util.c @@ -1235,7 +1235,7 @@ time_t ecl_util_get_start_date(const char * data_file) { int day, year, month_nr; if ( util_sscanf_int( stringlist_iget( tokens , 0 ) , &day) && util_sscanf_int( stringlist_iget(tokens , 2) , &year)) { month_nr = ecl_util_get_month_nr(stringlist_iget( tokens , 1)); - start_date = util_make_date(day , month_nr , year ); + start_date = ecl_util_make_date(day , month_nr , year ); } else util_abort("%s: failed to parse DAY MONTH YEAR from : \"%s\" \n",__func__ , buffer); stringlist_free( tokens ); @@ -1364,7 +1364,7 @@ void ecl_util_append_month_range( time_t_vector_type * date_list , time_t start_ } else month += 1; - current_date = util_make_date( 1 , month , year ); + current_date = ecl_util_make_date( 1 , month , year ); if (current_date < end_date) time_t_vector_append( date_list , current_date ); else { @@ -1389,6 +1389,38 @@ void ecl_util_init_month_range( time_t_vector_type * date_list , time_t start_da } + + +time_t ecl_util_make_date__(int mday , int month , int year, int * __year_offset) { +time_t date; + +#ifdef TIME_T_64BIT_ACCEPT_PRE1970 + *__year_offset = 0; + date = util_make_date(mday , month , year); +#else + static bool offset_initialized = false; + static int year_offset = 0; + + if (!offset_initialized) { + if (year < 1970) { + year_offset = 2000 - year; + fprintf(stderr,"Warning: all year values will be shifted %d years forward. \n", year_offset); + } + offset_initialized = true; + } + *__year_offset = year_offset; + date = util_make_date(mday , month , year + year_offset); +#endif + + return date; +} + + +time_t ecl_util_make_date(int mday , int month , int year) { + int year_offset; + return ecl_util_make_date__( mday , month , year , &year_offset); +} + /*****************************************************************/ /* Small functions to support enum introspection. */ diff --git a/ThirdParty/Ert/devel/libecl/tests/ecl_file.c b/ThirdParty/Ert/devel/libecl/tests/ecl_file.c index 8a7abfa59d..ad8722275a 100644 --- a/ThirdParty/Ert/devel/libecl/tests/ecl_file.c +++ b/ThirdParty/Ert/devel/libecl/tests/ecl_file.c @@ -104,7 +104,7 @@ void test_close_stream1(const char * src_file , const char * target_file ) { void test_writable(const char * src_file ) { - test_work_area_type * work_area = test_work_area_alloc("ecl_file_writable" , true); + test_work_area_type * work_area = test_work_area_alloc("ecl_file_writable" ); char * fname = util_split_alloc_filename( src_file ); test_work_area_copy_file( work_area , src_file ); @@ -131,7 +131,7 @@ int main( int argc , char ** argv) { const char * target_file = argv[2]; { - test_work_area_type * work_area = test_work_area_alloc("ecl_file" , true); + test_work_area_type * work_area = test_work_area_alloc("ecl_file"); test_work_area_install_file( work_area , src_file ); test_flags( src_file ); diff --git a/ThirdParty/Ert/devel/libecl/tests/ecl_fmt.c b/ThirdParty/Ert/devel/libecl/tests/ecl_fmt.c index 482915f4a3..4787c312b5 100644 --- a/ThirdParty/Ert/devel/libecl/tests/ecl_fmt.c +++ b/ThirdParty/Ert/devel/libecl/tests/ecl_fmt.c @@ -56,7 +56,7 @@ void test_small( ) { int main(int argc , char ** argv) { - test_work_area_type * work_area = test_work_area_alloc( "ecl_fmt" , true); + test_work_area_type * work_area = test_work_area_alloc( "ecl_fmt"); { const char * binary_file = argv[1]; const char * text_file = argv[2]; diff --git a/ThirdParty/Ert/devel/libecl/tests/ecl_fortio.c b/ThirdParty/Ert/devel/libecl/tests/ecl_fortio.c index a7eb31ad99..631b2fcc0e 100644 --- a/ThirdParty/Ert/devel/libecl/tests/ecl_fortio.c +++ b/ThirdParty/Ert/devel/libecl/tests/ecl_fortio.c @@ -84,7 +84,7 @@ int main( int argc , char ** argv) { test_wrapper( file ); test_write( "/tmp/path/does/not/exist" , false ); { - test_work_area_type * work_area = test_work_area_alloc("ecl_fortio.write" , true ); + test_work_area_type * work_area = test_work_area_alloc("ecl_fortio.write" ); util_make_path("path"); test_write( "path/file.x" , true ); test_work_area_free( work_area ); diff --git a/ThirdParty/Ert/devel/libecl/tests/ecl_kw_grdecl.c b/ThirdParty/Ert/devel/libecl/tests/ecl_kw_grdecl.c index a18d168131..6dafd0a90d 100644 --- a/ThirdParty/Ert/devel/libecl/tests/ecl_kw_grdecl.c +++ b/ThirdParty/Ert/devel/libecl/tests/ecl_kw_grdecl.c @@ -32,7 +32,7 @@ int main(int argc , char ** argv) { ecl_kw_iset_int(ecl_kw , i , i ); { - test_work_area_type * work_area = test_work_area_alloc("ecl_kw_grdecl" , true); + test_work_area_type * work_area = test_work_area_alloc("ecl_kw_grdecl"); FILE * stream = util_fopen( "FILE.grdecl" , "w"); ecl_kw_fprintf_grdecl(ecl_kw , stream ); diff --git a/ThirdParty/Ert/devel/libecl/tests/ecl_nnc_amalgamated.c b/ThirdParty/Ert/devel/libecl/tests/ecl_nnc_amalgamated.c index 9a072b6779..7ad5e7d3e3 100644 --- a/ThirdParty/Ert/devel/libecl/tests/ecl_nnc_amalgamated.c +++ b/ThirdParty/Ert/devel/libecl/tests/ecl_nnc_amalgamated.c @@ -30,5 +30,6 @@ int main( int argc , char ** argv) { ecl_grid_type * ecl_grid = ecl_grid_alloc( argv[1] ); + ecl_grid_free( ecl_grid ); exit(0); } diff --git a/ThirdParty/Ert/devel/libecl/tests/ecl_nnc_info_test.c b/ThirdParty/Ert/devel/libecl/tests/ecl_nnc_info_test.c index af5acb5456..a219019673 100644 --- a/ThirdParty/Ert/devel/libecl/tests/ecl_nnc_info_test.c +++ b/ThirdParty/Ert/devel/libecl/tests/ecl_nnc_info_test.c @@ -38,18 +38,18 @@ int main(int argc , char ** argv) { nnc_info_add_nnc(nnc_info, 1, 110); nnc_info_add_nnc(nnc_info, 1, 111); - const nnc_vector_type * nnc_vector = nnc_info_get_vector( nnc_info , 1); + nnc_vector_type * nnc_vector = nnc_info_get_vector( nnc_info , 1); const int_vector_type * nnc_cells = nnc_info_get_index_list(nnc_info, 1); test_assert_int_equal(int_vector_size(nnc_cells), 2); test_assert_ptr_equal( nnc_cells , nnc_vector_get_index_list( nnc_vector )); - const nnc_vector_type * nnc_vector_null = nnc_info_get_vector( nnc_info , 2); + nnc_vector_type * nnc_vector_null = nnc_info_get_vector( nnc_info , 2); const int_vector_type * nnc_cells_null = nnc_info_get_index_list(nnc_info, 2); test_assert_NULL(nnc_cells_null); test_assert_NULL(nnc_vector_null); - const nnc_vector_type * nnc_vector_self = nnc_info_get_self_vector( nnc_info ); + nnc_vector_type * nnc_vector_self = nnc_info_get_self_vector( nnc_info ); const nnc_vector_type * nnc_vector_77 = nnc_info_get_vector( nnc_info , lgr_nr ); test_assert_ptr_equal( nnc_vector_77 , nnc_vector_self ); diff --git a/ThirdParty/Ert/devel/libecl/tests/ecl_util_make_date_no_shift.c b/ThirdParty/Ert/devel/libecl/tests/ecl_util_make_date_no_shift.c new file mode 100644 index 0000000000..a421e448d5 --- /dev/null +++ b/ThirdParty/Ert/devel/libecl/tests/ecl_util_make_date_no_shift.c @@ -0,0 +1,48 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'ecl_util_make_date_no_shift.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#include +#include + +#include +#include +#include + +#include + + +void test_date(int mday, int month , int year) { + time_t t0 = ecl_util_make_date( mday , month , year ); + time_t t1 = util_make_date( mday , month , year); + + test_assert_time_t_equal( t0 , t1 ); +} + +void test_offset(int mday, int month , int year) { + int year_offset; + ecl_util_make_date__( mday , month , year , &year_offset); + test_assert_int_equal( 0 , year_offset ); +} + + + +int main(int argc , char ** argv) { + test_date(10,10,2000); + test_offset(10,10,2000); + // test_assert_util_abort( make_date( 1 , 1 , 0); + exit(0); +} diff --git a/ThirdParty/Ert/devel/libecl/tests/ecl_util_make_date_shift.c b/ThirdParty/Ert/devel/libecl/tests/ecl_util_make_date_shift.c new file mode 100644 index 0000000000..7472fac973 --- /dev/null +++ b/ThirdParty/Ert/devel/libecl/tests/ecl_util_make_date_shift.c @@ -0,0 +1,51 @@ + /* Copyright (C) 2013 Statoil ASA, Norway. + + The file 'ecl_util_make_date_shift.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#include +#include + +#include +#include +#include + +#include + + +void test_date(int mday, int month , int year, int * year_offset) { + time_t t0 = ecl_util_make_date__( mday , month , year , year_offset); + time_t t1 = util_make_date( mday , month , year + *year_offset); + test_assert_time_t_equal( t0 , t1 ); +} + + +void test_offset(int mday, int month , int year , int current_offset) { + int year_offset; + time_t t0 = ecl_util_make_date__( mday , month , year , &year_offset); + time_t t1 = util_make_date( mday , month , year + current_offset); + + test_assert_time_t_equal(t0,t1); + test_assert_int_equal( current_offset , year_offset ); +} + + + + +int main(int argc , char ** argv) { + int year_offset; + test_date(1,1,0 , &year_offset); + test_offset(1,1,1000 , year_offset); + exit(0); +} diff --git a/ThirdParty/Ert/devel/libecl/tests/tests.cmake b/ThirdParty/Ert/devel/libecl/tests/tests.cmake index 8dca1a923b..80138a597e 100644 --- a/ThirdParty/Ert/devel/libecl/tests/tests.cmake +++ b/ThirdParty/Ert/devel/libecl/tests/tests.cmake @@ -10,6 +10,13 @@ add_executable( ecl_restart_test ecl_restart_test.c ) target_link_libraries( ecl_restart_test ecl test_util ) add_test( ecl_restart_test ${EXECUTABLE_OUTPUT_PATH}/ecl_restart_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.UNRST ) +add_executable( ecl_util_make_date_no_shift ecl_util_make_date_no_shift.c ) +target_link_libraries( ecl_util_make_date_no_shift ecl test_util ) +add_test( ecl_util_make_date_no_shift ${EXECUTABLE_OUTPUT_PATH}/ecl_util_make_date_no_shift ) + +add_executable( ecl_util_make_date_shift ecl_util_make_date_shift.c ) +target_link_libraries( ecl_util_make_date_shift ecl test_util ) +add_test( ecl_util_make_date_shift ${EXECUTABLE_OUTPUT_PATH}/ecl_util_make_date_shift ) add_executable( ecl_grid_lgr_name ecl_grid_lgr_name.c ) target_link_libraries( ecl_grid_lgr_name ecl test_util ) diff --git a/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_conn.h b/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_conn.h index d2c2fd2a17..b39c993b06 100644 --- a/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_conn.h +++ b/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_conn.h @@ -61,7 +61,7 @@ extern "C" { int well_conn_get_k(const well_conn_type * conn); well_conn_dir_enum well_conn_get_dir(const well_conn_type * conn); bool well_conn_open( const well_conn_type * conn ); - int well_conn_get_segment( const well_conn_type * conn ); + int well_conn_get_segment_id( const well_conn_type * conn ); bool well_conn_fracture_connection( const well_conn_type * conn); bool well_conn_matrix_connection( const well_conn_type * conn); bool well_conn_equal( const well_conn_type *conn1 , const well_conn_type * conn2); diff --git a/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_const.h b/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_const.h index 3fca6fa5c6..7ea688a27b 100644 --- a/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_const.h +++ b/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_const.h @@ -24,6 +24,25 @@ extern "C" { #endif +#define WELL_SEGMENT_OFFSET 1 +#define WELL_BRANCH_OFFSET 1 + +#define ECLIPSE_WELL_SEGMENT_OFFSET 1 +#define ECLIPSE_WELL_BRANCH_OFFSET 1 + +/* These values are taken from the ISEG description in table 6.1 in ECLIPSE file formats reference. */ +#define ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE 0 +#define ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE 1 +#define ECLIPSE_WELL_SEGMENT_INACTIVE_VALUE 0 +#define ECLIPSE_CONN_NORMAL_WELL_SEGMENT_VALUE 0 + +#define WELL_SEGMENT_OUTLET_END_VALUE (WELL_SEGMENT_OFFSET + ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE - ECLIPSE_WELL_SEGMENT_OFFSET) // -1 +#define WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE (WELL_BRANCH_OFFSET + ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE - ECLIPSE_WELL_BRANCH_OFFSET) // 0 +#define WELL_SEGMENT_BRANCH_INACTIVE_VALUE (WELL_BRANCH_OFFSET + ECLIPSE_WELL_SEGMENT_INACTIVE_VALUE - ECLIPSE_WELL_BRANCH_OFFSET) // -1 +#define CONN_NORMAL_WELL_SEGMENT_VALUE (WELL_SEGMENT_OFFSET + ECLIPSE_CONN_NORMAL_WELL_SEGMENT_VALUE - ECLIPSE_WELL_SEGMENT_OFFSET) + + + /* Observe that the values given as _ITEM are not indices which can be directly used in the IWEL or ICON keywords; an offset must be diff --git a/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_segment.h b/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_segment.h index 689af32cf2..983c1c8f61 100644 --- a/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_segment.h +++ b/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_segment.h @@ -33,17 +33,12 @@ extern "C" { #include #include - /* The values are shifted one down compared to ISEG description in table 6.1 in ECLIPSE file formats reference. */ - -#define ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE -1 -#define ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE 0 -#define ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE -1 typedef struct well_segment_struct well_segment_type; - well_segment_type * well_segment_alloc_from_kw( const ecl_kw_type * iseg_kw , const ecl_kw_type * rseg_kw , const ecl_rsthead_type * header , int well_nr, int segment_id); + well_segment_type * well_segment_alloc_from_kw( const ecl_kw_type * iseg_kw , const ecl_kw_type * rseg_kw , const ecl_rsthead_type * header , int well_nr, int segment_index , int segment_id); well_segment_type * well_segment_alloc(int segment_id , int outlet_segment_id , int branch_id , const double * rseg_data); void well_segment_free(well_segment_type * segment ); void well_segment_free__(void * arg); diff --git a/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_segment_collection.h b/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_segment_collection.h index 3a2e1b8deb..2984135f91 100644 --- a/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_segment_collection.h +++ b/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well/well_segment_collection.h @@ -53,7 +53,7 @@ extern "C" { const well_conn_collection_type * connections); void well_segment_collection_add_branches( const well_segment_collection_type * segment_collection , well_branch_collection_type * branches ); - + #ifdef __cplusplus } #endif diff --git a/ThirdParty/Ert/devel/libecl_well/src/well_branch_collection.c b/ThirdParty/Ert/devel/libecl_well/src/well_branch_collection.c index 0e514cb6fb..959159de67 100644 --- a/ThirdParty/Ert/devel/libecl_well/src/well_branch_collection.c +++ b/ThirdParty/Ert/devel/libecl_well/src/well_branch_collection.c @@ -114,4 +114,7 @@ bool well_branch_collection_add_start_segment( well_branch_collection_type * bra } else return false; } + + + diff --git a/ThirdParty/Ert/devel/libecl_well/src/well_conn.c b/ThirdParty/Ert/devel/libecl_well/src/well_conn.c index bc2e536948..eff5714945 100644 --- a/ThirdParty/Ert/devel/libecl_well/src/well_conn.c +++ b/ThirdParty/Ert/devel/libecl_well/src/well_conn.c @@ -30,7 +30,7 @@ #define WELL_CONN_NORMAL_WELL_SEGMENT_ID -999 -#define ECLIPSE_NORMAL_WELL_SEGMENT_ID -1 +//#define ECLIPSE_NORMAL_WELL_SEGMENT_ID -1 /* Observe that when the (ijk) values are initialized they are @@ -47,7 +47,7 @@ struct well_conn_struct { int k; well_conn_dir_enum dir; bool open; - int segment; // -1: Ordinary well + int segment_id; // -1: Ordinary well bool matrix_connection; // k >= nz => fracture (and k -= nz ) }; @@ -62,7 +62,7 @@ bool well_conn_equal( const well_conn_type *conn1 , const well_conn_type * conn bool well_conn_MSW( const well_conn_type * conn ) { - if (conn->segment == WELL_CONN_NORMAL_WELL_SEGMENT_ID) + if (conn->segment_id == WELL_CONN_NORMAL_WELL_SEGMENT_ID) return false; else return true; @@ -91,10 +91,10 @@ static well_conn_type * well_conn_alloc__( int i , int j , int k , well_conn_dir conn->dir = dir; conn->matrix_connection = matrix_connection; - if (segment_id == ECLIPSE_NORMAL_WELL_SEGMENT_ID) - conn->segment = WELL_CONN_NORMAL_WELL_SEGMENT_ID; + if (segment_id == CONN_NORMAL_WELL_SEGMENT_VALUE) + conn->segment_id = WELL_CONN_NORMAL_WELL_SEGMENT_ID; else - conn->segment = segment_id; + conn->segment_id = segment_id; return conn; } else { @@ -110,8 +110,8 @@ well_conn_type * well_conn_alloc( int i , int j , int k , well_conn_dir_enum dir -well_conn_type * well_conn_alloc_MSW( int i , int j , int k , well_conn_dir_enum dir , bool open, int segment) { - return well_conn_alloc__(i , j , k , dir , open , segment , true ); +well_conn_type * well_conn_alloc_MSW( int i , int j , int k , well_conn_dir_enum dir , bool open, int segment_id) { + return well_conn_alloc__(i , j , k , dir , open , segment_id , true ); } @@ -122,8 +122,8 @@ well_conn_type * well_conn_alloc_fracture( int i , int j , int k , well_conn_dir -well_conn_type * well_conn_alloc_fracture_MSW( int i , int j , int k , well_conn_dir_enum dir , bool open, int segment) { - return well_conn_alloc__(i , j , k , dir , open , segment , false); +well_conn_type * well_conn_alloc_fracture_MSW( int i , int j , int k , well_conn_dir_enum dir , bool open, int segment_id) { + return well_conn_alloc__(i , j , k , dir , open , segment_id , false); } @@ -145,7 +145,7 @@ well_conn_type * well_conn_alloc_from_kw( const ecl_kw_type * icon_kw , int i = ecl_kw_iget_int( icon_kw , icon_offset + ICON_I_ITEM ) - 1; int j = ecl_kw_iget_int( icon_kw , icon_offset + ICON_J_ITEM ) - 1; int k = ecl_kw_iget_int( icon_kw , icon_offset + ICON_K_ITEM ) - 1; - int segment = ecl_kw_iget_int( icon_kw , icon_offset + ICON_SEGMENT_ITEM ) - 1; + int segment_id = ecl_kw_iget_int( icon_kw , icon_offset + ICON_SEGMENT_ITEM ) - ECLIPSE_WELL_SEGMENT_OFFSET + WELL_SEGMENT_OFFSET; bool matrix_connection = true; bool open; well_conn_dir_enum dir = well_conn_fracX; @@ -199,7 +199,7 @@ well_conn_type * well_conn_alloc_from_kw( const ecl_kw_type * icon_kw , } } - conn = well_conn_alloc__(i,j,k,dir,open,segment,matrix_connection); + conn = well_conn_alloc__(i,j,k,dir,open,segment_id,matrix_connection); /** For multisegmented wells ONLY the global part of the restart @@ -298,8 +298,8 @@ bool well_conn_open( const well_conn_type * conn ) { } -int well_conn_get_segment( const well_conn_type * conn ) { - return conn->segment; +int well_conn_get_segment_id( const well_conn_type * conn ) { + return conn->segment_id; } bool well_conn_fracture_connection( const well_conn_type * conn) { diff --git a/ThirdParty/Ert/devel/libecl_well/src/well_segment.c b/ThirdParty/Ert/devel/libecl_well/src/well_segment.c index 6e91541195..174eb374e3 100644 --- a/ThirdParty/Ert/devel/libecl_well/src/well_segment.c +++ b/ThirdParty/Ert/devel/libecl_well/src/well_segment.c @@ -72,15 +72,15 @@ well_segment_type * well_segment_alloc(int segment_id , int outlet_segment_id , } -well_segment_type * well_segment_alloc_from_kw( const ecl_kw_type * iseg_kw , const ecl_kw_type * rseg_kw , const ecl_rsthead_type * header , int well_nr, int segment_id) { +well_segment_type * well_segment_alloc_from_kw( const ecl_kw_type * iseg_kw , const ecl_kw_type * rseg_kw , const ecl_rsthead_type * header , int well_nr, int segment_index , int segment_id) { if (rseg_kw == NULL) { util_abort("%s: fatal internal error - tried to create well_segment instance without RSEG keyword.\n",__func__); return NULL; } else { - const int iseg_offset = header->nisegz * ( header->nsegmx * well_nr + segment_id); - const int rseg_offset = header->nrsegz * ( header->nsegmx * well_nr + segment_id); - int outlet_segment_id = ecl_kw_iget_int( iseg_kw , iseg_offset + ISEG_OUTLET_ITEM ) - 1; - int branch_id = ecl_kw_iget_int( iseg_kw , iseg_offset + ISEG_BRANCH_ITEM ) - 1; + const int iseg_offset = header->nisegz * ( header->nsegmx * well_nr + segment_index); + const int rseg_offset = header->nrsegz * ( header->nsegmx * well_nr + segment_index); + int outlet_segment_id = ecl_kw_iget_int( iseg_kw , iseg_offset + ISEG_OUTLET_ITEM ) - ECLIPSE_WELL_SEGMENT_OFFSET + WELL_SEGMENT_OFFSET ; // -1 + int branch_id = ecl_kw_iget_int( iseg_kw , iseg_offset + ISEG_BRANCH_ITEM ) - ECLIPSE_WELL_BRANCH_OFFSET + WELL_BRANCH_OFFSET ; // -1 const double * rseg_data = ecl_kw_iget_ptr( rseg_kw , rseg_offset ); well_segment_type * segment = well_segment_alloc( segment_id , outlet_segment_id , branch_id , rseg_data); @@ -116,7 +116,7 @@ void well_segment_free__(void * arg) { bool well_segment_active( const well_segment_type * segment ) { - if (segment->branch_id == ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE) + if (segment->branch_id == WELL_SEGMENT_BRANCH_INACTIVE_VALUE) return false; else return true; @@ -124,7 +124,7 @@ bool well_segment_active( const well_segment_type * segment ) { bool well_segment_main_stem( const well_segment_type * segment ) { - if (segment->branch_id == ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE) + if (segment->branch_id == WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE) return true; else return false; @@ -132,7 +132,7 @@ bool well_segment_main_stem( const well_segment_type * segment ) { bool well_segment_nearest_wellhead( const well_segment_type * segment ) { - if (segment->outlet_segment_id == ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE) + if (segment->outlet_segment_id == WELL_SEGMENT_OUTLET_END_VALUE) return true; else return false; @@ -195,7 +195,7 @@ bool well_segment_has_global_grid_connections( const well_segment_type * segment bool well_segment_add_connection( well_segment_type * segment , const char * grid_name , well_conn_type * conn) { - int conn_segment_id = well_conn_get_segment( conn ); + int conn_segment_id = well_conn_get_segment_id( conn ); if (conn_segment_id == segment->segment_id) { if (!well_segment_has_grid_connections( segment , grid_name )) hash_insert_hash_owned_ref( segment->connections , grid_name , well_conn_collection_alloc() , well_conn_collection_free__ ); diff --git a/ThirdParty/Ert/devel/libecl_well/src/well_segment_collection.c b/ThirdParty/Ert/devel/libecl_well/src/well_segment_collection.c index 403c373de7..9757d14886 100644 --- a/ThirdParty/Ert/devel/libecl_well/src/well_segment_collection.c +++ b/ThirdParty/Ert/devel/libecl_well/src/well_segment_collection.c @@ -65,7 +65,7 @@ int well_segment_collection_get_size( const well_segment_collection_type * segme void well_segment_collection_add( well_segment_collection_type * segment_collection , well_segment_type * segment) { int segment_id = well_segment_get_id( segment ); int current_index = int_vector_safe_iget( segment_collection->segment_index_map , segment_id ); - if (current_index >= 0) + if (current_index >= 0) vector_iset_owned_ref( segment_collection->__segment_storage , current_index , segment , well_segment_free__); else { int new_index = vector_get_size(segment_collection->__segment_storage); @@ -111,10 +111,11 @@ int well_segment_collection_load_from_kw( well_segment_collection_type * segment int segments_added = 0; if (segment_well_nr != IWEL_SEGMENTED_WELL_NR_NORMAL_VALUE) { - int segment_id; - for (segment_id = 0; segment_id < rst_head->nsegmx; segment_id++) { - well_segment_type * segment = well_segment_alloc_from_kw( iseg_kw , rseg_kw , rst_head , segment_well_nr , segment_id ); - + int segment_index; + for (segment_index = 0; segment_index < rst_head->nsegmx; segment_index++) { + int segment_id = segment_index + WELL_SEGMENT_OFFSET; + well_segment_type * segment = well_segment_alloc_from_kw( iseg_kw , rseg_kw , rst_head , segment_well_nr , segment_index , segment_id ); + if (well_segment_active( segment )) { well_segment_collection_add( segment_collection , segment ); segments_added++; @@ -122,7 +123,6 @@ int well_segment_collection_load_from_kw( well_segment_collection_type * segment well_segment_free( segment ); } } - return segments_added; } @@ -148,7 +148,7 @@ void well_segment_collection_add_connections(well_segment_collection_type * segm for (iconn = 0; iconn < well_conn_collection_get_size( connections ); iconn++) { well_conn_type * conn = well_conn_collection_iget( connections , iconn ); if (well_conn_MSW( conn )) { - int segment_id = well_conn_get_segment( conn ); + int segment_id = well_conn_get_segment_id( conn ); well_segment_type * segment = well_segment_collection_get( segment_collection , segment_id ); well_segment_add_connection( segment , grid_name , conn ); } @@ -167,3 +167,6 @@ void well_segment_collection_add_branches( const well_segment_collection_type * } } + + + diff --git a/ThirdParty/Ert/devel/libecl_well/tests/well_conn.c b/ThirdParty/Ert/devel/libecl_well/tests/well_conn.c index 255aac1d8a..772148e317 100644 --- a/ThirdParty/Ert/devel/libecl_well/tests/well_conn.c +++ b/ThirdParty/Ert/devel/libecl_well/tests/well_conn.c @@ -92,7 +92,7 @@ int main(int argc , char ** argv) { test_assert_int_equal( i , well_conn_get_i( conn )); test_assert_int_equal( j , well_conn_get_j( conn )); test_assert_int_equal( k , well_conn_get_k( conn )); - test_assert_int_equal( segment , well_conn_get_segment( conn )); + test_assert_int_equal( segment , well_conn_get_segment_id( conn )); test_assert_bool_equal( open , well_conn_open( conn )); test_assert_int_equal( dir , well_conn_get_dir( conn )); test_assert_true( well_conn_MSW( conn )); @@ -109,7 +109,7 @@ int main(int argc , char ** argv) { test_assert_int_equal( i , well_conn_get_i( conn )); test_assert_int_equal( j , well_conn_get_j( conn )); test_assert_int_equal( k , well_conn_get_k( conn )); - test_assert_int_equal( segment , well_conn_get_segment( conn )); + test_assert_int_equal( segment , well_conn_get_segment_id( conn )); test_assert_bool_equal( open , well_conn_open( conn )); test_assert_int_equal( dir , well_conn_get_dir( conn )); test_assert_true( well_conn_MSW( conn )); diff --git a/ThirdParty/Ert/devel/libecl_well/tests/well_segment.c b/ThirdParty/Ert/devel/libecl_well/tests/well_segment.c index fcc34ad73d..a3f1cce752 100644 --- a/ThirdParty/Ert/devel/libecl_well/tests/well_segment.c +++ b/ThirdParty/Ert/devel/libecl_well/tests/well_segment.c @@ -43,7 +43,7 @@ int main(int argc , char ** argv) { { int segment_id = 78; int outlet_segment_id = 100; - int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE; + int branch_nr = WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE; well_segment_type * ws = well_segment_alloc(segment_id , outlet_segment_id , branch_nr, rseg_data); test_assert_true( well_segment_is_instance( ws )); @@ -66,7 +66,7 @@ int main(int argc , char ** argv) { } { - int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; + int outlet_segment_id = WELL_SEGMENT_OUTLET_END_VALUE; int branch_nr = 100; well_segment_type * ws = well_segment_alloc(12 , outlet_segment_id , branch_nr, rseg_data); @@ -76,17 +76,17 @@ int main(int argc , char ** argv) { { - int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; - int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE; + int outlet_segment_id = WELL_SEGMENT_OUTLET_END_VALUE; + int branch_nr = WELL_SEGMENT_BRANCH_INACTIVE_VALUE; well_segment_type * ws = well_segment_alloc(89 , outlet_segment_id , branch_nr, rseg_data); test_assert_false( well_segment_active( ws )); } { - int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE; + int branch_nr = WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE; int outlet_id = 0; - well_segment_type * outlet = well_segment_alloc(outlet_id , ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE , branch_nr, rseg_data); + well_segment_type * outlet = well_segment_alloc(outlet_id , WELL_SEGMENT_OUTLET_END_VALUE , branch_nr, rseg_data); well_segment_type * ws = well_segment_alloc(100 , outlet_id , branch_nr, rseg_data); test_assert_true( well_segment_link( ws , outlet )); @@ -99,9 +99,9 @@ int main(int argc , char ** argv) { } { - int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE; + int branch_nr = WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE; int outlet_id = 0; - well_segment_type * outlet = well_segment_alloc(outlet_id , ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE , branch_nr , rseg_data); + well_segment_type * outlet = well_segment_alloc(outlet_id , WELL_SEGMENT_OUTLET_END_VALUE , branch_nr , rseg_data); well_segment_type * ws = well_segment_alloc(100 , outlet_id + 1, branch_nr, rseg_data); test_assert_false( well_segment_link( ws , outlet )); diff --git a/ThirdParty/Ert/devel/libecl_well/tests/well_segment_collection.c b/ThirdParty/Ert/devel/libecl_well/tests/well_segment_collection.c index 98c3772b68..8ade17c741 100644 --- a/ThirdParty/Ert/devel/libecl_well/tests/well_segment_collection.c +++ b/ThirdParty/Ert/devel/libecl_well/tests/well_segment_collection.c @@ -24,7 +24,7 @@ #include - +#include #include @@ -37,8 +37,8 @@ int main(int argc , char ** argv) { test_assert_int_equal( well_segment_collection_get_size( sc ) , 0 ); { - int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; - int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE; + int outlet_segment_id = WELL_SEGMENT_OUTLET_END_VALUE; + int branch_nr = WELL_SEGMENT_BRANCH_INACTIVE_VALUE; well_segment_type * ws = well_segment_alloc(89 , outlet_segment_id , branch_nr, rseg_data); well_segment_collection_add( sc , ws ); @@ -51,8 +51,8 @@ int main(int argc , char ** argv) { } { - int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; - int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE; + int outlet_segment_id = WELL_SEGMENT_OUTLET_END_VALUE; + int branch_nr = WELL_SEGMENT_BRANCH_INACTIVE_VALUE; well_segment_type * ws = well_segment_alloc(90 , outlet_segment_id , branch_nr , rseg_data); well_segment_collection_add( sc , ws ); @@ -67,8 +67,8 @@ int main(int argc , char ** argv) { } { - int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; - int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE; + int outlet_segment_id = WELL_SEGMENT_OUTLET_END_VALUE; + int branch_nr = WELL_SEGMENT_BRANCH_INACTIVE_VALUE; well_segment_type * ws = well_segment_alloc(89 , outlet_segment_id , branch_nr, rseg_data); well_segment_collection_add( sc , ws ); diff --git a/ThirdParty/Ert/devel/libecl_well/tests/well_segment_conn.c b/ThirdParty/Ert/devel/libecl_well/tests/well_segment_conn.c index 1779f6734d..3c24d5df7e 100644 --- a/ThirdParty/Ert/devel/libecl_well/tests/well_segment_conn.c +++ b/ThirdParty/Ert/devel/libecl_well/tests/well_segment_conn.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -36,7 +37,7 @@ int main(int argc , char ** argv) { { int segment_id = 78; int outlet_segment_id = 100; - int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE; + int branch_nr = WELL_SEGMENT_BRANCH_MAIN_STEM_VALUE; well_segment_type * ws = well_segment_alloc(segment_id , outlet_segment_id , branch_nr, rseg_data); well_conn_type * conn1 = well_conn_alloc_MSW(1,1,1,true,well_conn_dirX,segment_id); well_conn_type * conn2 = well_conn_alloc_MSW(1,1,1,true,well_conn_dirX,segment_id + 1); diff --git a/ThirdParty/Ert/devel/libecl_well/tests/well_segment_load.c b/ThirdParty/Ert/devel/libecl_well/tests/well_segment_load.c index 032632b186..d660f1da9f 100644 --- a/ThirdParty/Ert/devel/libecl_well/tests/well_segment_load.c +++ b/ThirdParty/Ert/devel/libecl_well/tests/well_segment_load.c @@ -52,11 +52,12 @@ int main(int argc , char ** argv) { well_segment_collection_type * segments = well_segment_collection_alloc(); int seg_well_nr = ecl_kw_iget_int( iwel_kw , iwel_offset + IWEL_SEGMENTED_WELL_NR_ITEM) - 1; // -1: Ordinary well. if (seg_well_nr >= 0) { - int segment_id; + int segment_index; int segment_count = 0; - for (segment_id = 0; segment_id < rst_head->nsegmx; segment_id++) { - well_segment_type * segment = well_segment_alloc_from_kw( iseg_kw , rseg_kw , rst_head , seg_well_nr , segment_id ); + for (segment_index = 0; segment_index < rst_head->nsegmx; segment_index++) { + int segment_id = segment_index + WELL_SEGMENT_OFFSET; + well_segment_type * segment = well_segment_alloc_from_kw( iseg_kw , rseg_kw , rst_head , seg_well_nr , segment_index , segment_id ); test_assert_true( well_segment_is_instance( segment )); diff --git a/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_QC.c b/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_QC.c index aa86d333e2..59cc23597f 100644 --- a/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_QC.c +++ b/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_QC.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -52,6 +53,8 @@ #include #include #include +#include +#include #include #include @@ -60,100 +63,78 @@ #include -void enkf_tui_QC_plot_get_PC( enkf_main_type * enkf_main , int step1 , int step2 , state_enum state , const local_obsset_type * obsset , - double truncation , int ncomp , - matrix_type * PC , matrix_type * PC_obs) { - - bool_vector_type * ens_mask = bool_vector_alloc(0 , false); - obs_data_type * obs_data = obs_data_alloc(); - analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - int_vector_type * step_list = int_vector_alloc(0,0); - enkf_fs_type * source_fs = enkf_main_get_fs( enkf_main); - state_map_type * state_map = enkf_fs_get_state_map(source_fs); - int_vector_type * ens_active_list; - meas_data_type * meas_data; - - state_map_select_matching(state_map , ens_mask , STATE_HAS_DATA); - ens_active_list = bool_vector_alloc_active_list(ens_mask); - meas_data = meas_data_alloc(ens_active_list); - { - for (int step =step1; step <= step2; step++) - int_vector_append( step_list , step ); - } - - obs_data_reset( obs_data ); - meas_data_reset( meas_data ); + +void enkf_tui_QC_plot_PC_list( void * arg ) { + enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); + stringlist_type * all_obs_keys = enkf_obs_alloc_keylist( enkf_main_get_obs( enkf_main )); + stringlist_type * obs_keys = stringlist_alloc_new(); { - double std_cutoff = analysis_config_get_std_cutoff( analysis_config ); - double alpha = analysis_config_get_alpha( analysis_config ); - - enkf_obs_get_obs_and_measure(enkf_main_get_obs( enkf_main ), - source_fs , - step_list , - state, - ens_active_list , - (const enkf_state_type **) enkf_main_get_ensemble( enkf_main ), - meas_data , - obs_data , - obsset ); - - enkf_analysis_deactivate_outliers( obs_data , meas_data , std_cutoff , alpha); + char * keys_input; + util_printf_prompt("Observation keys (wildcards allowed) - [default: all]", PROMPT_LEN, '=', "=> "); + keys_input = util_alloc_stdin_line(); + if (keys_input) + { + stringlist_type * pattern_list = stringlist_alloc_from_split(keys_input, " ,"); + for (int i = 0; i < stringlist_get_size(pattern_list); i++) + { + const char * pattern = stringlist_iget(pattern_list, i); + stringlist_append_matching_elements(obs_keys, all_obs_keys, pattern); + } + free(keys_input); + } } - - { - int active_size = obs_data_get_active_size( obs_data ); - matrix_type * S = meas_data_allocS( meas_data , active_size ); - matrix_type * dObs = obs_data_allocdObs( obs_data , active_size ); - obs_data_scale( obs_data , S , NULL , NULL , NULL , dObs ); - enkf_main_get_PC( enkf_main , S , dObs , local_obsset_get_name( obsset ) , step1 , step2 , truncation , ncomp , PC , PC_obs ); - - matrix_free( S ); - matrix_free( dObs ); - } + if (stringlist_get_size(obs_keys) > 0) + { + const int last_report = enkf_main_get_history_length(enkf_main); + vector_type * PC_list = vector_alloc_new(); + const int ncomp = 1; + + for (int iobs = 0; iobs < stringlist_get_size(obs_keys); iobs++) + { + local_obsdata_node_type * obsnode = local_obsdata_node_alloc(stringlist_iget(obs_keys, iobs)); + local_obsdata_type * obsdata = local_obsdata_alloc_wrapper(obsnode); + local_obsdata_node_add_range(obsnode, 0, last_report); + { + pca_plot_data_type * plot_data = enkf_main_alloc_pca_plot_data(enkf_main, obsdata, ncomp); + vector_append_owned_ref(PC_list, plot_data, pca_plot_data_free__); + } + local_obsdata_free(obsdata); + } + enkf_tui_plot_PC_list(enkf_main , PC_list); + vector_free(PC_list); + } else + printf("Sorry: no observation keys mathced the pattern(s).\n"); - bool_vector_free(ens_mask); - int_vector_free( step_list ); - obs_data_free( obs_data ); - meas_data_free( meas_data ); + stringlist_free( obs_keys ); + stringlist_free( all_obs_keys ); } void enkf_tui_QC_plot_PC( void * arg ) { enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - local_config_type * local_config = enkf_main_get_local_config( enkf_main ); - analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - int ens_size = enkf_main_get_ensemble_size( enkf_main ); const int last_report = enkf_main_get_history_length( enkf_main ); int step1,step2; - int ncomp; - double truncation; + double truncation_or_ncomp; + local_obsdata_type * obsdata = local_obsdata_alloc("PCA Observations"); + char * keys_input; - state_enum state = FORECAST; - const local_updatestep_type * update_step; - local_obsset_type * obsset; - enkf_tui_util_scanf_report_steps(last_report , PROMPT_LEN , &step1 , &step2); + util_printf_prompt("Observation keys (wildcards allowed) - [default: all]" , PROMPT_LEN , '=' , "=> "); + keys_input = util_alloc_stdin_line(); + util_printf_prompt("Truncation: [0,1): Explained variance [1,ens_size): fixed" , PROMPT_LEN , '=' , "=> "); + { char * input = util_alloc_stdin_line(); if (input == NULL) return; else { - double truncation_or_ncomp; - if (util_sscanf_double( input , &truncation_or_ncomp)) { - if (truncation_or_ncomp < 1) { - truncation = truncation_or_ncomp; - ncomp = -1; - } else { - truncation = -1; - ncomp = util_int_min( (int) truncation_or_ncomp , ens_size ); - } - } else { + if (!util_sscanf_double( input , &truncation_or_ncomp)) { fprintf(stderr , "Failed to parse:%s as number \n",input); free( input ); return; @@ -163,41 +144,57 @@ void enkf_tui_QC_plot_PC( void * arg ) { free( input ); } - update_step = local_config_iget_updatestep( local_config , step2 ); { - int obsset_nr = 0; - if (local_updatestep_get_num_ministep( update_step) > 1) { - stringlist_type * obsset_list = stringlist_alloc_new(); - for (int i =0; i < local_updatestep_get_num_ministep( update_step ); i++) { - local_obsset_type * obsset = local_updatestep_iget_obsset( update_step , i ); - stringlist_append_ref( obsset_list , local_obsset_get_name( obsset )); - - printf(" %02d : %s \n", i +1 , local_obsset_get_name( obsset )); - } - stringlist_free( obsset_list ); + stringlist_type * all_keys = enkf_obs_alloc_keylist( enkf_main_get_obs( enkf_main )); + stringlist_type * obs_keys = stringlist_alloc_new(); - obsset_nr = util_scanf_int( "Choose observation set" , PROMPT_LEN ); - obsset_nr--; - } - if ((obsset_nr < 0) || (obsset_nr >= local_updatestep_get_num_ministep( update_step))) - return; - - obsset = local_updatestep_iget_obsset( update_step , obsset_nr ); - } - - { + if (keys_input) { + stringlist_type * input_keys = stringlist_alloc_from_split( keys_input , " "); + int i; + for (i=0; i < stringlist_get_size( input_keys ); i++) + stringlist_append_matching_elements( obs_keys , all_keys , stringlist_iget( input_keys , i )); + stringlist_free( input_keys ); + } else + stringlist_deep_copy( obs_keys , all_keys ); + + + + + { + int iobs; + + for (iobs = 0; iobs < stringlist_get_size( obs_keys); iobs++) { + const char * obs_key = stringlist_iget( obs_keys , iobs ); + if (!local_obsdata_has_node( obsdata , obs_key )) { + local_obsdata_node_type * obs_node = local_obsdata_node_alloc( obs_key ); + + local_obsdata_node_add_range( obs_node , step1 , step2 ); + local_obsdata_add_node( obsdata , obs_node ); + } + } + + stringlist_free( all_keys ); + stringlist_free( obs_keys ); + } + } + + if (local_obsdata_get_size( obsdata )) { matrix_type * PC = matrix_alloc(1,1); matrix_type * PC_obs = matrix_alloc(1,1); + analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); char * plot_name = util_alloc_sprintf(analysis_config_get_PC_filename( analysis_config ) , - step1 , step2 , local_obsset_get_name( obsset )); + step1 , step2 , "obs"); + + pca_plot_data_type * plot_data = enkf_main_alloc_pca_plot_data( enkf_main , obsdata , truncation_or_ncomp); - enkf_tui_QC_plot_get_PC( enkf_main , step1 , step2 , state , obsset , truncation , ncomp , PC , PC_obs ); - enkf_tui_plot_PC( enkf_main , plot_name , PC , PC_obs ); + enkf_tui_plot_PC( enkf_main , plot_name , plot_data ); free( plot_name ); matrix_free( PC ); matrix_free( PC_obs ); + pca_plot_data_free( plot_data ); } + local_obsdata_free( obsdata ); } @@ -221,11 +218,18 @@ void enkf_tui_QC_menu(void * arg) { { menu_type * menu = menu_alloc("Quality check of prior" , "Back" , "bB"); - menu_item_type * plot_PC_item = menu_add_item( menu , "Plot of prior principal components" , "pP" , enkf_tui_QC_plot_PC , enkf_main , NULL); + menu_item_type * plot_PC_item = menu_add_item( menu , "Plot of prior principal components" , "pP" , + enkf_tui_QC_plot_PC , enkf_main , NULL); + + menu_item_type * plot_PC_list_item = menu_add_item( menu , "Plot first principal component for all observations" , "aA" , + enkf_tui_QC_plot_PC_list, enkf_main , NULL); + menu_item_type * run_QC_workflow_item = menu_add_item( menu , "Run QC workflow" , "rR" , enkf_tui_QC_run_workflow , enkf_main , NULL); - if (!enkf_main_have_obs( enkf_main )) + if (!enkf_main_have_obs( enkf_main )) { menu_item_disable( plot_PC_item ); + menu_item_disable( plot_PC_list_item ); + } if (!enkf_main_has_QC_workflow( enkf_main )) menu_item_disable( run_QC_workflow_item ); diff --git a/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_plot.c b/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_plot.c index fb48e38171..4a4620a0f9 100644 --- a/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_plot.c +++ b/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_plot.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include @@ -88,32 +89,84 @@ static void __plot_add_data(plot_type * plot , const char * label , int N , cons -void enkf_tui_plot_PC( enkf_main_type * enkf_main , const char * plot_name , const matrix_type * PC , const matrix_type * PC_obs) { + + +void enkf_tui_plot_PC_list( enkf_main_type * enkf_main , const vector_type * PC_list ) { + plot_config_type * plot_config = enkf_main_get_plot_config( enkf_main ); + char * plot_file = enkf_tui_plot_alloc_plot_file( plot_config , enkf_main_get_current_fs( enkf_main ), "PC_list" ); + plot_type * plot = enkf_tui_plot_alloc(plot_config , + "Standardized PC value " , + "Observation #", + "Principle components" , + plot_file); + + int num_obs = vector_get_size( PC_list ); + int iobs; + for (iobs = 0; iobs < num_obs; iobs++) { + const pca_plot_data_type * pca_data = vector_iget_const( PC_list , iobs ); + const pca_plot_vector_type * pca_vector = pca_plot_data_iget_vector( pca_data , 0 ); + int ens_size = pca_plot_vector_get_size( pca_vector ); + { + char * data_label = util_alloc_sprintf("%s - simulated" , pca_plot_data_get_name( pca_data )); + plot_dataset_type * sim_data = plot_alloc_new_dataset( plot , data_label , PLOT_XY ); + plot_dataset_set_style( sim_data , POINTS ); + plot_dataset_set_point_color( sim_data , BLUE); + for (int iens = 0; iens < ens_size; iens++) + plot_dataset_append_point_xy( sim_data , + pca_plot_vector_iget_sim_value( pca_vector , iens ), + iobs ); + free( data_label ); + } + { + char * obs_label = util_alloc_sprintf("%s - obs" , pca_plot_data_get_name( pca_data )); + plot_dataset_type * obs_data = plot_alloc_new_dataset( plot , obs_label , PLOT_XY ); + plot_dataset_set_style( obs_data , POINTS ); + plot_dataset_set_point_color( obs_data , RED); + plot_dataset_append_point_xy( obs_data , pca_plot_vector_get_obs_value( pca_vector ) , iobs ); + free( obs_label ); + } + // POsition of text is not considered when the autorange is applied; i.e. with + // fixed coordinates it might fall outside the clipping region ... + plot_add_text( plot , -0.75 , iobs , 0.35 , pca_plot_data_get_name( pca_data )); + } + enkf_tui_show_plot( plot , plot_config , plot_file ); /* Frees the plot - logical ehhh. */ + free( plot_file ); +} + + + +void enkf_tui_plot_PC( enkf_main_type * enkf_main , const char * plot_name , const pca_plot_data_type * plot_data) { plot_config_type * plot_config = enkf_main_get_plot_config( enkf_main ); char * plot_file = enkf_tui_plot_alloc_plot_file( plot_config , enkf_main_get_current_fs( enkf_main ), plot_name ); plot_type * plot = enkf_tui_plot_alloc(plot_config , "PC number", /* y akse */ "Standardized PC value " , "Principle components" , plot_file); { - const int num_PC = matrix_get_rows( PC ); - const int ens_size = matrix_get_columns( PC ); + const int num_PC = pca_plot_data_get_size( plot_data ); + const int ens_size = pca_plot_data_get_ens_size( plot_data ); int ipc, iens; { plot_dataset_type * sim_data = plot_alloc_new_dataset( plot , "simulated" , PLOT_XY ); plot_dataset_set_style( sim_data , POINTS ); plot_dataset_set_point_color( sim_data , BLUE); - for (ipc = 0; ipc < num_PC; ipc++) + for (ipc = 0; ipc < num_PC; ipc++) { + const pca_plot_vector_type * pca_vector = pca_plot_data_iget_vector( plot_data , ipc ); for (iens =0; iens < ens_size; iens++) - plot_dataset_append_point_xy( sim_data , (ipc + 1) , matrix_iget( PC , ipc , iens )); + plot_dataset_append_point_xy( sim_data , + (ipc + 1) , + pca_plot_vector_iget_sim_value( pca_vector , iens )); + } } { plot_dataset_type * obs_data = plot_alloc_new_dataset( plot , "observation" , PLOT_XY ); plot_dataset_set_style( obs_data , POINTS ); plot_dataset_set_point_color( obs_data , RED); - for (ipc = 0; ipc < num_PC; ipc++) - plot_dataset_append_point_xy( obs_data , (ipc + 1) , matrix_iget( PC_obs , ipc , 0 )); + for (ipc = 0; ipc < num_PC; ipc++) { + const pca_plot_vector_type * pca_vector = pca_plot_data_iget_vector( plot_data , ipc ); + plot_dataset_append_point_xy( obs_data , (ipc + 1) , pca_plot_vector_get_obs_value( pca_vector )); + } } } enkf_tui_show_plot( plot , plot_config , plot_file ); /* Frees the plot - logical ehhh. */ diff --git a/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_plot.h b/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_plot.h index 52c5391c33..eafdb69555 100644 --- a/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_plot.h +++ b/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_plot.h @@ -21,12 +21,15 @@ #include +#include +#include #include void enkf_tui_plot_simple_menu(void * ); void enkf_tui_plot_menu(void * ); -void enkf_tui_plot_PC( enkf_main_type * enkf_main , const char * plot_name , const matrix_type * PC , const matrix_type * PC_obs); +void enkf_tui_plot_PC( enkf_main_type * enkf_main , const char * plot_name , const pca_plot_data_type * plot_data); +void enkf_tui_plot_PC_list( enkf_main_type * enkf_main , const vector_type * PC_list ); void enkf_tui_plot_reports(void *); void enkf_tui_plot_all_summary__( enkf_main_type * enkf_main , int iens1 , int iens2 , int step1 , int step2 , bool prediction_mode); diff --git a/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_run.c b/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_run.c index 7a551ed766..95cc75f138 100644 --- a/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_run.c +++ b/ThirdParty/Ert/devel/libenkf/applications/ert_tui/enkf_tui_run.c @@ -318,12 +318,13 @@ void enkf_tui_run_menu(void * arg) { { const ecl_config_type * ecl_config = enkf_main_get_ecl_config( enkf_main ); const model_config_type * model_config = enkf_main_get_model_config( enkf_main ); + const analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main); menu_item_type * enkf_item = menu_add_item(menu , "Start EnKF run from beginning" , "sS" , enkf_tui_run_start , enkf_main , NULL); menu_item_type * restart_enkf_item = menu_add_item(menu , "Restart EnKF run from arbitrary state" , "rR" , enkf_tui_run_restart__ , enkf_main , NULL); menu_item_type * ES_item = menu_add_item(menu , "Integrated smoother update" , "iI" , enkf_tui_run_smoother , enkf_main , NULL); menu_item_type * it_ES_item = menu_add_item(menu , "Iterated smoother [RML-EnKF]" , "tT" , enkf_tui_run_iterated_ES , enkf_main , NULL); - menu_item_type * one_more_item = menu_add_item(menu , "One more iteration" , "mM" , enkf_tui_run_one_more_iteration , enkf_main , NULL); + menu_item_type * one_more_item = menu_add_item(menu , "One more iteration (disabled)" , "mM" , enkf_tui_run_one_more_iteration , enkf_main , NULL); if (!ecl_config_has_schedule( ecl_config )) { menu_item_disable( enkf_item ); @@ -333,9 +334,20 @@ void enkf_tui_run_menu(void * arg) { if (!ecl_config_has_init_section( ecl_config )) menu_item_disable( enkf_item ); + menu_item_disable( one_more_item ); + if (!analysis_config_get_module_option(analysis_config , ANALYSIS_ITERABLE)) { + menu_item_disable( it_ES_item ); + menu_item_disable( one_more_item ); + } else { + menu_item_disable( enkf_item ); + menu_item_disable( restart_enkf_item ); + menu_item_disable( ES_item ); + } + if (!model_config_has_history( model_config )) { menu_item_disable( it_ES_item ); menu_item_disable( ES_item ); + menu_item_disable( one_more_item ); } } menu_add_separator(menu); @@ -367,5 +379,4 @@ void enkf_tui_run_menu(void * arg) { menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_run , enkf_main , NULL); menu_run(menu); menu_free(menu); - } diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/active_list.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/active_list.h index a44e976094..9e1e90c68b 100644 --- a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/active_list.h +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/active_list.h @@ -22,25 +22,31 @@ #ifdef __cplusplus extern "C" { #endif +#include + #include typedef struct active_list_struct active_list_type; -active_list_type * active_list_alloc( active_mode_type mode ); -void active_list_reset(active_list_type * ); -void active_list_add_index(active_list_type * , int); -void active_list_free( active_list_type *); -const int * active_list_get_active(const active_list_type * ); -int active_list_get_active_size(const active_list_type * , int total_size ); -void active_list_set_all_active(active_list_type * ); -void active_list_set_data_size(active_list_type * , int ); -void active_list_free( active_list_type * ); -active_mode_type active_list_get_mode(const active_list_type * ); -void active_list_free__( void * arg ); -active_list_type * active_list_alloc_copy( const active_list_type * src); -void active_list_fprintf( const active_list_type * active_list , bool obs , const char * key , FILE * stream ); -bool active_list_iget( const active_list_type * active_list , int index ); + active_list_type * active_list_alloc( ); + void active_list_reset(active_list_type * ); + void active_list_add_index(active_list_type * , int); + void active_list_free( active_list_type *); + const int * active_list_get_active(const active_list_type * ); + int active_list_get_active_size(const active_list_type * , int total_size ); + void active_list_set_all_active(active_list_type * ); + void active_list_set_data_size(active_list_type * , int ); + void active_list_free( active_list_type * ); + active_mode_type active_list_get_mode(const active_list_type * ); + void active_list_free__( void * arg ); + active_list_type * active_list_alloc_copy( const active_list_type * src); + void active_list_fprintf( const active_list_type * active_list , bool obs , const char * key , FILE * stream ); + bool active_list_iget( const active_list_type * active_list , int index ); + bool active_list_equal( const active_list_type * active_list1 , const active_list_type * active_list2); + void active_list_copy( active_list_type * target , const active_list_type * src); + +UTIL_IS_INSTANCE_HEADER( active_list ); #ifdef __cplusplus } diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/analysis_config.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/analysis_config.h index f5d4b2846a..4e167846f9 100644 --- a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/analysis_config.h +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/analysis_config.h @@ -43,8 +43,11 @@ typedef struct analysis_config_struct analysis_config_type; analysis_iter_config_type * analysis_config_get_iter_config( const analysis_config_type * config ); analysis_module_type * analysis_config_get_module( analysis_config_type * config , const char * module_name ); +void analysis_config_load_internal_module( analysis_config_type * config , const char * user_name , const char * symbol_table ); void analysis_config_load_internal_modules( analysis_config_type * analysis ); void analysis_config_reload_module( analysis_config_type * config , const char * module_name); +bool analysis_config_get_module_option( const analysis_config_type * config , long flag); +bool analysis_config_load_external_module( analysis_config_type * config , const char * user_name , const char * lib_name); stringlist_type * analysis_config_alloc_module_names( analysis_config_type * config ); const char * analysis_config_get_log_path( const analysis_config_type * config ); @@ -96,10 +99,14 @@ void analysis_config_set_PC_filename( analysis_config_type * c const char * analysis_config_get_PC_filename( const analysis_config_type * config ); void analysis_config_set_PC_path( analysis_config_type * config , const char * path ); const char * analysis_config_get_PC_path( const analysis_config_type * config ); - void analysis_config_set_min_realisations( analysis_config_type * config , int min_realisations); - int analysis_config_get_min_realisations( const analysis_config_type * config ); - bool analysis_config_have_enough_realisations( const analysis_config_type * config , int realisations); - +void analysis_config_set_min_realisations( analysis_config_type * config , int min_realisations); +int analysis_config_get_min_realisations( const analysis_config_type * config ); +bool analysis_config_have_enough_realisations( const analysis_config_type * config , int realisations); +void analysis_config_set_stop_long_running( analysis_config_type * config, bool stop_long_running ); +bool analysis_config_get_stop_long_running( const analysis_config_type * config); +void analysis_config_set_max_runtime( analysis_config_type * config, int max_runtime ); +int analysis_config_get_max_runtime( const analysis_config_type * config ); +const char * analysis_config_get_active_module_name( const analysis_config_type * config ); UTIL_IS_INSTANCE_HEADER( analysis_config ); diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/analysis_iter_config.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/analysis_iter_config.h index 74988d2274..5392d59ba6 100644 --- a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/analysis_iter_config.h +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/analysis_iter_config.h @@ -36,7 +36,9 @@ typedef struct analysis_iter_config_struct analysis_iter_config_type; const char * analysis_iter_config_iget_runpath_fmt( analysis_iter_config_type * config , int iter); void analysis_iter_config_add_config_items( config_type * config ); void analysis_iter_config_init(analysis_iter_config_type * iter_config , const config_type * config); - + void analysis_iter_config_set_runpath_fmt( analysis_iter_config_type * config , const char * runpath_fmt); + char * analysis_iter_config_get_runpath_fmt( analysis_iter_config_type * config); + #ifdef __cplusplus } #endif diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/config_keys.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/config_keys.h index 0b853ff007..5f1edd8358 100644 --- a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/config_keys.h +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/config_keys.h @@ -168,6 +168,8 @@ extern "C" { #define WORKFLOW_JOB_DIRECTORY_KEY "WORKFLOW_JOB_DIRECTORY" #define LOAD_WORKFLOW_KEY "LOAD_WORKFLOW" #define LOAD_WORKFLOW_JOB_KEY "LOAD_WORKFLOW_JOB" +#define STOP_LONG_RUNNING_KEY "STOP_LONG_RUNNING" +#define MAX_RUNTIME_KEY "MAX_RUNTIME" #define CONFIG_BOOL_STRING( var ) (var) ? "TRUE" : "FALSE" diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/enkf_defaults.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/enkf_defaults.h index 1449f3b376..c2bf38a4f2 100644 --- a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/enkf_defaults.h +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/enkf_defaults.h @@ -95,31 +95,34 @@ Defaults for the EnKF analysis. The analysis_config object is instantiated with these values. */ -#define DEFAULT_ENKF_MODE ENKF_STANDARD -#define DEFAULT_NCOMP 1 -#define DEFAULT_ENKF_TRUNCATION 0.99 -#define DEFAULT_ENKF_ALPHA 1.50 /* Should be raised ?? */ -#define DEFAULT_ENKF_STD_CUTOFF 1e-6 -#define DEFAULT_MERGE_OBSERVATIONS false -#define DEFAULT_RERUN false -#define DEFAULT_RERUN_START 0 -#define DEFAULT_UPDATE_LOG_PATH "update_log" -#define DEFAULT_CV_NFOLDS 10 -#define DEFAULT_ENKF_SCALING true -#define DEFAULT_ENKF_KERNEL_REG false -#define DEFAULT_ENKF_KERNEL_FUNC 1 /*Default is the Gaussian */ -#define DEFAULT_ENKF_KERNEL_PARAM 1 /*Scale by the maximum value in the distance matrix */ -#define DEFAULT_ENKF_CV false -#define DEFAULT_ENKF_BOOTSTRAP false -#define DEFAULT_ENKF_PEN_PRESS false -#define DEFAULT_ENKF_FORCE_NCOMP false -#define DEFAULT_UPDATE_RESULTS false -#define DEFAULT_SINGLE_NODE_UPDATE true -#define DEFAULT_ANALYSIS_MODULE "STD_ENKF" -#define DEFAULT_ANALYSIS_NUM_ITERATIONS 4 -#define DEFAULT_ANALYSIS_ITER_CASE "ITERATED_ENSEMBLE_SMOOTHER%d" -#define DEFAULT_ANALYSIS_ITER_RUNPATH "Simulations/Real%d" -#define DEFAULT_ANALYSIS_MIN_REALISATIONS 0 // 0: No lower limit +#define DEFAULT_ENKF_MODE ENKF_STANDARD +#define DEFAULT_NCOMP 1 +#define DEFAULT_ENKF_TRUNCATION 0.99 +#define DEFAULT_ENKF_ALPHA 1.50 /* Should be raised ?? */ +#define DEFAULT_ENKF_STD_CUTOFF 1e-6 +#define DEFAULT_MERGE_OBSERVATIONS false +#define DEFAULT_RERUN false +#define DEFAULT_RERUN_START 0 +#define DEFAULT_UPDATE_LOG_PATH "update_log" +#define DEFAULT_CV_NFOLDS 10 +#define DEFAULT_ENKF_SCALING true +#define DEFAULT_ENKF_KERNEL_REG false +#define DEFAULT_ENKF_KERNEL_FUNC 1 /*Default is the Gaussian */ +#define DEFAULT_ENKF_KERNEL_PARAM 1 /*Scale by the maximum value in the distance matrix */ +#define DEFAULT_ENKF_CV false +#define DEFAULT_ENKF_BOOTSTRAP false +#define DEFAULT_ENKF_PEN_PRESS false +#define DEFAULT_ENKF_FORCE_NCOMP false +#define DEFAULT_UPDATE_RESULTS false +#define DEFAULT_SINGLE_NODE_UPDATE false +#define DEFAULT_ANALYSIS_MODULE "STD_ENKF" +#define DEFAULT_ANALYSIS_NUM_ITERATIONS 4 +#define DEFAULT_ANALYSIS_ITER_CASE "ITERATED_ENSEMBLE_SMOOTHER%d" +#define DEFAULT_ANALYSIS_ITER_RUNPATH "Simulations/Real%d" +#define DEFAULT_ANALYSIS_MIN_REALISATIONS 0 // 0: No lower limit +#define DEFAULT_ANALYSIS_STOP_LONG_RUNNING false +#define DEFAULT_MAX_RUNTIME 0 + /* Default directories. */ #define DEFAULT_QC_PATH "QC" diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/enkf_main.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/enkf_main.h index 33135000c0..a2c34d8ce4 100644 --- a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/enkf_main.h +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/enkf_main.h @@ -58,12 +58,13 @@ extern "C" { #include #include #include +#include /*****************************************************************/ typedef struct enkf_main_struct enkf_main_type; - void enkf_main_close_alt_fs(enkf_main_type * enkf_main , enkf_fs_type * fs); - enkf_fs_type * enkf_main_get_alt_fs(enkf_main_type * enkf_main , const char * case_path , bool read_only , bool create); + void enkf_main_close_alt_fs(const enkf_main_type * enkf_main , enkf_fs_type * fs); + enkf_fs_type * enkf_main_get_alt_fs(const enkf_main_type * enkf_main , const char * case_path , bool read_only , bool create); stringlist_type * enkf_main_alloc_caselist( const enkf_main_type * enkf_main ); void enkf_main_set_fs( enkf_main_type * enkf_main , enkf_fs_type * fs , const char * case_path ); char * enkf_main_alloc_mount_point( const enkf_main_type * enkf_main , const char * case_path); @@ -144,6 +145,7 @@ extern "C" { ert_impl_type enkf_main_impl_type(const enkf_main_type *, const char * ); enkf_state_type * enkf_main_iget_state(const enkf_main_type * , int ); enkf_state_type ** enkf_main_get_ensemble( enkf_main_type * enkf_main); + const enkf_state_type ** enkf_main_get_ensemble_const( const enkf_main_type * enkf_main); const enkf_config_node_type * enkf_main_get_config_node(const enkf_main_type * , const char *); const sched_file_type * enkf_main_get_sched_file(const enkf_main_type *); @@ -200,6 +202,11 @@ extern "C" { const stringlist_type * node_list); +pca_plot_data_type * enkf_main_alloc_pca_plot_data( const enkf_main_type * enkf_main , + local_obsdata_type * obs_data, + double truncation_or_ncomp); + + void enkf_main_set_case_table( enkf_main_type * enkf_main , const char * case_table_file ); void enkf_main_list_users( set_type * users , const char * executable ); const ext_joblist_type * enkf_main_get_installed_jobs( const enkf_main_type * enkf_main ); @@ -218,6 +225,7 @@ extern "C" { void enkf_main_install_SIGNALS(void); const char * enkf_main_get_SVN_VERSION( void ); const char * enkf_main_get_COMPILE_TIME( void ); + bool enkf_main_case_is_initialized( const enkf_main_type * enkf_main , const char * case_name , bool_vector_type * __mask); bool enkf_main_is_initialized( const enkf_main_type * enkf_main ,bool_vector_type * __mask); void enkf_main_del_node(enkf_main_type * enkf_main , const char * key); void enkf_main_update_node( enkf_main_type * enkf_main , const char * key ); @@ -227,16 +235,23 @@ extern "C" { qc_module_type * enkf_main_get_qc_module( const enkf_main_type * enkf_main ); bool enkf_main_has_QC_workflow( const enkf_main_type * enkf_main ); - void enkf_main_get_PC( const enkf_main_type * enkf_main , - const matrix_type * S, + void enkf_main_get_PC( const matrix_type * S, const matrix_type * dObs, - const char * obsset_name , - int step1 , int step2 , double truncation , int ncomp , matrix_type * PC , matrix_type * PC_obs); + void enkf_main_init_PC( const enkf_main_type * enkf_main , + const local_obsdata_type * obsdata , + double truncation_or_ncomp , + matrix_type * PC , + matrix_type * PC_obs ); + + void enkf_main_fprintf_PC(const char * filename , + matrix_type * PC , + matrix_type * PC_obs); + void enkf_main_set_verbose( enkf_main_type * enkf_main , bool verbose); bool enkf_main_get_verbose( const enkf_main_type * enkf_main ); @@ -251,6 +266,7 @@ extern "C" { void enkf_main_rng_init( enkf_main_type * enkf_main); UTIL_SAFE_CAST_HEADER(enkf_main); +UTIL_IS_INSTANCE_HEADER(enkf_main); #ifdef __cplusplus } diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/enkf_obs.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/enkf_obs.h index 866898254a..bbd04c6bce 100644 --- a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/enkf_obs.h +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/enkf_obs.h @@ -38,6 +38,8 @@ extern "C" { #include #include #include +#include +#include bool enkf_obs_have_obs( const enkf_obs_type * enkf_obs ); const char * enkf_obs_get_config_file( const enkf_obs_type * enkf_obs); @@ -71,6 +73,26 @@ extern "C" { const local_obsset_type * obsset); + void enkf_obs_get_obs_and_measure_node( const enkf_obs_type * enkf_obs, + enkf_fs_type * fs, + const local_obsdata_node_type * obs_node , + state_enum state, + const int_vector_type * ens_active_list , + const enkf_state_type ** ensemble , + meas_data_type * meas_data, + obs_data_type * obs_data); + + + void enkf_obs_get_obs_and_measure_data(const enkf_obs_type * enkf_obs, + enkf_fs_type * fs, + const local_obsdata_type * local_obsdata , + state_enum state, + const int_vector_type * ens_active_list , + const enkf_state_type ** ensemble , + meas_data_type * meas_data, + obs_data_type * obs_data); + + stringlist_type * enkf_obs_alloc_typed_keylist( enkf_obs_type * enkf_obs , obs_impl_type ); hash_type * enkf_obs_alloc_data_map(enkf_obs_type * enkf_obs); @@ -78,7 +100,8 @@ extern "C" { bool enkf_obs_has_key(const enkf_obs_type * , const char * ); hash_iter_type * enkf_obs_alloc_iter( const enkf_obs_type * enkf_obs ); - + + stringlist_type * enkf_obs_alloc_keylist(enkf_obs_type * enkf_obs ); stringlist_type * enkf_obs_alloc_matching_keylist(const enkf_obs_type * enkf_obs , const char * input_string); time_t enkf_obs_iget_obs_time(enkf_obs_type * enkf_obs , int report_step); void enkf_obs_fprintf_config( const enkf_obs_type * enkf_obs , FILE * stream); diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/local_obsdata.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/local_obsdata.h new file mode 100644 index 0000000000..88f1303c5e --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/local_obsdata.h @@ -0,0 +1,46 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'local_obsdata.h' + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#ifndef __LOCAL_OBSDATA_H__ +#define __LOCAL_OBSDATA_H__ + +#ifdef __cplusplus +extern "C" { +#endif +#include + +#include + +#include + +typedef struct local_obsdata_struct local_obsdata_type; + + bool local_obsdata_has_node( const local_obsdata_type * data , const char * key); + local_obsdata_type * local_obsdata_alloc( const char * name ); + void local_obsdata_free( local_obsdata_type * data ); + int local_obsdata_get_size( const local_obsdata_type * data ); + bool local_obsdata_add_node( local_obsdata_type * data , local_obsdata_node_type * node ); + const local_obsdata_node_type * local_obsdata_iget( const local_obsdata_type * data , int index); + local_obsdata_type * local_obsdata_alloc_wrapper( local_obsdata_node_type * node ); + const char * local_obsdata_get_name( const local_obsdata_type * data); + +UTIL_IS_INSTANCE_HEADER( local_obsdata ); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/local_obsdata_node.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/local_obsdata_node.h new file mode 100644 index 0000000000..387b2ee6f6 --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/local_obsdata_node.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'local_obsdata_node.h' + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#ifndef __LOCAL_OBSDATA_NODE_H__ +#define __LOCAL_OBSDATA_NODE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#include +#include + + + typedef struct local_obsdata_node_struct local_obsdata_node_type; + + local_obsdata_node_type * local_obsdata_node_alloc( const char * obs_key ); + const char * local_obsdata_node_get_key( const local_obsdata_node_type * node ); + void local_obsdata_node_free( local_obsdata_node_type * node ); + void local_obsdata_node_free__( void * arg ); + active_list_type * local_obsdata_node_get_active_list( const local_obsdata_node_type * node ); + const obs_tstep_list_type * local_obsdata_node_get_tstep_list( const local_obsdata_node_type * node); + void local_obsdata_node_copy_active_list( local_obsdata_node_type * node , const active_list_type * active_list); + void local_obsdata_node_add_tstep( local_obsdata_node_type * node, int tstep); + void local_obsdata_node_add_range( local_obsdata_node_type * node, int step1, int step2); + +UTIL_IS_INSTANCE_HEADER( local_obsdata_node ); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/obs_tstep_list.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/obs_tstep_list.h new file mode 100644 index 0000000000..414ec8c8e2 --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/obs_tstep_list.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'obs_tstep_list.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + +#ifndef __OBS_TSTEP_LIST_H__ +#define __OBS_TSTEP_LIST_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#include + + typedef struct obs_tstep_list_struct obs_tstep_list_type; + + obs_tstep_list_type * obs_tstep_list_alloc(); + void obs_tstep_list_free( obs_tstep_list_type * list ); + bool obs_tstep_list_all_active( const obs_tstep_list_type * list ); + int obs_tstep_list_get_size( const obs_tstep_list_type * list ); + void obs_tstep_list_add_tstep( obs_tstep_list_type * list , int tstep); + void obs_tstep_list_add_range( obs_tstep_list_type * list , int step1 , int step2); + bool obs_tstep_list_contains( const obs_tstep_list_type * list , int tstep); + int obs_tstep_list_iget( const obs_tstep_list_type * list , int index); + int obs_tstep_list_get_last( const obs_tstep_list_type * list ); + + UTIL_IS_INSTANCE_HEADER( obs_tstep_list ); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/pca_plot_data.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/pca_plot_data.h new file mode 100644 index 0000000000..4c57357be8 --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/pca_plot_data.h @@ -0,0 +1,46 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'pca_plot_data.h' + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#ifndef __PCA_PLOT_DATA_H__ +#define __PCA_PLOT_DATA_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#include + + typedef struct pca_plot_data_struct pca_plot_data_type; + + pca_plot_data_type * pca_plot_data_alloc( const char * name , const matrix_type * PC, const matrix_type * PC_obs); + + void pca_plot_data_free( pca_plot_data_type * plot_data ); + const pca_plot_vector_type * pca_plot_data_iget_vector( const pca_plot_data_type * plot_data , int ivec); + int pca_plot_data_get_size( const pca_plot_data_type * plot_data ); + const char * pca_plot_data_get_name( const pca_plot_data_type * plot_data ); + int pca_plot_data_get_ens_size( const pca_plot_data_type * plot_data ); + void pca_plot_data_free__( void * arg ); + + UTIL_IS_INSTANCE_HEADER( pca_plot_data ); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/pca_plot_vector.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/pca_plot_vector.h new file mode 100644 index 0000000000..dc83e4a637 --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/pca_plot_vector.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'pca_plot_vector.h' + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#ifndef __PCA_PLOT_VECTOR_H__ +#define __PCA_PLOT_VECTOR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + + typedef struct pca_plot_vector_struct pca_plot_vector_type; + + pca_plot_vector_type * pca_plot_vector_alloc( int component , const matrix_type * PC, const matrix_type * PC_obs); + + void pca_plot_vector_free( pca_plot_vector_type * plot_vector ); + bool pca_plot_assert_input( const matrix_type * PC, const matrix_type * PC_obs); + void pca_plot_vector_free__( void * arg ); + double pca_plot_vector_get_obs_value( const pca_plot_vector_type * vector ); + double pca_plot_vector_iget_sim_value( const pca_plot_vector_type * vector , int sim_index); + int pca_plot_vector_get_size( const pca_plot_vector_type * vector ); + + UTIL_IS_INSTANCE_HEADER( pca_plot_vector ); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/state_map.h b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/state_map.h index ef6288b787..d2637857ad 100644 --- a/ThirdParty/Ert/devel/libenkf/include/ert/enkf/state_map.h +++ b/ThirdParty/Ert/devel/libenkf/include/ert/enkf/state_map.h @@ -37,6 +37,7 @@ extern "C" { int state_map_get_size( state_map_type * map); realisation_state_enum state_map_iget( state_map_type * map , int index); void state_map_update_undefined( state_map_type * map , int index , realisation_state_enum new_state); + void state_map_update_matching( state_map_type * map , int index , int state_mask , realisation_state_enum new_state); void state_map_iset( state_map_type * map ,int index , realisation_state_enum state); bool state_map_equal( state_map_type * map1 , state_map_type * map2); void state_map_fwrite( state_map_type * map , const char * filename); diff --git a/ThirdParty/Ert/devel/libenkf/src/CMakeLists.txt b/ThirdParty/Ert/devel/libenkf/src/CMakeLists.txt index dd72020b27..5f1b6ed971 100644 --- a/ThirdParty/Ert/devel/libenkf/src/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libenkf/src/CMakeLists.txt @@ -1,10 +1,12 @@ -set( source_files ert_report.c time_map.c rng_config.c trans_func.c enkf_types.c enkf_obs.c obs_data.c block_obs.c enkf_config_node.c field_config.c field.c ecl_static_kw.c enkf_state.c enkf_util.c enkf_node.c gen_kw_config.c gen_kw.c enkf_fs.c fs_driver.c meas_data.c summary_obs.c summary.c summary_config.c gen_data_config.c gen_data.c gen_common.c gen_obs.c enkf_sched.c enkf_serialize.c ecl_config.c enkf_defaults.c ensemble_config.c model_config.c site_config.c active_list.c obs_vector.c field_trans.c plain_driver.c local_ministep.c local_updatestep.c container_config.c container.c local_context.c local_config.c analysis_config.c misfit_ensemble.c misfit_member.c misfit_ts.c data_ranking.c misfit_ranking.c ranking_table.c fs_types.c block_fs_driver.c plot_config.c ert_template.c member_config.c enkf_analysis.c enkf_main.c local_dataset.c local_obsset.c surface.c surface_config.c enkf_plot_data.c enkf_plot_member.c qc_module.c ert_report_list.c enkf_plot_arg.c runpath_list.c ert_workflow_list.c analysis_iter_config.c enkf_main_jobs.c ecl_refcase_list.c cases_config.c state_map.c) +set( source_files ert_report.c time_map.c rng_config.c trans_func.c enkf_types.c enkf_obs.c obs_data.c block_obs.c enkf_config_node.c field_config.c field.c ecl_static_kw.c enkf_state.c enkf_util.c enkf_node.c gen_kw_config.c gen_kw.c enkf_fs.c fs_driver.c meas_data.c summary_obs.c summary.c summary_config.c gen_data_config.c gen_data.c gen_common.c gen_obs.c enkf_sched.c enkf_serialize.c ecl_config.c enkf_defaults.c ensemble_config.c model_config.c site_config.c active_list.c obs_vector.c field_trans.c plain_driver.c local_ministep.c local_updatestep.c container_config.c container.c local_context.c local_config.c analysis_config.c misfit_ensemble.c misfit_member.c misfit_ts.c data_ranking.c misfit_ranking.c ranking_table.c fs_types.c block_fs_driver.c plot_config.c ert_template.c member_config.c enkf_analysis.c enkf_main.c local_dataset.c local_obsset.c surface.c surface_config.c enkf_plot_data.c enkf_plot_member.c qc_module.c ert_report_list.c enkf_plot_arg.c runpath_list.c ert_workflow_list.c analysis_iter_config.c enkf_main_jobs.c ecl_refcase_list.c local_obsdata_node.c local_obsdata.c obs_tstep_list.c pca_plot_data.c pca_plot_vector.c state_map.c cases_config.c state_map.c) + +set( header_files ert_report.h time_map.h rng_config.h enkf_analysis.h enkf_fs_type.h trans_func.h enkf_obs.h obs_data.h enkf_config_node.h block_obs.h field_config.h field.h enkf_macros.h ecl_static_kw.h enkf_state.h enkf_util.h enkf_main.h enkf_node.h enkf_fs.h gen_kw_config.h gen_kw.h enkf_types.h fs_driver.h meas_data.h summary_obs.h summary_config.h summary_config.h gen_data_config.h gen_data.h gen_common.h gen_obs.h enkf_sched.h fs_types.h enkf_serialize.h plain_driver.h ecl_config.h ensemble_config.h model_config.h site_config.h active_list.h obs_vector.h field_trans.h plain_driver.h local_ministep.h container.h local_updatestep.h local_config.h analysis_config.h misfit_ensemble.h misfit_ensemble_typedef.h misfit_ts.h misfit_member.h data_ranking.h ranking_table.h ranking_common.h misfit_ranking.h block_fs_driver.h field_common.h gen_kw_common.h gen_data_common.h plot_config.h ert_template.h member_config.h enkf_defaults.h container_config.h local_dataset.h local_obsset.h surface.h surface_config.h local_context.h enkf_plot_data.h enkf_plot_member.h qc_module.h ert_report_list.h enkf_plot_arg.h runpath_list.h ert_workflow_list.h analysis_iter_config.h ecl_refcase_list.h local_obsdata_node.h local_obsdata.h obs_tstep_list.h pca_plot_data.h pca_plot_vector.h state_map.h cases_config.h state_map.h) -set( header_files ert_report.h time_map.h rng_config.h enkf_analysis.h enkf_fs_type.h trans_func.h enkf_obs.h obs_data.h enkf_config_node.h block_obs.h field_config.h field.h enkf_macros.h ecl_static_kw.h enkf_state.h enkf_util.h enkf_main.h enkf_node.h enkf_fs.h gen_kw_config.h gen_kw.h enkf_types.h fs_driver.h meas_data.h summary_obs.h summary_config.h summary_config.h gen_data_config.h gen_data.h gen_common.h gen_obs.h enkf_sched.h fs_types.h enkf_serialize.h plain_driver.h ecl_config.h ensemble_config.h model_config.h site_config.h active_list.h obs_vector.h field_trans.h plain_driver.h local_ministep.h container.h local_updatestep.h local_config.h analysis_config.h misfit_ensemble.h misfit_ensemble_typedef.h misfit_ts.h misfit_member.h data_ranking.h ranking_table.h ranking_common.h misfit_ranking.h block_fs_driver.h field_common.h gen_kw_common.h gen_data_common.h plot_config.h ert_template.h member_config.h enkf_defaults.h container_config.h local_dataset.h local_obsset.h surface.h surface_config.h local_context.h enkf_plot_data.h enkf_plot_member.h qc_module.h ert_report_list.h enkf_plot_arg.h runpath_list.h ert_workflow_list.h analysis_iter_config.h ecl_refcase_list.h cases_config.h state_map.h) add_library( enkf ${LIBRARY_TYPE} ${source_files} ) set_target_properties( enkf PROPERTIES VERSION 1.0 SOVERSION 1.0 ) + #configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/CMake/config/ert_build_info.h.in # ${CMAKE_CURRENT_BINARY_DIR}/ert_build_info.h ) #list( APPEND src_files ${CMAKE_CURRENT_BINARY_DIR}/ert_build_info.h ) diff --git a/ThirdParty/Ert/devel/libenkf/src/active_list.c b/ThirdParty/Ert/devel/libenkf/src/active_list.c index c8d91e694d..f0581bf3b2 100644 --- a/ThirdParty/Ert/devel/libenkf/src/active_list.c +++ b/ThirdParty/Ert/devel/libenkf/src/active_list.c @@ -72,8 +72,8 @@ struct active_list_struct { /*****************************************************************/ -UTIL_SAFE_CAST_FUNCTION(active_list , ACTIVE_LIST_TYPE_ID) - +static UTIL_SAFE_CAST_FUNCTION(active_list , ACTIVE_LIST_TYPE_ID) +UTIL_IS_INSTANCE_FUNCTION( active_list , ACTIVE_LIST_TYPE_ID) @@ -81,17 +81,17 @@ UTIL_SAFE_CAST_FUNCTION(active_list , ACTIVE_LIST_TYPE_ID) /** The newly created active_list default to setting all indices actiove. */ -active_list_type * active_list_alloc(active_mode_type mode) { +active_list_type * active_list_alloc( ) { active_list_type * active_list = util_malloc(sizeof * active_list); UTIL_TYPE_ID_INIT( active_list , ACTIVE_LIST_TYPE_ID ); active_list->index_list = int_vector_alloc(0 , -1); - active_list->mode = mode; + active_list->mode = ALL_ACTIVE; return active_list; } active_list_type * active_list_alloc_copy( const active_list_type * src) { - active_list_type * new = active_list_alloc( ALL_ACTIVE ); + active_list_type * new = active_list_alloc( ); new->mode = src->mode; int_vector_free( new->index_list ) ; new->index_list = int_vector_alloc_copy( src->index_list ); @@ -99,6 +99,11 @@ active_list_type * active_list_alloc_copy( const active_list_type * src) { } +void active_list_copy( active_list_type * target , const active_list_type * src) { + target->mode = src->mode; + int_vector_memcpy( target->index_list , src->index_list); +} + void active_list_free( active_list_type * active_list ) { int_vector_free(active_list->index_list); @@ -218,3 +223,19 @@ void active_list_fprintf( const active_list_type * active_list , bool obs , cons } /* else: if mode == ALL_ACTIVE nothing is written */ } + + +bool active_list_equal( const active_list_type * active_list1 , const active_list_type * active_list2) { + if (active_list1 == active_list2) + return true; + else { + if (active_list1->mode != active_list2->mode) + return false; + else { + if (active_list1->mode == PARTLY_ACTIVE) + return int_vector_equal( active_list1->index_list , active_list2->index_list); + else + return true; + } + } +} diff --git a/ThirdParty/Ert/devel/libenkf/src/analysis_config.c b/ThirdParty/Ert/devel/libenkf/src/analysis_config.c index 3c0d4fdc70..c2efd7c752 100644 --- a/ThirdParty/Ert/devel/libenkf/src/analysis_config.c +++ b/ThirdParty/Ert/devel/libenkf/src/analysis_config.c @@ -57,8 +57,11 @@ struct analysis_config_struct { bool update_results; /* Should result values like e.g. WWCT be updated? */ bool single_node_update; /* When creating the default ALL_ACTIVE local configuration. */ rng_type * rng; - analysis_iter_config_type * iter_config; - int min_realisations; + analysis_iter_config_type * iter_config; + int min_realisations; + bool stop_long_running; + int max_runtime; + }; @@ -137,6 +140,22 @@ bool analysis_config_have_enough_realisations( const analysis_config_type * conf } } +void analysis_config_set_stop_long_running( analysis_config_type * config, bool stop_long_running ) { + config->stop_long_running = stop_long_running; +} + +bool analysis_config_get_stop_long_running( const analysis_config_type * config) { + return config->stop_long_running; +} + +int analysis_config_get_max_runtime( const analysis_config_type * config ) { + return config->max_runtime; +} + +void analysis_config_set_max_runtime( analysis_config_type * config, int max_runtime ) { + config->max_runtime = max_runtime; +} + void analysis_config_set_min_realisations( analysis_config_type * config , int min_realisations) { config->min_realisations = min_realisations; } @@ -260,13 +279,16 @@ void analysis_config_load_internal_module( analysis_config_type * config , -void analysis_config_load_external_module( analysis_config_type * config , +bool analysis_config_load_external_module( analysis_config_type * config , const char * user_name , const char * lib_name) { analysis_module_type * module = analysis_module_alloc_external( config->rng , user_name , lib_name ); - if (module != NULL) + if (module != NULL) { hash_insert_hash_owned_ref( config->analysis_modules , user_name , module , analysis_module_free__ ); - else + return true; + } else { fprintf(stderr,"** Warning: failed to load module %s from %s.\n",user_name , lib_name); + return false; + } } @@ -336,9 +358,27 @@ bool analysis_config_has_module(analysis_config_type * config , const char * mod return hash_has_key( config->analysis_modules , module_name ); } +bool analysis_config_get_module_option( const analysis_config_type * config , long flag) { + if (config->analysis_module) + return analysis_module_check_option(config->analysis_module , flag); + else + return false; +} + + bool analysis_config_select_module( analysis_config_type * config , const char * module_name ) { if (analysis_config_has_module( config , module_name )) { - config->analysis_module = analysis_config_get_module( config , module_name ); + analysis_module_type * module = analysis_config_get_module( config , module_name ); + + if (analysis_module_check_option( module , ANALYSIS_ITERABLE)) { + if (analysis_config_get_single_node_update( config )) { + fprintf(stderr," ** Warning: the module:%s requires the setting \"SINGLE_NODE_UPDATE FALSE\" in the config file.\n" , module_name); + fprintf(stderr," ** the module has NOT been selected. \n"); + return false; + } + } + + config->analysis_module = module; return true; } else { if (config->analysis_module == NULL) @@ -356,6 +396,16 @@ analysis_module_type * analysis_config_get_active_module( analysis_config_type * return config->analysis_module; } + +const char * analysis_config_get_active_module_name( const analysis_config_type * config ) { + if (config->analysis_module) + return analysis_module_get_name( config->analysis_module ); + else + return NULL; +} + + + /*****************************************************************/ @@ -402,6 +452,14 @@ void analysis_config_init( analysis_config_type * analysis , const config_type * if (config_item_set( config , MIN_REALIZATIONS_KEY )) analysis_config_set_min_realisations( analysis , config_get_value_as_int( config , MIN_REALIZATIONS_KEY )); + if (config_item_set( config , STOP_LONG_RUNNING_KEY )) + analysis_config_set_stop_long_running( analysis , config_get_value_as_bool( config , STOP_LONG_RUNNING_KEY )); + + if (config_item_set( config, MAX_RUNTIME_KEY)) { + analysis_config_set_max_runtime( analysis, config_get_value_as_int( config, MAX_RUNTIME_KEY )); + } + + /* Loading external modules */ { const config_content_item_type * load_item = config_get_content_item( config , ANALYSIS_LOAD_KEY ); @@ -508,7 +566,9 @@ analysis_config_type * analysis_config_alloc( rng_type * rng ) { analysis_config_set_store_PC( config , DEFAULT_STORE_PC ); analysis_config_set_PC_filename( config , DEFAULT_PC_FILENAME ); analysis_config_set_PC_path( config , DEFAULT_PC_PATH ); - analysis_config_set_min_realisations( config , DEFAULT_ANALYSIS_MIN_REALISATIONS ); + analysis_config_set_min_realisations( config , DEFAULT_ANALYSIS_MIN_REALISATIONS ); + analysis_config_set_stop_long_running( config , DEFAULT_ANALYSIS_STOP_LONG_RUNNING ); + analysis_config_set_max_runtime( config , DEFAULT_MAX_RUNTIME ); config->analysis_module = NULL; config->analysis_modules = hash_alloc(); @@ -547,7 +607,14 @@ void analysis_config_add_config_items( config_type * config ) { config_add_key_value( config , RERUN_START_KEY , false , CONFIG_INT); config_add_key_value( config , UPDATE_LOG_PATH_KEY , false , CONFIG_STRING); config_add_key_value( config , MIN_REALIZATIONS_KEY , false , CONFIG_INT ); - + config_add_key_value( config , MAX_RUNTIME_KEY , false , CONFIG_INT ); + + item = config_add_key_value( config , STOP_LONG_RUNNING_KEY, false, CONFIG_BOOL ); + stringlist_type * child_list = stringlist_alloc_new(); + stringlist_append_ref(child_list, MIN_REALIZATIONS_KEY); + config_schema_item_set_required_children_on_value(item , "TRUE" , child_list); + stringlist_free(child_list); + config_add_key_value( config , ANALYSIS_SELECT_KEY , false , CONFIG_STRING); item = config_add_schema_item( config , ANALYSIS_LOAD_KEY , false ); @@ -561,9 +628,9 @@ void analysis_config_add_config_items( config_type * config ) { config_schema_item_set_argc_minmax( item , 3 , CONFIG_DEFAULT_ARG_MAX); analysis_iter_config_add_config_items( config ); } + - - + void analysis_config_fprintf_config( analysis_config_type * config , FILE * stream) { fprintf( stream , CONFIG_COMMENTLINE_FORMAT ); fprintf( stream , CONFIG_COMMENT_FORMAT , "Here comes configuration information related to the EnKF analysis."); diff --git a/ThirdParty/Ert/devel/libenkf/src/analysis_iter_config.c b/ThirdParty/Ert/devel/libenkf/src/analysis_iter_config.c index 04847a9ae3..8f3216a3da 100644 --- a/ThirdParty/Ert/devel/libenkf/src/analysis_iter_config.c +++ b/ThirdParty/Ert/devel/libenkf/src/analysis_iter_config.c @@ -55,7 +55,7 @@ int analysis_iter_config_get_num_iterations( const analysis_iter_config_type * c an extra '%'. */ -static void analysis_iter_config_set_runpath_fmt( analysis_iter_config_type * config , const char * runpath_fmt) { +void analysis_iter_config_set_runpath_fmt( analysis_iter_config_type * config , const char * runpath_fmt) { util_safe_free( config->runpath_fmt ); if (runpath_fmt != NULL) { config->runpath_fmt = util_calloc( strlen(runpath_fmt ) + 2 , sizeof * config->runpath_fmt); @@ -68,6 +68,10 @@ static void analysis_iter_config_set_runpath_fmt( analysis_iter_config_type * co } } +char * analysis_iter_config_get_runpath_fmt( analysis_iter_config_type * config){ + return config->runpath_fmt; +} + void analysis_iter_config_set_case_fmt( analysis_iter_config_type * config , const char * case_fmt) { config->case_fmt = util_realloc_string_copy( config->case_fmt , case_fmt ); } diff --git a/ThirdParty/Ert/devel/libenkf/src/enkf_main.c b/ThirdParty/Ert/devel/libenkf/src/enkf_main.c index b92fcfa4ec..45e042e5a8 100644 --- a/ThirdParty/Ert/devel/libenkf/src/enkf_main.c +++ b/ThirdParty/Ert/devel/libenkf/src/enkf_main.c @@ -101,6 +101,7 @@ #include #include #include +#include #include #include @@ -187,6 +188,7 @@ void enkf_main_init_internalization( enkf_main_type * , run_mode_type ); /*****************************************************************/ UTIL_SAFE_CAST_FUNCTION(enkf_main , ENKF_MAIN_ID) +UTIL_IS_INSTANCE_FUNCTION(enkf_main , ENKF_MAIN_ID) analysis_config_type * enkf_main_get_analysis_config(const enkf_main_type * enkf_main) { return enkf_main->analysis_config; @@ -977,45 +979,130 @@ static serialize_info_type * serialize_info_alloc( enkf_fs_type * src_fs, return serialize_info; } +void enkf_main_fprintf_PC(const char * filename , + matrix_type * PC , + matrix_type * PC_obs) { -void enkf_main_get_PC( const enkf_main_type * enkf_main , - const matrix_type * S, + FILE * stream = util_mkdir_fopen(filename , "w"); + const int num_PC = matrix_get_rows( PC ); + const int ens_size = matrix_get_columns( PC ); + int ipc,iens; + + for (ipc = 0; ipc < num_PC; ipc++) + fprintf(stream , "%10.6f " , matrix_iget( PC_obs , ipc , 0)); + fprintf(stream , "\n"); + + for (iens = 0; iens < ens_size; iens++) { + for (ipc = 0; ipc < num_PC; ipc++) + fprintf(stream ,"%10.6f " , matrix_iget( PC , ipc, iens )); + fprintf(stream , "\n"); + } + fclose( stream ); +} + + +void enkf_main_get_PC( const matrix_type * S, const matrix_type * dObs, - const char * obsset_name , - int step1 , int step2 , double truncation , int ncomp , matrix_type * PC , matrix_type * PC_obs) { enkf_linalg_get_PC( S , dObs , truncation , ncomp , PC , PC_obs); - { - char * filename = util_alloc_sprintf(analysis_config_get_PC_filename( enkf_main->analysis_config ) , step1 , step2 , obsset_name); - char * full_path = util_alloc_filename( analysis_config_get_PC_path( enkf_main->analysis_config) , filename , NULL ); - FILE * stream = util_mkdir_fopen(full_path , "w"); - { - const int num_PC = matrix_get_rows( PC ); - const int ens_size = matrix_get_columns( PC ); - int ipc,iens; - - for (ipc = 0; ipc < num_PC; ipc++) - fprintf(stream , "%10.6f " , matrix_iget( PC_obs , ipc , 0)); - fprintf(stream , "\n"); - - for (iens = 0; iens < ens_size; iens++) { - for (ipc = 0; ipc < num_PC; ipc++) - fprintf(stream ,"%10.6f " , matrix_iget( PC , ipc, iens )); - fprintf(stream , "\n"); +} + + + + +void enkf_main_init_PC( const enkf_main_type * enkf_main , + const local_obsdata_type * obsdata , + double truncation_or_ncomp , + matrix_type * PC , + matrix_type * PC_obs ) { + state_enum state = FORECAST; + enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); + state_map_type * state_map = enkf_fs_get_state_map( fs ); + bool_vector_type * ens_mask = bool_vector_alloc(0 , false ); + obs_data_type * obs_data = obs_data_alloc(); + int_vector_type * ens_active_list; + meas_data_type * meas_data; + + state_map_select_matching( state_map , ens_mask , STATE_HAS_DATA ); + ens_active_list = bool_vector_alloc_active_list( ens_mask ); + if (int_vector_size( ens_active_list )) { + meas_data = meas_data_alloc( ens_active_list ); + + enkf_obs_get_obs_and_measure_data( enkf_main_get_obs( enkf_main ), + enkf_main_get_fs( enkf_main ), + obsdata , + state , + ens_active_list , + enkf_main_get_ensemble_const( enkf_main ), + meas_data , + obs_data ); + + if (0) + { + const analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); + double std_cutoff = analysis_config_get_std_cutoff( analysis_config ); + double alpha = analysis_config_get_alpha( analysis_config ); + + enkf_analysis_deactivate_outliers( obs_data , meas_data , std_cutoff , alpha); } + + { + int active_size = obs_data_get_active_size( obs_data ); + matrix_type * S = meas_data_allocS( meas_data , active_size ); + matrix_type * dObs = obs_data_allocdObs( obs_data , active_size ); + double truncation = -1; + int ncomp = -1; + + if (truncation_or_ncomp < 1) + truncation = truncation_or_ncomp; + else + ncomp = (int) truncation_or_ncomp; + + obs_data_scale( obs_data , S , NULL , NULL , NULL , dObs ); + enkf_linalg_get_PC( S , dObs , truncation , ncomp , PC , PC_obs); + + matrix_free( S ); + matrix_free( dObs ); } - fclose( stream ); - free( filename ); - free( full_path ); - } + + bool_vector_free( ens_mask ); + int_vector_free( ens_active_list ); + obs_data_free( obs_data ); + meas_data_free( meas_data ); + } else + fprintf(stderr," ** Warning: no realisations with data - no plot created \n"); +} + + +pca_plot_data_type * enkf_main_alloc_pca_plot_data( const enkf_main_type * enkf_main , + local_obsdata_type * obs_data, + double truncation_or_ncomp) { + pca_plot_data_type * pca_plot_data; + { + matrix_type * PC = matrix_alloc(1,1); + matrix_type * PC_obs = matrix_alloc(1,1); + + + enkf_main_init_PC( enkf_main , obs_data , truncation_or_ncomp , PC , PC_obs ); + pca_plot_data = pca_plot_data_alloc( local_obsdata_get_name( obs_data ) , PC , PC_obs ); + + matrix_free( PC ); + matrix_free( PC_obs ); + } + return pca_plot_data; } +static void assert_matrix_size(const matrix_type * m , const char * name , int rows , int columns) { + if (!matrix_check_dims(m , rows , columns)) + util_abort("%s: matrix mismatch %s:[%d,%d] - expected:[%d, %d]", __func__ , name , matrix_get_rows(m) , matrix_get_columns(m) , rows , columns); +} + static void enkf_main_analysis_update( enkf_main_type * enkf_main , @@ -1046,18 +1133,23 @@ static void enkf_main_analysis_update( enkf_main_type * enkf_main , matrix_type * localA = NULL; int_vector_type * iens_active_index = bool_vector_alloc_active_index_list(ens_mask , -1); - if (analysis_module_get_option( module , ANALYSIS_NEED_ED)) { + + assert_matrix_size(X , "X" , ens_size , ens_size); + assert_matrix_size(S , "S" , active_size , ens_size); + assert_matrix_size(R , "R" , active_size , active_size); + if (analysis_module_check_option( module , ANALYSIS_NEED_ED)) { E = obs_data_allocE( obs_data , enkf_main->rng , ens_size , active_size ); D = obs_data_allocD( obs_data , E , S ); + + assert_matrix_size( E , "E" , active_size , ens_size); + assert_matrix_size( D , "D" , active_size , ens_size); } - if (analysis_module_get_option( module , ANALYSIS_SCALE_DATA)){ + if (analysis_module_check_option( module , ANALYSIS_SCALE_DATA)) obs_data_scale( obs_data , S , E , D , R , dObs ); - } - - if (analysis_module_get_option( module , ANALYSIS_USE_A | ANALYSIS_UPDATE_A)){ + + if (analysis_module_check_option( module , ANALYSIS_USE_A) || analysis_module_check_option(module , ANALYSIS_UPDATE_A)) localA = A; - } /*****************************************************************/ @@ -1081,16 +1173,25 @@ static void enkf_main_analysis_update( enkf_main_type * enkf_main , int ncomp = ens_size - 1; matrix_type * PC = matrix_alloc(1,1); matrix_type * PC_obs = matrix_alloc(1,1); + local_obsset_type * obsset = local_ministep_get_obsset( ministep ); + const char * obsset_name = local_obsset_get_name( obsset ); - enkf_main_get_PC( enkf_main , S , dObs , local_ministep_get_name( ministep ) , step1 , step2 , truncation , ncomp , PC , PC_obs ); - + enkf_main_get_PC( S , dObs , truncation , ncomp , PC , PC_obs ); + { + char * filename = util_alloc_sprintf(analysis_config_get_PC_filename( enkf_main->analysis_config ) , step1 , step2 , obsset_name); + char * full_path = util_alloc_filename( analysis_config_get_PC_path( enkf_main->analysis_config) , filename , NULL ); + + enkf_main_fprintf_PC( full_path , PC , PC_obs); + + free( full_path ); + free( filename ); + } matrix_free( PC ); matrix_free( PC_obs ); } - if (localA == NULL){ + if (localA == NULL) analysis_module_initX( module , X , NULL , S , R , dObs , E , D ); - } while (!hash_iter_is_complete( dataset_iter )) { @@ -1102,8 +1203,8 @@ static void enkf_main_analysis_update( enkf_main_type * enkf_main , enkf_main_serialize_dataset( enkf_main , dataset , step2 , use_count , active_size , row_offset , tp , serialize_info); - if (analysis_module_get_option( module , ANALYSIS_UPDATE_A)){ - if (analysis_module_get_option( module , ANALYSIS_ITERABLE)){ + if (analysis_module_check_option( module , ANALYSIS_UPDATE_A)){ + if (analysis_module_check_option( module , ANALYSIS_ITERABLE)){ int iteration = cases_config_get_iteration_number(enkf_fs_get_cases_config(src_fs)); char iteration_str[15]; sprintf(iteration_str,"%d",iteration); @@ -1114,7 +1215,7 @@ static void enkf_main_analysis_update( enkf_main_type * enkf_main , analysis_module_updateA( module , localA , S , R , dObs , E , D ); } else { - if (analysis_module_get_option( module , ANALYSIS_USE_A)){ + if (analysis_module_check_option( module , ANALYSIS_USE_A)){ analysis_module_initX( module , X , localA , S , R , dObs , E , D ); } @@ -1196,7 +1297,13 @@ static bool enkf_main_UPDATE(enkf_main_type * enkf_main , const int_vector_type const char * log_path = analysis_config_get_log_path( enkf_main->analysis_config ); FILE * log_stream; - + + if ((local_updatestep_get_num_ministep( updatestep ) > 1) && + (analysis_config_get_module_option( analysis_config , ANALYSIS_ITERABLE))) { + util_exit("** ERROR: Can not combine iterable modules with multi step updates - sorry\n"); + } + + { char * log_file; if (int_vector_size( step_list ) == 1) @@ -1314,7 +1421,32 @@ static void enkf_main_report_load_failure( const enkf_main_type * enkf_main , in job_queue_iget_run_path( job_queue , queue_index)); } - +static void enkf_main_monitor_job_queue ( const enkf_main_type * enkf_main) { + job_queue_type * job_queue = site_config_get_job_queue(enkf_main->site_config); + int min_realisations = analysis_config_get_min_realisations(enkf_main->analysis_config); + + bool cont = true; + if (0 >= min_realisations) + cont = false; + + while (cont) { + //Check if minimum number of realizations have run, and if so, kill the rest after a certain time + if ((job_queue_get_num_complete(job_queue) >= min_realisations)) { + job_queue_set_auto_job_stop_time(job_queue); + cont = false; + } + + //Check if minimum number of realizations is not possible. If so, it is time to give up + int possible_sucesses = job_queue_get_num_running(job_queue) + job_queue_get_num_waiting(job_queue) + job_queue_get_num_pending(job_queue) + job_queue_get_num_complete(job_queue); + if (possible_sucesses < min_realisations) { + cont = false; + } + + if (cont) { + util_usleep(10000); + } + } +} /** If all simulations have completed successfully the function will @@ -1347,8 +1479,6 @@ static void enkf_main_run_step(enkf_main_type * enkf_main , int iens; state_map_deselect_matching( enkf_fs_get_state_map( fs ) , iactive , STATE_LOAD_FAILURE | STATE_PARENT_FAILURE); - bool_vector_fprintf( iactive , stdout , "IACTIVE" , "%2d"); - if (enkf_main->verbose) { if (run_mode == ENKF_ASSIMILATION) @@ -1366,12 +1496,14 @@ static void enkf_main_run_step(enkf_main_type * enkf_main , pthread_t queue_thread; job_queue_type * job_queue = site_config_get_job_queue(enkf_main->site_config); + /* Start the queue */ if (run_mode != INIT_ONLY) { arg_pack_type * queue_args = arg_pack_alloc(); /* This arg_pack will be freed() in the job_que_run_jobs__() */ arg_pack_append_ptr(queue_args , job_queue); arg_pack_append_int(queue_args , job_size); arg_pack_append_bool(queue_args , verbose_queue); + job_queue_reset(job_queue); pthread_create( &queue_thread , NULL , job_queue_run_jobs__ , queue_args); } @@ -1427,6 +1559,14 @@ static void enkf_main_run_step(enkf_main_type * enkf_main , if (run_mode != INIT_ONLY) { job_queue_submit_complete( job_queue ); log_add_message(enkf_main->logh , 1 , NULL , "All jobs submitted to internal queue - waiting for completion" , false); + + int max_runtime = analysis_config_get_max_runtime(enkf_main_get_analysis_config( enkf_main )); + job_queue_set_max_job_duration(job_queue, max_runtime); + + if (analysis_config_get_stop_long_running(enkf_main_get_analysis_config( enkf_main ))) { + enkf_main_monitor_job_queue( enkf_main ); + } + pthread_join( queue_thread , NULL ); /* Wait for the job_queue_run_jobs() function to complete. */ } } @@ -1450,10 +1590,9 @@ static void enkf_main_run_step(enkf_main_type * enkf_main , case JOB_RUN_OK: break; default: - util_abort("%s: invalid job status:%s \n",__func__ , run_status ); + util_abort("%s: invalid job status:%d \n",__func__ , run_status ); } totalOK = totalOK && ( run_status == JOB_RUN_OK ); - } } enkf_fs_fsync( enkf_main->dbase ); @@ -1538,9 +1677,9 @@ void enkf_main_run_exp(enkf_main_type * enkf_main , run_mode_type run_mode = simulate ? ENSEMBLE_EXPERIMENT : INIT_ONLY; { stringlist_type * param_list = ensemble_config_alloc_keylist_from_var_type( enkf_main->ensemble_config , PARAMETER ); - if(initialize) + if (initialize) enkf_main_initialize_from_scratch( enkf_main , param_list , 0 , ens_size - 1, force_init); - + stringlist_free( param_list ); } enkf_main_init_run( enkf_main , run_mode ); @@ -1559,224 +1698,249 @@ void enkf_main_run_assimilation(enkf_main_type * enkf_main , int init_step_parameters , int start_report , state_enum start_state) { - bool force_init = false; - int ens_size = enkf_main_get_ensemble_size( enkf_main ); - { - stringlist_type * param_list = ensemble_config_alloc_keylist_from_var_type( enkf_main->ensemble_config , PARAMETER ); - enkf_main_initialize_from_scratch( enkf_main , param_list , 0 , ens_size - 1 , force_init ); - stringlist_free( param_list ); - } - bool rerun = analysis_config_get_rerun( enkf_main->analysis_config ); - int rerun_start = analysis_config_get_rerun_start( enkf_main->analysis_config ); - enkf_main_init_run( enkf_main , ENKF_ASSIMILATION); - { - bool analyzed_start = false; - bool prev_enkf_on; - const enkf_sched_type * enkf_sched = model_config_get_enkf_sched(enkf_main->model_config); - const int num_nodes = enkf_sched_get_num_nodes(enkf_sched); - const int start_inode = enkf_sched_get_node_index(enkf_sched , start_report); - int inode; + + analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); + if (!analysis_config_get_module_option( analysis_config , ANALYSIS_ITERABLE)) { + bool force_init = false; + int ens_size = enkf_main_get_ensemble_size( enkf_main ); + { + stringlist_type * param_list = ensemble_config_alloc_keylist_from_var_type( enkf_main->ensemble_config , PARAMETER ); + enkf_main_initialize_from_scratch( enkf_main , param_list , 0 , ens_size - 1 , force_init ); + stringlist_free( param_list ); + } + bool rerun = analysis_config_get_rerun( enkf_main->analysis_config ); + int rerun_start = analysis_config_get_rerun_start( enkf_main->analysis_config ); + enkf_main_init_run( enkf_main , ENKF_ASSIMILATION); + { + bool analyzed_start = false; + bool prev_enkf_on; + const enkf_sched_type * enkf_sched = model_config_get_enkf_sched(enkf_main->model_config); + const int num_nodes = enkf_sched_get_num_nodes(enkf_sched); + const int start_inode = enkf_sched_get_node_index(enkf_sched , start_report); + int inode; - if (start_state == ANALYZED) - analyzed_start = true; - else if (start_state == FORECAST) - analyzed_start = false; - else - util_abort("%s: internal error - start_state must be analyzed | forecast \n",__func__); + if (start_state == ANALYZED) + analyzed_start = true; + else if (start_state == FORECAST) + analyzed_start = false; + else + util_abort("%s: internal error - start_state must be analyzed | forecast \n",__func__); - prev_enkf_on = analyzed_start; - for (inode = start_inode; inode < num_nodes; inode++) { - const enkf_sched_node_type * node = enkf_sched_iget_node(enkf_sched , inode); - state_enum init_state_parameter; - state_enum init_state_dynamic; - int init_step_parameter; - int load_start; - int report_step1; - int report_step2; - bool enkf_on; - - - enkf_sched_node_get_data(node , &report_step1 , &report_step2 , &enkf_on ); - if (inode == start_inode) - report_step1 = start_report; /* If we are restarting from somewhere. */ + prev_enkf_on = analyzed_start; + for (inode = start_inode; inode < num_nodes; inode++) { + const enkf_sched_node_type * node = enkf_sched_iget_node(enkf_sched , inode); + state_enum init_state_parameter; + state_enum init_state_dynamic; + int init_step_parameter; + int load_start; + int report_step1; + int report_step2; + bool enkf_on; + + + enkf_sched_node_get_data(node , &report_step1 , &report_step2 , &enkf_on ); + if (inode == start_inode) + report_step1 = start_report; /* If we are restarting from somewhere. */ - if (rerun) { - /* rerun ... */ - load_start = report_step1; /* +1 below. Observe that report_step is set to rerun_start below. */ - init_step_parameter = report_step1; - init_state_dynamic = FORECAST; - init_state_parameter = ANALYZED; - report_step1 = rerun_start; - } else { - if (prev_enkf_on) - init_state_dynamic = ANALYZED; - else - init_state_dynamic = FORECAST; - /* - This is not a rerun - and then parameters and dynamic - data should be initialized from the same report step. - */ - init_step_parameter = report_step1; - init_state_parameter = init_state_dynamic; - load_start = report_step1; - } + if (rerun) { + /* rerun ... */ + load_start = report_step1; /* +1 below. Observe that report_step is set to rerun_start below. */ + init_step_parameter = report_step1; + init_state_dynamic = FORECAST; + init_state_parameter = ANALYZED; + report_step1 = rerun_start; + } else { + if (prev_enkf_on) + init_state_dynamic = ANALYZED; + else + init_state_dynamic = FORECAST; + /* + This is not a rerun - and then parameters and dynamic + data should be initialized from the same report step. + */ + init_step_parameter = report_step1; + init_state_parameter = init_state_dynamic; + load_start = report_step1; + } - if (load_start > 0) - load_start++; + if (load_start > 0) + load_start++; - enkf_main_run_step(enkf_main , ENKF_ASSIMILATION , iactive , load_start , init_step_parameter , - init_state_parameter , init_state_dynamic , report_step1 , report_step2); - { - enkf_fs_type * fs = enkf_main_get_fs(enkf_main); - state_map_type * state_map = enkf_fs_get_state_map(fs); - const analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main); - int active_ens_size = state_map_count_matching(state_map , STATE_HAS_DATA); + enkf_main_run_step(enkf_main , ENKF_ASSIMILATION , iactive , load_start , init_step_parameter , + init_state_parameter , init_state_dynamic , report_step1 , report_step2); + { + enkf_fs_type * fs = enkf_main_get_fs(enkf_main); + state_map_type * state_map = enkf_fs_get_state_map(fs); + const analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main); + int active_ens_size = state_map_count_matching(state_map , STATE_HAS_DATA); - if (analysis_config_have_enough_realisations(analysis_config , active_ens_size)) { - if (enkf_on) { - bool merge_observations = analysis_config_get_merge_observations( enkf_main->analysis_config ); - int_vector_type * step_list; - int stride; + if (analysis_config_have_enough_realisations(analysis_config , active_ens_size)) { + if (enkf_on) { + bool merge_observations = analysis_config_get_merge_observations( enkf_main->analysis_config ); + int_vector_type * step_list; + int stride; - if (merge_observations) - stride = 1; - else - stride = 0; + if (merge_observations) + stride = 1; + else + stride = 0; - step_list = enkf_main_update_alloc_step_list( enkf_main , load_start , report_step2 , stride ); + step_list = enkf_main_update_alloc_step_list( enkf_main , load_start , report_step2 , stride ); - enkf_main_assimilation_update(enkf_main , step_list); - int_vector_free( step_list ); - enkf_fs_fsync( enkf_main->dbase ); + enkf_main_assimilation_update(enkf_main , step_list); + int_vector_free( step_list ); + enkf_fs_fsync( enkf_main->dbase ); + } + } else { + fprintf(stderr,"** ERROR ** There are %d active realisations left, which is less than the minimum specified (%d) - stopping assimilation.\n" , + active_ens_size , + analysis_config_get_min_realisations(analysis_config)); + break; } - } else { - fprintf(stderr,"** ERROR ** There are %d active realisations left, which is less than the minimum specified (%d) - stopping assimilation.\n" , - active_ens_size , - analysis_config_get_min_realisations(analysis_config)); - break; + prev_enkf_on = enkf_on; } - prev_enkf_on = enkf_on; } } - } + } else + fprintf(stderr,"** ERROR: EnKF assimilation can not be combined with an iterable analysis module.\n"); } void enkf_main_run_smoother(enkf_main_type * enkf_main , const char * target_fs_name , bool rerun) { - bool force_init = false; - int ens_size = enkf_main_get_ensemble_size( enkf_main ); - { - stringlist_type * param_list = ensemble_config_alloc_keylist_from_var_type( enkf_main->ensemble_config , PARAMETER ); - enkf_main_initialize_from_scratch( enkf_main , param_list , 0 , ens_size - 1 , force_init); - stringlist_free( param_list ); - } - - { - bool_vector_type * iactive = bool_vector_alloc( 0 , true ); - bool_vector_iset( iactive , ens_size - 1 , true ); - - enkf_main_init_run( enkf_main , ENSEMBLE_EXPERIMENT); - enkf_main_run_step(enkf_main , ENSEMBLE_EXPERIMENT , iactive , 0 , 0 , ANALYZED , UNDEFINED , 0 , 0); + analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); + if (!analysis_config_get_module_option( analysis_config , ANALYSIS_ITERABLE)) { + bool force_init = false; + int ens_size = enkf_main_get_ensemble_size( enkf_main ); + { + stringlist_type * param_list = ensemble_config_alloc_keylist_from_var_type( enkf_main->ensemble_config , PARAMETER ); + enkf_main_initialize_from_scratch( enkf_main , param_list , 0 , ens_size - 1 , force_init); + stringlist_free( param_list ); + } + { - bool update_done; - time_map_type * time_map = enkf_fs_get_time_map( enkf_main_get_fs( enkf_main )); - enkf_fs_type * target_fs = enkf_main_get_alt_fs( enkf_main , target_fs_name , false , true ); + bool_vector_type * iactive = bool_vector_alloc( ens_size , true ); + enkf_main_init_run( enkf_main , ENSEMBLE_EXPERIMENT); + enkf_main_run_step(enkf_main , ENSEMBLE_EXPERIMENT , iactive , 0 , 0 , ANALYZED , UNDEFINED , 0 , 0); { - int stride = 1; - int_vector_type * step_list = enkf_main_update_alloc_step_list( enkf_main , 0 , time_map_get_last_step( time_map ) , stride); - update_done = enkf_main_smoother_update( enkf_main , step_list , target_fs ); - int_vector_free( step_list ); + bool update_done; + time_map_type * time_map = enkf_fs_get_time_map( enkf_main_get_fs( enkf_main )); + enkf_fs_type * target_fs = enkf_main_get_alt_fs( enkf_main , target_fs_name , false , true ); + { + int stride = 1; + int_vector_type * step_list = enkf_main_update_alloc_step_list( enkf_main , 0 , time_map_get_last_step( time_map ) , stride); + update_done = enkf_main_smoother_update( enkf_main , step_list , target_fs ); + int_vector_free( step_list ); + } + + if (rerun) { + /* + IFF a rerun path has been added with the RERUN_PATH config + key the model_config object will select that runpath as the + currently active one. If no path has been created with the + RERUN_PATH config option the model_config_select_runpath() + call will fail silently. + + The runpath select with this call will remain the currently + active runpath for the remaining part of this program + invocation. + */ + if (update_done) { + enkf_main_set_fs( enkf_main , target_fs , target_fs_name); + model_config_select_runpath( enkf_main_get_model_config( enkf_main ) , RERUN_PATH_KEY ); + enkf_main_run_step(enkf_main , ENSEMBLE_EXPERIMENT , iactive , 0 , 0 , ANALYZED , UNDEFINED , 0 , 0 ); + } else + fprintf(stderr,"** Warning: the analysis update failed - no rerun started.\n"); + } } - if (rerun) { - /* - IFF a rerun path has been added with the RERUN_PATH config - key the model_config object will select that runpath as the - currently active one. If no path has been created with the - RERUN_PATH config option the model_config_select_runpath() - call will fail silently. - - The runpath select with this call will remain the currently - active runpath for the remaining part of this program - invocation. - */ - if (update_done) { - enkf_main_set_fs( enkf_main , target_fs , target_fs_name); - model_config_select_runpath( enkf_main_get_model_config( enkf_main ) , RERUN_PATH_KEY ); - enkf_main_run_step(enkf_main , ENSEMBLE_EXPERIMENT , iactive , 0 , 0 , ANALYZED , UNDEFINED , 0 , 0 ); - } else - fprintf(stderr,"** Warning: the analysis update failed - no rerun started.\n"); - } + bool_vector_free( iactive ); } - - bool_vector_free( iactive ); - } + } else + fprintf(stderr,"** ERROR: The normal smoother should not be combined with an iterable analysis module\n"); } -void enkf_main_iterate_smoother(enkf_main_type * enkf_main, int step2, int iteration_number, analysis_iter_config_type * iter_config, int_vector_type * step_list, bool_vector_type * iactive, model_config_type * model_config){ + +bool enkf_main_iterate_smoother(enkf_main_type * enkf_main, int step2, int iteration_number, analysis_iter_config_type * iter_config, int_vector_type * step_list, bool_vector_type * iactive, model_config_type * model_config){ const char * target_fs_name = analysis_iter_config_iget_case( iter_config , iteration_number+1 ); - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); const int step1 = 0; + bool updateOK = false; + if (target_fs_name == NULL){ fprintf(stderr,"Sorry: the updated ensemble will overwrite the current case in the iterated ensemble smoother."); - enkf_main_smoother_update(enkf_main , step_list , enkf_main_get_fs(enkf_main)); - } - else{ + updateOK = enkf_main_smoother_update(enkf_main , step_list , enkf_main_get_fs(enkf_main)); + } else { enkf_fs_type * target_fs = enkf_main_get_alt_fs(enkf_main , target_fs_name , false , true ); - enkf_main_smoother_update(enkf_main , step_list , target_fs ); + updateOK = enkf_main_smoother_update(enkf_main , step_list , target_fs ); enkf_main_set_fs(enkf_main , target_fs , enkf_fs_get_case_name( target_fs )); cases_config_set_int(enkf_fs_get_cases_config(target_fs), "iteration_number", iteration_number+1); } - bool_vector_iset( iactive , ens_size - 1 , true ); - const char * runpath_fmt = analysis_iter_config_iget_runpath_fmt( iter_config , iteration_number); - if (runpath_fmt != NULL) { - char * runpath_key = util_alloc_sprintf( "runpath-%d" , 999); - model_config_add_runpath( model_config , runpath_key , runpath_fmt); - model_config_select_runpath( model_config , runpath_key ); - free( runpath_key ); + if (updateOK) { + const char * runpath_fmt = analysis_iter_config_iget_runpath_fmt(iter_config, iteration_number); + if (runpath_fmt != NULL ) { + char * runpath_key = util_alloc_sprintf("runpath-%d", 999); + model_config_add_runpath(model_config, runpath_key, runpath_fmt); + model_config_select_runpath(model_config, runpath_key); + free(runpath_key); + } + enkf_main_run_exp(enkf_main , iactive , true , step1 , step1 , FORECAST, false); } - - enkf_main_run_exp(enkf_main , iactive , true , step1 , step1 , FORECAST, false); + + return updateOK; } + + void enkf_main_run_iterated_ES(enkf_main_type * enkf_main, int step2) { - { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - model_config_type * model_config = enkf_main_get_model_config( enkf_main ); - const analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - analysis_iter_config_type * iter_config = analysis_config_get_iter_config( analysis_config ); + const analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main); + + if (analysis_config_get_module_option( analysis_config , ANALYSIS_ITERABLE)) { + const int ens_size = enkf_main_get_ensemble_size(enkf_main); + model_config_type * model_config = enkf_main_get_model_config(enkf_main); + analysis_iter_config_type * iter_config = analysis_config_get_iter_config(analysis_config); + int_vector_type * step_list = int_vector_alloc(0, 0); + bool_vector_type * iactive = bool_vector_alloc(ens_size , true); + + const int step1 = 0; - int_vector_type * step_list = int_vector_alloc(0,0); - bool_vector_type * iactive = bool_vector_alloc(0 , true); - int iter = 0; - int num_iter = analysis_iter_config_get_num_iterations( iter_config ); + int iter = 0; + int num_iter = analysis_iter_config_get_num_iterations(iter_config); { - for (int step=step1; step <= step2; step++) - int_vector_append( step_list , step ); - } - bool_vector_iset( iactive , ens_size - 1 , true ); - const char * runpath_fmt = analysis_iter_config_iget_runpath_fmt( iter_config , iter); - if (runpath_fmt != NULL) { - char * runpath_key = util_alloc_sprintf( "runpath-%d" , iter); - model_config_add_runpath( model_config , runpath_key , runpath_fmt); - model_config_select_runpath( model_config , runpath_key ); - free( runpath_key ); + for (int step = step1; step <= step2; step++) + int_vector_append(step_list, step); } - enkf_main_run_exp(enkf_main , iactive , true , step1 , step1 , FORECAST, true); - while (true) { - if (iter == num_iter) - break; - - enkf_main_iterate_smoother(enkf_main, step2, iter, iter_config, step_list, iactive, model_config); - iter++; + + { + const char * runpath_fmt = analysis_iter_config_iget_runpath_fmt(iter_config, iter); + if (runpath_fmt != NULL ) + { + char * runpath_key = util_alloc_sprintf("runpath-%d", iter); + model_config_add_runpath(model_config, runpath_key, runpath_fmt); + model_config_select_runpath(model_config, runpath_key); + free(runpath_key); + } } - int_vector_free( step_list ); - bool_vector_free( iactive ); - } + enkf_main_run_exp(enkf_main, iactive, true, step1, step1, FORECAST, true); + while (true) + { + if (iter == num_iter) + break; + + if (enkf_main_iterate_smoother(enkf_main, step2, iter, iter_config, step_list, iactive, model_config)) + iter++; + else + break; + } + int_vector_free(step_list); + bool_vector_free(iactive); + } else + fprintf(stderr,"** ERROR: The current analysis module:%s can not be used for iterations \n", + analysis_config_get_active_module_name( analysis_config )); } + + void enkf_main_run_one_more_iteration(enkf_main_type * enkf_main, int step2) { model_config_type * model_config = enkf_main_get_model_config( enkf_main ); const analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); @@ -2466,13 +2630,14 @@ void enkf_main_update_node( enkf_main_type * enkf_main , const char * key ) { //} +/* void enkf_main_create_fs( enkf_main_type * enkf_main , const char * fs_path) { fs_driver_impl driver_id = model_config_get_dbase_type( enkf_main->model_config ); void * arg = NULL; enkf_fs_create_fs( fs_path , driver_id , arg ); } - +*/ static void enkf_main_link_current_fs__( enkf_main_type * enkf_main , const char * case_path) { const char * ens_path = model_config_get_enspath( enkf_main->model_config); @@ -2609,13 +2774,13 @@ stringlist_type * enkf_main_alloc_caselist( const enkf_main_type * enkf_main ) { } -void enkf_main_close_alt_fs(enkf_main_type * enkf_main , enkf_fs_type * fs) { +void enkf_main_close_alt_fs(const enkf_main_type * enkf_main , enkf_fs_type * fs) { if (fs != enkf_main->dbase) enkf_fs_close( fs ); } -enkf_fs_type * enkf_main_get_alt_fs(enkf_main_type * enkf_main , const char * case_path , bool read_only , bool create) { +enkf_fs_type * enkf_main_get_alt_fs(const enkf_main_type * enkf_main , const char * case_path , bool read_only , bool create) { enkf_fs_type * alt_fs = enkf_main->dbase; if (case_path != NULL) { char * new_mount_point = enkf_main_alloc_mount_point( enkf_main , case_path ); @@ -2975,7 +3140,7 @@ enkf_main_type * enkf_main_bootstrap(const char * _site_config, const char * _mo util_alloc_file_components(_model_config , &path , &base , &ext); if (path != NULL) { - if (chdir(path) != 0) + if (util_chdir(path) != 0) util_abort("%s: failed to change directory to: %s : %s \n",__func__ , path , strerror(errno)); if (verbose) @@ -3239,6 +3404,11 @@ enkf_state_type ** enkf_main_get_ensemble( enkf_main_type * enkf_main) { } +const enkf_state_type ** enkf_main_get_ensemble_const( const enkf_main_type * enkf_main) { + return (const enkf_state_type **) enkf_main->ensemble; +} + + /** In this function we initialize the variables which control @@ -3439,7 +3609,7 @@ int enkf_main_get_observation_count( const enkf_main_type * enkf_main, const cha all realizations will be checked). */ -bool enkf_main_is_initialized( const enkf_main_type * enkf_main , bool_vector_type * __mask) { +static bool enkf_main_case_is_initialized__( const enkf_main_type * enkf_main , enkf_fs_type * fs , bool_vector_type * __mask) { stringlist_type * parameter_keys = ensemble_config_alloc_keylist_from_var_type( enkf_main->ensemble_config , PARAMETER ); bool_vector_type * mask; bool initialized = true; @@ -3449,18 +3619,18 @@ bool enkf_main_is_initialized( const enkf_main_type * enkf_main , bool_vector_ty else mask = bool_vector_alloc(0 , true ); - do { + while ((ikey < stringlist_get_size( parameter_keys )) && (initialized)) { const enkf_config_node_type * config_node = ensemble_config_get_node( enkf_main->ensemble_config , stringlist_iget( parameter_keys , ikey) ); int iens = 0; do { if (bool_vector_safe_iget( mask , iens)) { node_id_type node_id = {.report_step = 0 , .iens = iens , .state = ANALYZED }; - initialized = enkf_config_node_has_node( config_node , enkf_main->dbase , node_id); + initialized = enkf_config_node_has_node( config_node , fs , node_id); } iens++; } while ((iens < enkf_main->ens_size) && (initialized)); ikey++; - } while ((ikey < stringlist_get_size( parameter_keys )) && (initialized)); + } stringlist_free( parameter_keys ); if (__mask == NULL) @@ -3469,6 +3639,19 @@ bool enkf_main_is_initialized( const enkf_main_type * enkf_main , bool_vector_ty } +bool enkf_main_is_initialized( const enkf_main_type * enkf_main , bool_vector_type * __mask) { + return enkf_main_case_is_initialized__(enkf_main , enkf_main->dbase , __mask); +} + +bool enkf_main_case_is_initialized( const enkf_main_type * enkf_main , const char * case_name , bool_vector_type * __mask) { + enkf_fs_type * fs = enkf_main_get_alt_fs(enkf_main , case_name , true , false); + if (fs) { + bool initialized = enkf_main_case_is_initialized__(enkf_main , fs , __mask); + enkf_main_close_alt_fs(enkf_main , fs); + return initialized; + } else + return false; +} void enkf_main_log_fprintf_config( const enkf_main_type * enkf_main , FILE * stream ) { diff --git a/ThirdParty/Ert/devel/libenkf/src/enkf_main_jobs.c b/ThirdParty/Ert/devel/libenkf/src/enkf_main_jobs.c index 98944dbb44..9b67c75a1c 100644 --- a/ThirdParty/Ert/devel/libenkf/src/enkf_main_jobs.c +++ b/ThirdParty/Ert/devel/libenkf/src/enkf_main_jobs.c @@ -66,6 +66,28 @@ void * enkf_main_smoother_JOB( void * self , const stringlist_type * args ) { } +void * enkf_main_iterated_smoother_JOB( void * self , const stringlist_type * args ) { + enkf_main_type * enkf_main = enkf_main_safe_cast( self ); + int ens_size = enkf_main_get_ensemble_size( enkf_main ); + bool_vector_type * iactive = bool_vector_alloc( 0 , true ); + int last_step = enkf_main_get_history_length( enkf_main ); + + bool_vector_iset( iactive , ens_size - 1 , true ); + enkf_main_run_iterated_ES( enkf_main , last_step); + return NULL; +} + + +void * enkf_main_select_module_JOB( void * self , const stringlist_type * args ) { + enkf_main_type * enkf_main = enkf_main_safe_cast( self ); + analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); + + analysis_config_select_module( analysis_config , stringlist_iget( args , 0 )); + + return NULL; +} + + void * enkf_main_create_reports_JOB(void * self , const stringlist_type * args ) { enkf_main_type * enkf_main = enkf_main_safe_cast( self ); diff --git a/ThirdParty/Ert/devel/libenkf/src/enkf_obs.c b/ThirdParty/Ert/devel/libenkf/src/enkf_obs.c index 6dce4f6965..668d03e42b 100644 --- a/ThirdParty/Ert/devel/libenkf/src/enkf_obs.c +++ b/ThirdParty/Ert/devel/libenkf/src/enkf_obs.c @@ -40,6 +40,8 @@ #include #include #include +#include +#include /* @@ -264,17 +266,18 @@ obs_vector_type * enkf_obs_get_vector(const enkf_obs_type * obs, const char * ke static void enkf_obs_get_obs_and_measure_summary(const enkf_obs_type * enkf_obs, obs_vector_type * obs_vector , enkf_fs_type * fs, - const int_vector_type * step_list , + const local_obsdata_node_type * obs_node , state_enum state, const int_vector_type * ens_active_list , const enkf_state_type ** ensemble , meas_data_type * meas_data, obs_data_type * obs_data, - const local_obsset_type * obsset , double_vector_type * obs_value , double_vector_type * obs_std) { - - const active_list_type * active_list = local_obsset_get_obs_active_list( obsset , obs_vector_get_obs_key( obs_vector )); + + const obs_tstep_list_type * tstep_list = local_obsdata_node_get_tstep_list( obs_node ); + const active_list_type * active_list = local_obsdata_node_get_active_list( obs_node ); + matrix_type * error_covar = NULL; int active_count = 0; int last_step = -1; @@ -284,8 +287,8 @@ static void enkf_obs_get_obs_and_measure_summary(const enkf_obs_type * enkf double_vector_reset( obs_std ); double_vector_reset( obs_value ); - for (int i = 0; i < int_vector_size( step_list ); i++) { - step = int_vector_iget( step_list , i ); + for (int i = 0; i < obs_tstep_list_get_size( tstep_list ); i++) { + step = obs_tstep_list_iget( tstep_list , i ); if (obs_vector_iget_active( obs_vector , step ) && active_list_iget( active_list , 0 /* Index into the scalar summary observation */)) { { const summary_obs_type * summary_obs = obs_vector_iget_node( obs_vector , step ); @@ -323,8 +326,8 @@ static void enkf_obs_get_obs_and_measure_summary(const enkf_obs_type * enkf } { char * filename = util_alloc_sprintf( "/tmp/covar/%s_%04d-%04d" , obs_vector_get_obs_key( obs_vector ), - int_vector_iget( step_list , 0 ), - int_vector_get_last( step_list )); + obs_tstep_list_iget( tstep_list , 0 ), + obs_tstep_list_get_last( tstep_list )); FILE * stream = util_mkdir_fopen( filename , "w"); matrix_fprintf(error_covar , "%7.3f " , stream ); @@ -343,14 +346,14 @@ static void enkf_obs_get_obs_and_measure_summary(const enkf_obs_type * enkf { obs_block_type * obs_block = obs_data_add_block( obs_data , obs_vector_get_obs_key( obs_vector ) , active_count , error_covar , true); - meas_block_type * meas_block = meas_data_add_block( meas_data, obs_vector_get_obs_key( obs_vector ) , int_vector_get_last( step_list ) , active_count ); + meas_block_type * meas_block = meas_data_add_block( meas_data, obs_vector_get_obs_key( obs_vector ) , obs_tstep_list_get_last( tstep_list ) , active_count ); for (int i=0; i < active_count; i++) obs_block_iset( obs_block , i , double_vector_iget( obs_value , i) , double_vector_iget( obs_std , i )); active_count = 0; - for (int i = 0; i < int_vector_size( step_list ); i++) { - int step = int_vector_iget( step_list , i ); + for (int i = 0; i < obs_tstep_list_get_size( tstep_list ); i++) { + int step = obs_tstep_list_iget( tstep_list , i ); if (obs_vector_iget_active( obs_vector , step ) && active_list_iget( active_list , 0 /* Index into the scalar summary observation */)) { for (int iens_index = 0; iens_index < int_vector_size( ens_active_list ); iens_index++) { @@ -375,7 +378,54 @@ static void enkf_obs_get_obs_and_measure_summary(const enkf_obs_type * enkf } } +void enkf_obs_get_obs_and_measure_node( const enkf_obs_type * enkf_obs, + enkf_fs_type * fs, + const local_obsdata_node_type * obs_node , + state_enum state, + const int_vector_type * ens_active_list , + const enkf_state_type ** ensemble , + meas_data_type * meas_data, + obs_data_type * obs_data) { + + const char * obs_key = local_obsdata_node_get_key( obs_node ); + obs_vector_type * obs_vector = hash_get( enkf_obs->obs_hash , obs_key ); + obs_impl_type obs_type = obs_vector_get_impl_type( obs_vector ); + double_vector_type * work_value = double_vector_alloc( 0 , -1 ); + double_vector_type * work_std = double_vector_alloc( 0 , -1 ); + + if ((obs_type == SUMMARY_OBS)) //&& ((end_step - start_step) > 1)) + enkf_obs_get_obs_and_measure_summary( enkf_obs , + obs_vector , + fs , + obs_node , + state , + ens_active_list , + ensemble , + meas_data , + obs_data , + work_value, + work_std); + else { + const obs_tstep_list_type * tstep_list = local_obsdata_node_get_tstep_list( obs_node ); + for (int i=0; i < obs_tstep_list_get_size( tstep_list ); i++) { + int report_step = obs_tstep_list_iget( tstep_list , i ); + if (obs_vector_iget_active(obs_vector , report_step)) { /* The observation is active for this report step. */ + const active_list_type * active_list = local_obsdata_node_get_active_list( obs_node ); + obs_vector_iget_observations(obs_vector , report_step , obs_data , active_list); /* Collect the observed data in the obs_data instance. */ + { + /* Could be multithreaded */ + for (int iens_index = 0; iens_index < int_vector_size( ens_active_list ); iens_index++) { + const int iens = int_vector_iget( ens_active_list , iens_index ); + obs_vector_measure(obs_vector , fs , state , report_step , iens_index , ensemble[iens] , meas_data , active_list); + } + } + } + } + } + double_vector_free( work_value ); + double_vector_free( work_std ); +} @@ -385,6 +435,32 @@ static void enkf_obs_get_obs_and_measure_summary(const enkf_obs_type * enkf Call obs_data_reset and meas_data_reset on obs_data and meas_data if you want to use fresh instances. */ + +void enkf_obs_get_obs_and_measure_data(const enkf_obs_type * enkf_obs, + enkf_fs_type * fs, + const local_obsdata_type * local_obsdata , + state_enum state, + const int_vector_type * ens_active_list , + const enkf_state_type ** ensemble , + meas_data_type * meas_data, + obs_data_type * obs_data) { + + + int iobs; + for (iobs = 0; iobs < local_obsdata_get_size( local_obsdata ); iobs++) { + const local_obsdata_node_type * obs_node = local_obsdata_iget( local_obsdata , iobs ); + enkf_obs_get_obs_and_measure_node( enkf_obs , + fs , + obs_node , + state , + ens_active_list , + ensemble , + meas_data , + obs_data); + } +} + + void enkf_obs_get_obs_and_measure(const enkf_obs_type * enkf_obs, enkf_fs_type * fs, const int_vector_type * step_list , @@ -395,51 +471,30 @@ void enkf_obs_get_obs_and_measure(const enkf_obs_type * enkf_obs, obs_data_type * obs_data, const local_obsset_type * obsset) { - double_vector_type * work_value = double_vector_alloc( 0 , -1 ); - double_vector_type * work_std = double_vector_alloc( 0 , -1 ); - - hash_iter_type * iter = local_obsset_alloc_obs_iter( obsset ); - while ( !hash_iter_is_complete(iter) ) { - const char * obs_key = hash_iter_get_next_key( iter ); - obs_vector_type * obs_vector = hash_get( enkf_obs->obs_hash , obs_key ); - obs_impl_type obs_type = obs_vector_get_impl_type( obs_vector ); - if ((obs_type == SUMMARY_OBS)) //&& ((end_step - start_step) > 1)) - /* The measure_summary() function fails for normal non-merged EnKF updates. */ - enkf_obs_get_obs_and_measure_summary( enkf_obs , - obs_vector , - fs , - step_list , - state , - ens_active_list , - ensemble , - meas_data , - obs_data , - obsset , - work_value, - work_std); - - else { - for (int i=0; i < int_vector_size( step_list ); i++) { - int report_step = int_vector_iget( step_list , i ); - if (obs_vector_iget_active(obs_vector , report_step)) { /* The observation is active for this report step. */ - const active_list_type * active_list = local_obsset_get_obs_active_list( obsset , obs_key ); - obs_vector_iget_observations(obs_vector , report_step , obs_data , active_list); /* Collect the observed data in the obs_data instance. */ - /* Could be multithreaded */ - for (int iens_index = 0; iens_index < int_vector_size( ens_active_list ); iens_index++) { - const int iens = int_vector_iget( ens_active_list , iens_index ); - obs_vector_measure(obs_vector , fs , state , report_step , iens_index , ensemble[iens] , meas_data , active_list); - } - } - } + local_obsdata_type * local_obsdata = local_obsdata_alloc( "OBS-SET" ); + { + hash_iter_type * iter = local_obsset_alloc_obs_iter( obsset ); + while ( !hash_iter_is_complete(iter) ) { + const char * obs_key = hash_iter_get_next_key( iter ); + const active_list_type * active_list = local_obsset_get_obs_active_list( obsset , obs_key); + local_obsdata_node_type * obs_node = local_obsdata_node_alloc( obs_key ); + + local_obsdata_node_copy_active_list( obs_node , active_list ); + for (int i=0; i < int_vector_size( step_list ); i++) + local_obsdata_node_add_tstep( obs_node , int_vector_iget( step_list , i )); + + local_obsdata_add_node( local_obsdata , obs_node ); } + hash_iter_free( iter ); } - hash_iter_free(iter); - double_vector_free( work_value ); - double_vector_free( work_std ); + enkf_obs_get_obs_and_measure_data(enkf_obs , fs , local_obsdata , state , ens_active_list , ensemble , meas_data , obs_data ); + local_obsdata_free( local_obsdata ); } + + void enkf_obs_reload( enkf_obs_type * enkf_obs , const history_type * history , const ecl_grid_type * grid , @@ -948,6 +1003,17 @@ stringlist_type * enkf_obs_alloc_matching_keylist(const enkf_obs_type * enkf_obs } +stringlist_type * enkf_obs_alloc_keylist(enkf_obs_type * enkf_obs ) { + stringlist_type * vars = stringlist_alloc_new(); + hash_iter_type * iter = hash_iter_alloc(enkf_obs->obs_hash); + const char * key = hash_iter_get_next_key(iter); + while ( key != NULL) { + stringlist_append_copy(vars , key); + key = hash_iter_get_next_key(iter); + } + hash_iter_free(iter); + return vars; +} /** This function allocates a hash table which looks like this: diff --git a/ThirdParty/Ert/devel/libenkf/src/enkf_state.c b/ThirdParty/Ert/devel/libenkf/src/enkf_state.c index 9a233cfcda..163727acbb 100644 --- a/ThirdParty/Ert/devel/libenkf/src/enkf_state.c +++ b/ThirdParty/Ert/devel/libenkf/src/enkf_state.c @@ -299,10 +299,10 @@ void enkf_state_initialize(enkf_state_type * enkf_state , enkf_fs_type * fs , co { if (enkf_node_initialize(param_node, iens, enkf_state->rng)) { enkf_node_store(param_node, fs, true, node_id); - state_map_iset(state_map , iens , STATE_INITIALIZED); } } } + state_map_update_matching(state_map , iens , STATE_UNDEFINED | STATE_LOAD_FAILURE , STATE_INITIALIZED); enkf_fs_fsync(fs); } } @@ -712,7 +712,6 @@ static bool enkf_state_internalize_dynamic_eclipse_results(enkf_state_type * enk { /* Looking for summary files on disk, and loading them. */ ecl_sum_type * summary = enkf_state_load_ecl_sum( enkf_state , msg_list , result ); - /** OK - now we have actually loaded the ecl_sum instance, or ecl_sum == NULL. */ if (summary != NULL) { @@ -787,6 +786,7 @@ static bool enkf_state_internalize_dynamic_results(enkf_state_type * enkf_state bool eclipse_load = enkf_state_internalize_dynamic_eclipse_results( enkf_state , fs , model_config , result, interactive , msg_list); if (!eclipse_load) fprintf(stderr , "** Warning: could not load ECLIPSE summary data from %s - this will probably fail later ...\n" , enkf_state->run_info->run_path); + return eclipse_load; } else return false; @@ -1765,7 +1765,7 @@ static void enkf_state_init_eclipse(enkf_state_type *enkf_state, enkf_fs_type * bool enkf_state_complete_forward_modelOK__(void * arg ); bool enkf_state_complete_forward_modelEXIT__(void * arg ); - +bool enkf_state_complete_forward_modelRETRY__(void * arg ); static void enkf_state_start_forward_model(enkf_state_type * enkf_state , enkf_fs_type * fs) { run_info_type * run_info = enkf_state->run_info; @@ -1776,6 +1776,8 @@ static void enkf_state_start_forward_model(enkf_state_type * enkf_state , enkf_f enkf_state_init_eclipse( enkf_state , fs ); if (run_info->run_mode != INIT_ONLY) { + // The job_queue_node will take ownership of this arg_pack; and destroy it when + // the job_queue_node is discarded. arg_pack_type * load_arg = arg_pack_alloc(); /* @@ -1787,7 +1789,8 @@ static void enkf_state_start_forward_model(enkf_state_type * enkf_state , enkf_f run_info->queue_index = job_queue_add_job_mt( shared_info->job_queue , site_config_get_job_script( site_config ), enkf_state_complete_forward_modelOK__ , - enkf_state_complete_forward_modelEXIT__ , + enkf_state_complete_forward_modelRETRY__ , + enkf_state_complete_forward_modelEXIT__, load_arg , ecl_config_get_num_cpu( shared_info->ecl_config ), run_info->run_path , @@ -2023,9 +2026,20 @@ static bool enkf_state_complete_forward_modelOK(enkf_state_type * enkf_state , e } +bool enkf_state_complete_forward_modelOK__(void * arg ) { + enkf_state_type * enkf_state; + enkf_fs_type * fs; + arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); + + enkf_state = arg_pack_iget_ptr( arg_pack , 0 ); + fs = arg_pack_iget_ptr( arg_pack , 1 ); + + return enkf_state_complete_forward_modelOK( enkf_state , fs ); +} + -static bool enkf_state_complete_forward_modelEXIT(enkf_state_type * enkf_state , enkf_fs_type * fs) { +static bool enkf_state_complete_forward_model_EXIT_handler__(enkf_state_type * enkf_state , enkf_fs_type * fs, bool is_retry) { const shared_info_type * shared_info = enkf_state->shared_info; run_info_type * run_info = enkf_state->run_info; const member_config_type * my_config = enkf_state->my_config; @@ -2034,64 +2048,48 @@ static bool enkf_state_complete_forward_modelEXIT(enkf_state_type * enkf_state , The external queue system has said that the job failed - we might give it another try from this scope, possibly involving a resampling. - */ + */ - if (enkf_state_can_retry( enkf_state )) { - enkf_state_internal_retry( enkf_state , fs , false); - return true; + if (is_retry) { + if (enkf_state_can_retry(enkf_state)) { + enkf_state_internal_retry(enkf_state, fs, false); + return true; + } else { + return false; + } } else { - /* - No more attempts for this job. - */ - log_add_fmt_message( shared_info->logh , 1 , NULL , "[%03d:%04d-%04d] FAILED COMPLETELY." , iens , run_info->step1, run_info->step2); + log_add_fmt_message(shared_info->logh, 1, NULL, "[%03d:%04d-%04d] FAILED COMPLETELY.", iens, run_info->step1, run_info->step2); + if (run_info->run_status != JOB_LOAD_FAILURE) run_info->run_status = JOB_RUN_FAILURE; - { - state_map_type * state_map = enkf_fs_get_state_map( fs ); - int iens = member_config_get_iens( enkf_state->my_config ); - state_map_iset( state_map , iens , STATE_LOAD_FAILURE ); - } - return false; - } -} - - - - - -bool enkf_state_complete_forward_modelOK__(void * arg ) { - enkf_state_type * enkf_state; - enkf_fs_type * fs; - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - - enkf_state = arg_pack_iget_ptr( arg_pack , 0 ); - fs = arg_pack_iget_ptr( arg_pack , 1 ); - { - bool callbackOK = enkf_state_complete_forward_modelOK( enkf_state , fs ); - if (callbackOK) - arg_pack_free( arg_pack ); - - return callbackOK; + state_map_type * state_map = enkf_fs_get_state_map(fs); + int iens = member_config_get_iens(enkf_state->my_config); + state_map_iset(state_map, iens, STATE_LOAD_FAILURE); + return false; } } - -bool enkf_state_complete_forward_modelEXIT__(void * arg ) { +static bool enkf_state_complete_forward_model_EXIT_handler(void * arg, bool allow_retry ) { enkf_state_type * enkf_state; enkf_fs_type * fs; { arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); enkf_state = arg_pack_iget_ptr( arg_pack , 0 ); fs = arg_pack_iget_ptr( arg_pack , 1 ); - arg_pack_free( arg_pack ); } - return enkf_state_complete_forward_modelEXIT( enkf_state , fs ); + return enkf_state_complete_forward_model_EXIT_handler__( enkf_state , fs, allow_retry ); } +bool enkf_state_complete_forward_modelEXIT__(void * arg ) { + return enkf_state_complete_forward_model_EXIT_handler(arg, false ); +} +bool enkf_state_complete_forward_modelRETRY__(void * arg ) { + return enkf_state_complete_forward_model_EXIT_handler(arg, true ); +} void * enkf_state_start_forward_model__(void * arg) { @@ -2115,8 +2113,6 @@ void enkf_state_invalidate_cache( enkf_state_type * enkf_state ) { } - - /*****************************************************************/ diff --git a/ThirdParty/Ert/devel/libenkf/src/local_obsdata.c b/ThirdParty/Ert/devel/libenkf/src/local_obsdata.c new file mode 100644 index 0000000000..c1a76315df --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/src/local_obsdata.c @@ -0,0 +1,100 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'local_obsdata.c' + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#include + +#include +#include +#include +#include + +#include + + +#define LOCAL_OBSDATA_TYPE_ID 86331309 + +struct local_obsdata_struct { + UTIL_TYPE_ID_DECLARATION; + hash_type * nodes_map; + vector_type * nodes_list; + char * name; +}; + + + +UTIL_IS_INSTANCE_FUNCTION( local_obsdata , LOCAL_OBSDATA_TYPE_ID ) + +local_obsdata_type * local_obsdata_alloc( const char * name) { + local_obsdata_type * data = util_malloc( sizeof * data ); + UTIL_TYPE_ID_INIT( data , LOCAL_OBSDATA_TYPE_ID ); + data->nodes_list = vector_alloc_new(); + data->nodes_map = hash_alloc(); + data->name = util_alloc_string_copy( name ); + return data; +} + + + +local_obsdata_type * local_obsdata_alloc_wrapper( local_obsdata_node_type * node ) { + local_obsdata_type * data = local_obsdata_alloc( local_obsdata_node_get_key( node )); + local_obsdata_add_node( data , node ); + return data; +} + + +void local_obsdata_free( local_obsdata_type * data ) { + vector_free( data->nodes_list ); + hash_free( data->nodes_map ); + free( data->name ); + free( data ); +} + +const char * local_obsdata_get_name( const local_obsdata_type * data) { + return data->name; +} + + +int local_obsdata_get_size( const local_obsdata_type * data ) { + return vector_get_size( data->nodes_list ); +} + + +/* + The @data instance will assume ownership of the node; i.e. calling + scope should NOT call local_obsdata_node_free(). +*/ + +bool local_obsdata_add_node( local_obsdata_type * data , local_obsdata_node_type * node ) { + const char * key = local_obsdata_node_get_key( node ); + if (local_obsdata_has_node(data , key)) + return false; + else { + vector_append_owned_ref( data->nodes_list , node , local_obsdata_node_free__ ); + hash_insert_ref( data->nodes_map , key , node ); + return true; + } +} + + +const local_obsdata_node_type * local_obsdata_iget( const local_obsdata_type * data , int index) { + return vector_iget_const( data->nodes_list , index ); +} + + +bool local_obsdata_has_node( const local_obsdata_type * data , const char * key) { + return hash_has_key( data->nodes_map , key ); +} diff --git a/ThirdParty/Ert/devel/libenkf/src/local_obsdata_node.c b/ThirdParty/Ert/devel/libenkf/src/local_obsdata_node.c new file mode 100644 index 0000000000..8c9303b318 --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/src/local_obsdata_node.c @@ -0,0 +1,96 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'local_obsdata_node.c' + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#include + +#include +#include +#include + +#include +#include + + +#define LOCAL_OBSDATA_NODE_TYPE_ID 84441309 + +struct local_obsdata_node_struct { + UTIL_TYPE_ID_DECLARATION; + char * obs_key; + active_list_type * active_list; + obs_tstep_list_type * tstep_list; +}; + + + +UTIL_IS_INSTANCE_FUNCTION( local_obsdata_node , LOCAL_OBSDATA_NODE_TYPE_ID ) + +static UTIL_SAFE_CAST_FUNCTION( local_obsdata_node , LOCAL_OBSDATA_NODE_TYPE_ID ) + +local_obsdata_node_type * local_obsdata_node_alloc( const char * obs_key ) { + local_obsdata_node_type * node = util_malloc( sizeof * node ); + UTIL_TYPE_ID_INIT( node , LOCAL_OBSDATA_NODE_TYPE_ID ); + node->obs_key = util_alloc_string_copy( obs_key ); + node->active_list = active_list_alloc( ); + node->tstep_list = obs_tstep_list_alloc( ); + return node; +} + + +void local_obsdata_node_copy_active_list( local_obsdata_node_type * node , const active_list_type * active_list) { + active_list_copy( node->active_list , active_list ); +} + + +const char * local_obsdata_node_get_key( const local_obsdata_node_type * node ) { + return node->obs_key; +} + + + +void local_obsdata_node_free( local_obsdata_node_type * node ) { + active_list_free( node->active_list ); + obs_tstep_list_free( node->tstep_list ); + free( node->obs_key ); + free( node ); +} + + + +void local_obsdata_node_free__( void * arg ) { + local_obsdata_node_type * node = local_obsdata_node_safe_cast( arg ); + local_obsdata_node_free( node ); +} + + +active_list_type * local_obsdata_node_get_active_list( const local_obsdata_node_type * node ) { + return node->active_list; +} + + +const obs_tstep_list_type * local_obsdata_node_get_tstep_list( const local_obsdata_node_type * node) { + return node->tstep_list; +} + + +void local_obsdata_node_add_tstep( local_obsdata_node_type * node, int tstep) { + obs_tstep_list_add_tstep( node->tstep_list , tstep ); +} + + +void local_obsdata_node_add_range( local_obsdata_node_type * node, int step1 , int step2) { + obs_tstep_list_add_range( node->tstep_list , step1 , step2); +} diff --git a/ThirdParty/Ert/devel/libenkf/src/obs_tstep_list.c b/ThirdParty/Ert/devel/libenkf/src/obs_tstep_list.c new file mode 100644 index 0000000000..1b515a9fd8 --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/src/obs_tstep_list.c @@ -0,0 +1,101 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'obs_tstep_list.c' + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#include + +#include +#include +#include + +#include + + +#define OBS_TSTEP_LIST_TYPE_ID 84865209 + +struct obs_tstep_list_struct { + UTIL_TYPE_ID_DECLARATION; + bool all_active; + int_vector_type * tstep_list; +}; + + +UTIL_IS_INSTANCE_FUNCTION( obs_tstep_list , OBS_TSTEP_LIST_TYPE_ID ) + + +obs_tstep_list_type * obs_tstep_list_alloc() { + obs_tstep_list_type * list = util_malloc( sizeof * list ); + UTIL_TYPE_ID_INIT( list , OBS_TSTEP_LIST_TYPE_ID ); + list->all_active = true; + list->tstep_list = int_vector_alloc(0,0); + return list; +} + + +void obs_tstep_list_free( obs_tstep_list_type * list ) { + free( list ); +} + + + +bool obs_tstep_list_all_active( const obs_tstep_list_type * list ) { + return list->all_active; +} + + +bool obs_tstep_list_contains( const obs_tstep_list_type * list , int tstep) { + if (int_vector_index_sorted( list->tstep_list , tstep) == -1) + return false; + else + return true; +} + + + +void obs_tstep_list_add_tstep( obs_tstep_list_type * list , int tstep) { + if (!obs_tstep_list_contains( list , tstep)) { + if (int_vector_size( list->tstep_list )) { + int last = int_vector_get_last( list->tstep_list ); + int_vector_append( list->tstep_list , tstep ); + if (tstep < last) + int_vector_sort( list->tstep_list); + } else + int_vector_append( list->tstep_list , tstep ); + } + list->all_active = false; +} + + +void obs_tstep_list_add_range( obs_tstep_list_type * list , int step1 , int step2) { + int tstep; + for (tstep = step1; tstep <= step2; tstep++) + obs_tstep_list_add_tstep( list , tstep ); +} + + +int obs_tstep_list_get_size( const obs_tstep_list_type * list ) { + return int_vector_size( list->tstep_list ); +} + + +int obs_tstep_list_iget( const obs_tstep_list_type * list , int index) { + return int_vector_iget( list->tstep_list , index); +} + + +int obs_tstep_list_get_last( const obs_tstep_list_type * list ) { + return int_vector_get_last( list->tstep_list ); +} diff --git a/ThirdParty/Ert/devel/libenkf/src/pca_plot_data.c b/ThirdParty/Ert/devel/libenkf/src/pca_plot_data.c new file mode 100644 index 0000000000..25a98568f8 --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/src/pca_plot_data.c @@ -0,0 +1,98 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + The file 'pca_plot_data.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + + +#include + +#include +#include +#include +#include + +#include +#include + +#define PCA_PLOT_DATA_TYPE_ID 61442098 + +struct pca_plot_data_struct { + UTIL_TYPE_ID_DECLARATION; + char * name; + vector_type * pca_vectors; + int ens_size; +}; + + +UTIL_IS_INSTANCE_FUNCTION( pca_plot_data , PCA_PLOT_DATA_TYPE_ID ) +static UTIL_SAFE_CAST_FUNCTION( pca_plot_data , PCA_PLOT_DATA_TYPE_ID ) + +static void pca_plot_data_add_vectors(pca_plot_data_type * plot_data , const matrix_type * PC , const matrix_type * PC_obs) { + int component; + for (component = 0; component < matrix_get_rows( PC ); component++) { + pca_plot_vector_type * vector = pca_plot_vector_alloc( component , PC , PC_obs ); + vector_append_owned_ref( plot_data->pca_vectors , vector , pca_plot_vector_free__); + } +} + + +pca_plot_data_type * pca_plot_data_alloc( const char * name, + const matrix_type * PC , + const matrix_type * PC_obs) { + pca_plot_data_type * plot_data = NULL; + + if (pca_plot_assert_input( PC , PC_obs)) { + plot_data = util_malloc( sizeof * plot_data ); + UTIL_TYPE_ID_INIT( plot_data , PCA_PLOT_DATA_TYPE_ID ); + plot_data->name = util_alloc_string_copy( name ); + plot_data->pca_vectors = vector_alloc_new(); + plot_data->ens_size = matrix_get_columns( PC ); + pca_plot_data_add_vectors( plot_data , PC , PC_obs ); + } + return plot_data; +} + + + + + +void pca_plot_data_free( pca_plot_data_type * plot_data ) { + vector_free( plot_data->pca_vectors ); + free( plot_data->name ); + free( plot_data ); +} + +void pca_plot_data_free__( void * arg ) { + pca_plot_data_type * plot_data = pca_plot_data_safe_cast( arg ); + pca_plot_data_free( plot_data ); +} + +int pca_plot_data_get_size( const pca_plot_data_type * plot_data ) { + return vector_get_size( plot_data->pca_vectors ); +} + + +int pca_plot_data_get_ens_size( const pca_plot_data_type * plot_data ) { + return plot_data->ens_size; +} + +const pca_plot_vector_type * pca_plot_data_iget_vector( const pca_plot_data_type * plot_data , int ivec) { + return vector_iget_const( plot_data->pca_vectors , ivec ); +} + + +const char * pca_plot_data_get_name( const pca_plot_data_type * plot_data ) { + return plot_data->name; +} diff --git a/ThirdParty/Ert/devel/libenkf/src/pca_plot_vector.c b/ThirdParty/Ert/devel/libenkf/src/pca_plot_vector.c new file mode 100644 index 0000000000..d26a34b1ac --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/src/pca_plot_vector.c @@ -0,0 +1,100 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + The file 'pca_plot_vector.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + + +#include + +#include +#include +#include + +#include + +#define PCA_PLOT_VECTOR_TYPE_ID 61743098 + +struct pca_plot_vector_struct { + UTIL_TYPE_ID_DECLARATION; + int size; + double obs_value; + double * sim_data; +}; + + +UTIL_IS_INSTANCE_FUNCTION( pca_plot_vector , PCA_PLOT_VECTOR_TYPE_ID ) +static UTIL_SAFE_CAST_FUNCTION( pca_plot_vector , PCA_PLOT_VECTOR_TYPE_ID ) + +bool pca_plot_assert_input( const matrix_type * PC, const matrix_type * PC_obs) { + if ((matrix_get_rows(PC) == matrix_get_rows( PC_obs )) && + (matrix_get_columns(PC_obs) == 1)) + return true; + else + return false; +} + +static void pca_plot_vector_init_data( pca_plot_vector_type * plot_vector , int component, const matrix_type * PC , const matrix_type * PC_obs) { + int iens; + + for (iens = 0; iens < matrix_get_columns( PC ); iens++) + plot_vector->sim_data[iens] = matrix_iget( PC, component , iens ); + + plot_vector->obs_value = matrix_iget( PC_obs , component , 0 ); +} + +pca_plot_vector_type * pca_plot_vector_alloc( int component , + const matrix_type * PC , + const matrix_type * PC_obs) { + pca_plot_vector_type * plot_vector = NULL; + + if (pca_plot_assert_input( PC , PC_obs) && (component < matrix_get_rows( PC ))) { + + plot_vector = util_malloc( sizeof * plot_vector ); + UTIL_TYPE_ID_INIT( plot_vector , PCA_PLOT_VECTOR_TYPE_ID ); + plot_vector->obs_value = matrix_iget( PC_obs , component , 0 ); + plot_vector->size = matrix_get_columns( PC ); + plot_vector->sim_data = util_calloc( plot_vector->size , sizeof * plot_vector->sim_data ); + pca_plot_vector_init_data( plot_vector , component , PC , PC_obs ); + } + + return plot_vector; +} + + + +void pca_plot_vector_free( pca_plot_vector_type * plot_vector ) { + free( plot_vector->sim_data ); + free( plot_vector ); +} + + +void pca_plot_vector_free__( void * arg ) { + pca_plot_vector_type * vector = pca_plot_vector_safe_cast( arg ); + pca_plot_vector_free( vector ); +} + + +int pca_plot_vector_get_size( const pca_plot_vector_type * vector ) { + return vector->size; +} + +double pca_plot_vector_get_obs_value( const pca_plot_vector_type * vector ) { + return vector->obs_value; +} + + +double pca_plot_vector_iget_sim_value( const pca_plot_vector_type * vector , int sim_index) { + return vector->sim_data[ sim_index ]; +} diff --git a/ThirdParty/Ert/devel/libenkf/src/scalar_config.c b/ThirdParty/Ert/devel/libenkf/src/scalar_config.c index b0ee5566d3..27ff8c09ef 100644 --- a/ThirdParty/Ert/devel/libenkf/src/scalar_config.c +++ b/ThirdParty/Ert/devel/libenkf/src/scalar_config.c @@ -42,7 +42,7 @@ scalar_config_type * scalar_config_alloc_empty(int size) { scalar_config_type *scalar_config = util_malloc(sizeof *scalar_config); UTIL_TYPE_ID_INIT( scalar_config , SCALAR_CONFIG_TYPE_ID ); scalar_config->data_size = size; - scalar_config->active_list = active_list_alloc( ALL_ACTIVE ); + scalar_config->active_list = active_list_alloc( ); scalar_config->transform = util_calloc(scalar_config->data_size , sizeof * scalar_config->transform ); return scalar_config; diff --git a/ThirdParty/Ert/devel/libenkf/src/state_map.c b/ThirdParty/Ert/devel/libenkf/src/state_map.c index 3c5d03102b..2409eb0efb 100644 --- a/ThirdParty/Ert/devel/libenkf/src/state_map.c +++ b/ThirdParty/Ert/devel/libenkf/src/state_map.c @@ -144,13 +144,21 @@ void state_map_iset( state_map_type * map ,int index , realisation_state_enum st pthread_rwlock_unlock( &map->rw_lock ); } -void state_map_update_undefined( state_map_type * map , int index , realisation_state_enum new_state) { + +void state_map_update_matching( state_map_type * map , int index , int state_mask , realisation_state_enum new_state) { realisation_state_enum current_state = state_map_iget( map , index ); - if (current_state == STATE_UNDEFINED) + if (current_state & state_mask) state_map_iset( map , index , new_state ); } +void state_map_update_undefined( state_map_type * map , int index , realisation_state_enum new_state) { + state_map_update_matching( map , index , STATE_UNDEFINED , new_state ); +} + + + + void state_map_fwrite( state_map_type * map , const char * filename) { pthread_rwlock_rdlock( &map->rw_lock ); { diff --git a/ThirdParty/Ert/devel/libenkf/tests/CMakeLists.txt b/ThirdParty/Ert/devel/libenkf/tests/CMakeLists.txt index cda391dec9..1aeea1cfd0 100644 --- a/ThirdParty/Ert/devel/libenkf/tests/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libenkf/tests/CMakeLists.txt @@ -7,6 +7,9 @@ target_link_libraries( enkf_site_config enkf test_util ) add_executable( enkf_time_map enkf_time_map.c ) target_link_libraries( enkf_time_map enkf test_util ) +add_executable( enkf_pca_plot enkf_pca_plot.c ) +target_link_libraries( enkf_pca_plot enkf test_util) +add_test( enkf_pca_plot ${EXECUTABLE_OUTPUT_PATH}/enkf_pca_plot) add_executable( enkf_cases_config enkf_cases_config.c ) target_link_libraries( enkf_cases_config enkf test_util ) @@ -14,7 +17,14 @@ add_test( enkf_cases_config ${EXECUTABLE_OUTPUT_PATH}/enkf_cases_config ) add_executable( enkf_analysis_config enkf_analysis_config.c ) target_link_libraries( enkf_analysis_config enkf test_util ) -add_test( enkf_analysis ${EXECUTABLE_OUTPUT_PATH}/enkf_analysis_config ) +add_test( enkf_analysis ${EXECUTABLE_OUTPUT_PATH}/enkf_analysis_config) + +add_executable( enkf_analysis_config_ext_module enkf_analysis_config_ext_module.c ) +target_link_libraries( enkf_analysis_config_ext_module enkf test_util ) +add_test( enkf_analysis_config_ext_module ${EXECUTABLE_OUTPUT_PATH}/enkf_analysis_config_ext_module + rml_enkf ${LIBRARY_OUTPUT_PATH}/rml_enkf.so + rmli_enkf ${LIBRARY_OUTPUT_PATH}/rmli_enkf.so ) + add_executable( enkf_state_map enkf_state_map.c ) target_link_libraries( enkf_state_map enkf test_util ) @@ -28,6 +38,22 @@ target_link_libraries( enkf_ensemble_GEN_PARAM enkf test_util ) add_executable( enkf_ensemble enkf_ensemble.c ) target_link_libraries( enkf_ensemble enkf test_util ) +add_executable( enkf_local_obsdata_node enkf_local_obsdata_node.c ) +target_link_libraries( enkf_local_obsdata_node enkf test_util) +add_test( enkf_local_obsdata_node ${EXECUTABLE_OUTPUT_PATH}/enkf_local_obsdata_node ) + +add_executable( enkf_local_obsdata enkf_local_obsdata.c ) +target_link_libraries( enkf_local_obsdata enkf test_util) +add_test( enkf_local_obsdata ${EXECUTABLE_OUTPUT_PATH}/enkf_local_obsdata ) + +add_executable( enkf_active_list enkf_active_list.c ) +target_link_libraries( enkf_active_list enkf test_util) +add_test( enkf_active_list ${EXECUTABLE_OUTPUT_PATH}/enkf_active_list ) + +add_executable( enkf_obs_tstep_list enkf_obs_tstep_list.c ) +target_link_libraries( enkf_obs_tstep_list enkf test_util) +add_test( enkf_obs_tstep_list ${EXECUTABLE_OUTPUT_PATH}/enkf_obs_tstep_list ) + add_executable( enkf_main enkf_main.c ) target_link_libraries( enkf_main enkf test_util ) add_test( enkf_main ${EXECUTABLE_OUTPUT_PATH}/enkf_main ) diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_active_list.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_active_list.c new file mode 100644 index 0000000000..9e647d0d85 --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_active_list.c @@ -0,0 +1,65 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'enkf_active_list.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#include +#include +#include +#include + +#include + +#include + + + +int main(int argc , char ** argv) { + active_list_type * active_list1 = active_list_alloc( ); + active_list_type * active_list2 = active_list_alloc( ); + + + test_assert_true( active_list_is_instance( active_list1 )); + + test_assert_true( active_list_equal( active_list1 , active_list2 )); + + active_list_add_index( active_list1 , 11 ); + test_assert_false(active_list_equal( active_list1 , active_list2 )); + + active_list_add_index( active_list1 , 12 ); + test_assert_false(active_list_equal( active_list1 , active_list2 )); + + active_list_add_index( active_list2 , 11 ); + test_assert_false(active_list_equal( active_list1 , active_list2 )); + + active_list_add_index( active_list2 , 12 ); + test_assert_true(active_list_equal( active_list1 , active_list2 )); + + active_list_add_index( active_list2 , 13 ); + test_assert_false(active_list_equal( active_list1 , active_list2 )); + + active_list_add_index( active_list1 , 13 ); + test_assert_true(active_list_equal( active_list1 , active_list2 )); + + active_list_add_index( active_list2 , 27 ); + test_assert_false(active_list_equal( active_list1 , active_list2 )); + active_list_copy( active_list1 , active_list2 ); + test_assert_true(active_list_equal( active_list1 , active_list2 )); + + active_list_free( active_list1 ); + active_list_free( active_list2 ); + exit(0); +} + diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_analysis_config.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_analysis_config.c index b2274c3220..a93b5dca53 100644 --- a/ThirdParty/Ert/devel/libenkf/tests/enkf_analysis_config.c +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_analysis_config.c @@ -73,11 +73,35 @@ void test_continue( ) { } +void test_current_module_options() { + analysis_config_type * ac = create_analysis_config( ); + test_assert_NULL( analysis_config_get_active_module( ac )); + analysis_config_load_internal_module(ac , "STD_ENKF" , "std_enkf_symbol_table"); + + test_assert_false( analysis_config_get_module_option( ac , ANALYSIS_SCALE_DATA)); + test_assert_true(analysis_config_select_module(ac , "STD_ENKF")); + test_assert_false( analysis_config_select_module(ac , "DOES_NOT_EXIST")); + + test_assert_true( analysis_module_is_instance( analysis_config_get_active_module( ac ))); + test_assert_true( analysis_config_get_module_option( ac , ANALYSIS_SCALE_DATA)); + test_assert_false( analysis_config_get_module_option( ac , ANALYSIS_ITERABLE)); + analysis_config_free( ac ); +} + +void test_stop_long_running( ) { + analysis_config_type * ac = create_analysis_config( ); + test_assert_bool_equal( false , analysis_config_get_stop_long_running( ac ) ); + analysis_config_set_stop_long_running( ac , true ); + test_assert_bool_equal( true , analysis_config_get_stop_long_running( ac ) ); + analysis_config_free( ac ); +} int main(int argc , char ** argv) { test_create(); test_min_realisations(); test_continue(); + test_current_module_options(); + test_stop_long_running(); exit(0); } diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_analysis_config_ext_module.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_analysis_config_ext_module.c new file mode 100644 index 0000000000..a5e09bfdba --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_analysis_config_ext_module.c @@ -0,0 +1,65 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'enkf_analysis_config_ext_module.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include + + +void test_load_external_module( analysis_config_type * ac , const char * user_name , const char * lib_name) { + test_assert_true( analysis_config_load_external_module(ac , user_name , lib_name)); +} + + + +int main(int argc , char ** argv) { + rng_type * rng = rng_alloc(MZRAN , INIT_DEFAULT); + analysis_config_type * analysis_config = analysis_config_alloc(rng); + + for (int i = 1; i < argc; i+= 2) { + const char * user_name = argv[i]; + const char * lib_name = argv[i + 1]; + test_load_external_module( analysis_config , user_name , lib_name ); + } + + analysis_config_free(analysis_config); + rng_free( rng ); + exit(0); +} + + + diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_FIELD.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_FIELD.c index a56742d6e3..294b349fbb 100644 --- a/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_FIELD.c +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_FIELD.c @@ -49,7 +49,7 @@ int main(int argc , char ** argv) { const char * config_file = argv[2]; const char * init_file = argv[3]; const char * forward_init_string = argv[4]; - test_work_area_type * work_area = test_work_area_alloc(config_file , false); + test_work_area_type * work_area = test_work_area_alloc(config_file ); test_work_area_copy_directory_content( work_area , root_path ); test_work_area_install_file( work_area , init_file ); { diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_GEN_KW.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_GEN_KW.c index 04ccfef1f4..2b8fb68126 100644 --- a/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_GEN_KW.c +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_GEN_KW.c @@ -48,7 +48,7 @@ int main(int argc , char ** argv) { const char * root_path = argv[1]; const char * config_file = argv[2]; const char * forward_init_string = argv[3]; - test_work_area_type * work_area = test_work_area_alloc(config_file , false); + test_work_area_type * work_area = test_work_area_alloc(config_file ); test_work_area_copy_directory_content( work_area , root_path ); { bool forward_init; diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_GEN_PARAM.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_GEN_PARAM.c index 5ed9c5bcaa..758af45213 100644 --- a/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_GEN_PARAM.c +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_GEN_PARAM.c @@ -48,7 +48,7 @@ int main(int argc , char ** argv) { const char * root_path = argv[1]; const char * config_file = argv[2]; const char * forward_init_string = argv[3]; - test_work_area_type * work_area = test_work_area_alloc(config_file , false); + test_work_area_type * work_area = test_work_area_alloc(config_file ); test_work_area_copy_directory_content( work_area , root_path ); { bool forward_init; diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_SURFACE.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_SURFACE.c index 35ed10f03d..94f792d68b 100644 --- a/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_SURFACE.c +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_forward_init_SURFACE.c @@ -49,7 +49,7 @@ int main(int argc , char ** argv) { const char * config_file = argv[2]; const char * init_file = argv[3]; const char * forward_init_string = argv[4]; - test_work_area_type * work_area = test_work_area_alloc(config_file , false); + test_work_area_type * work_area = test_work_area_alloc(config_file ); test_work_area_copy_directory_content( work_area , root_path ); test_work_area_install_file( work_area , init_file ); diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_local_obsdata.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_local_obsdata.c new file mode 100644 index 0000000000..117e7074d9 --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_local_obsdata.c @@ -0,0 +1,63 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'enkf_local_obsdata.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#include +#include +#include +#include + +#include + +#include +#include + + +void test_wrapper() { + local_obsdata_node_type * node = local_obsdata_node_alloc("KEY"); + local_obsdata_type * data = local_obsdata_alloc_wrapper( node ); + test_assert_true( local_obsdata_is_instance( data )); + test_assert_int_equal( 1 , local_obsdata_get_size( data )); + test_assert_ptr_equal( node , local_obsdata_iget( data , 0 )); + test_assert_true( local_obsdata_has_node( data , "KEY" )); + test_assert_false( local_obsdata_has_node( data , "KEYX" )); + test_assert_string_equal( local_obsdata_node_get_key( node ) , local_obsdata_get_name( data )); + local_obsdata_free( data ); +} + + +int main(int argc , char ** argv) { + local_obsdata_type * obsdata; + + obsdata = local_obsdata_alloc( "KEY"); + test_assert_true( local_obsdata_is_instance( obsdata )); + test_assert_int_equal( 0 , local_obsdata_get_size( obsdata )); + test_assert_string_equal( "KEY" , local_obsdata_get_name( obsdata )); + + { + local_obsdata_node_type * obsnode = local_obsdata_node_alloc( "KEY" ); + test_assert_true( local_obsdata_add_node( obsdata , obsnode ) ); + test_assert_false( local_obsdata_add_node( obsdata , obsnode ) ); + test_assert_int_equal( 1 , local_obsdata_get_size( obsdata )); + test_assert_ptr_equal( obsnode , local_obsdata_iget( obsdata , 0)); + } + + local_obsdata_free( obsdata ); + + test_wrapper(); + exit(0); +} + diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_local_obsdata_node.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_local_obsdata_node.c new file mode 100644 index 0000000000..46c883c458 --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_local_obsdata_node.c @@ -0,0 +1,79 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'enkf_local_obsdata_node.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#include +#include +#include +#include + +#include + +#include +#include +#include + + +void test_content( local_obsdata_node_type * node ) { + const active_list_type * active_list = local_obsdata_node_get_active_list( node ); + + test_assert_not_NULL( active_list ); + test_assert_true( active_list_is_instance( active_list )); + test_assert_true( obs_tstep_list_is_instance( local_obsdata_node_get_tstep_list( node ))); + + { + active_list_type * new_active_list = active_list_alloc( ); + + active_list_add_index( new_active_list , 1098 ); + + test_assert_false( active_list_equal( new_active_list , local_obsdata_node_get_active_list( node ))); + local_obsdata_node_copy_active_list( node , new_active_list ); + test_assert_true( active_list_equal( new_active_list , local_obsdata_node_get_active_list( node ))); + + } + { + const obs_tstep_list_type * tstep = local_obsdata_node_get_tstep_list( node ); + + local_obsdata_node_add_tstep( node , 10 ); + local_obsdata_node_add_tstep( node , 10 ); // Second add - ignored + local_obsdata_node_add_tstep( node , 20 ); + + test_assert_int_equal( 2 , obs_tstep_list_get_size( tstep )); + } + +} + + +int main(int argc , char ** argv) { + const char * obs_key = "1234"; + + { + local_obsdata_node_type * node = local_obsdata_node_alloc( obs_key ); + + test_assert_true( local_obsdata_node_is_instance( node )); + test_assert_string_equal( obs_key , local_obsdata_node_get_key( node )); + test_content( node ); + local_obsdata_node_free( node ); + } + + { + void * node = local_obsdata_node_alloc( obs_key ); + local_obsdata_node_free__( node ); + } + + exit(0); +} + diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_main.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_main.c index 5c8ac55eb4..e24437bb1f 100644 --- a/ThirdParty/Ert/devel/libenkf/tests/enkf_main.c +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_main.c @@ -20,14 +20,46 @@ #include #include +#include +#include +#include + #include +#include -int main(int argc , char ** argv) { + + +void test_case_initialized() { + test_work_area_type * work_area = test_work_area_alloc("enkf_main_case_initialized" ); { enkf_main_type * enkf_main = enkf_main_alloc_empty(); - enkf_main_free( enkf_main ); + model_config_type * model_config = enkf_main_get_model_config(enkf_main); + const char * new_case = "fs/case"; + char * mount_point = util_alloc_sprintf("%s/%s" , model_config_get_enspath(model_config) , new_case); + enkf_fs_create_fs(mount_point , BLOCK_FS_DRIVER_ID , NULL); + + test_assert_false(enkf_main_case_is_initialized(enkf_main , "does/not/exist" , NULL)); + test_assert_true(enkf_main_case_is_initialized(enkf_main , new_case , NULL)); + + enkf_main_free(enkf_main); } + test_work_area_free(work_area); +} + + + +void test_create() { + enkf_main_type * enkf_main = enkf_main_alloc_empty(); + test_assert_true( enkf_main_is_instance( enkf_main ) ); + enkf_main_free( enkf_main ); +} + + + +int main(int argc , char ** argv) { + test_create(); + test_case_initialized(); exit(0); } diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_obs_tstep_list.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_obs_tstep_list.c new file mode 100644 index 0000000000..73b351dfb8 --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_obs_tstep_list.c @@ -0,0 +1,84 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'enkf_obs_tstep_list.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#include +#include + +#include +#include + + +void test_range( ) { + obs_tstep_list_type * tstep_list = obs_tstep_list_alloc(); + + obs_tstep_list_add_range( tstep_list , 10 , 12 ); + test_assert_int_equal( 3, obs_tstep_list_get_size( tstep_list )); + obs_tstep_list_free( tstep_list ); +} + +void test_contains() { + obs_tstep_list_type * tstep_list = obs_tstep_list_alloc(); + + test_assert_false( obs_tstep_list_contains( tstep_list , 0 )); + test_assert_false( obs_tstep_list_contains( tstep_list , 10 )); + test_assert_false( obs_tstep_list_contains( tstep_list , 12 )); + test_assert_false( obs_tstep_list_contains( tstep_list , 15 )); + + obs_tstep_list_add_range( tstep_list , 10 , 12 ); + test_assert_false( obs_tstep_list_contains( tstep_list , 0 )); + test_assert_true( obs_tstep_list_contains( tstep_list , 10 )); + test_assert_true( obs_tstep_list_contains( tstep_list , 12 )); + test_assert_false( obs_tstep_list_contains( tstep_list , 15 )); + + obs_tstep_list_free( tstep_list ); +} + + +int main(int argc , char ** argv) { + obs_tstep_list_type * tstep_list; + + tstep_list = obs_tstep_list_alloc(); + test_assert_true( obs_tstep_list_is_instance( tstep_list )); + test_assert_true( obs_tstep_list_all_active( tstep_list )); + test_assert_int_equal( 0 , obs_tstep_list_get_size( tstep_list )); + + obs_tstep_list_add_tstep( tstep_list , 100 ); + test_assert_int_equal( 1 , obs_tstep_list_get_size( tstep_list )); + test_assert_false( obs_tstep_list_all_active( tstep_list )); + + obs_tstep_list_add_tstep( tstep_list , 101 ); + test_assert_int_equal( 2 , obs_tstep_list_get_size( tstep_list )); + + obs_tstep_list_add_tstep( tstep_list , 101 ); + test_assert_int_equal( 2 , obs_tstep_list_get_size( tstep_list )); + + obs_tstep_list_add_tstep( tstep_list , 1 ); + test_assert_int_equal( 3 , obs_tstep_list_get_size( tstep_list )); + + test_assert_int_equal( 1 , obs_tstep_list_iget( tstep_list , 0 )); + test_assert_int_equal( 100 , obs_tstep_list_iget( tstep_list , 1 )); + test_assert_int_equal( 101 , obs_tstep_list_iget( tstep_list , 2 )); + + test_assert_int_equal( 101 , obs_tstep_list_get_last( tstep_list )); + obs_tstep_list_free( tstep_list ); + + + test_range(); + test_contains(); + exit(0); +} + diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_pca_plot.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_pca_plot.c new file mode 100644 index 0000000000..86504f3931 --- /dev/null +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_pca_plot.c @@ -0,0 +1,119 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'enkf_pca_plot.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#include + +#include +#include +#include + +#include +#include + + + +pca_plot_data_type * create_data() { + matrix_type * PC = matrix_alloc( 3 , 10); + matrix_type * PC_obs = matrix_alloc( 3 , 1 ); + pca_plot_data_type * data = pca_plot_data_alloc("KEY" , PC , PC_obs); + + matrix_free( PC ); + matrix_free( PC_obs ); + return data; +} + + + +void test_create_data() { + matrix_type * PC = matrix_alloc( 3 , 10); + matrix_type * PC_obs = matrix_alloc( 3 , 1 ); + { + pca_plot_data_type * data = pca_plot_data_alloc("KEY" , PC , PC_obs); + test_assert_true( pca_plot_data_is_instance( data )); + test_assert_int_equal( 3 , pca_plot_data_get_size( data )); + test_assert_int_equal( 10 , pca_plot_data_get_ens_size( data )); + test_assert_string_equal( "KEY" , pca_plot_data_get_name( data )); + pca_plot_data_free( data ); + } + matrix_resize( PC , 4 , 10 , false); + test_assert_NULL( pca_plot_data_alloc( "KEY" , PC , PC_obs )); + + matrix_resize( PC_obs , 3 , 2 , false); + test_assert_NULL( pca_plot_data_alloc( "KEY" , PC , PC_obs )); + + matrix_free( PC ); + matrix_free( PC_obs ); +} + + + +void test_create_vector() { + matrix_type * PC = matrix_alloc( 3 , 10); + matrix_type * PC_obs = matrix_alloc( 3 , 1 ); + { + pca_plot_vector_type * vector = pca_plot_vector_alloc(0 , PC , PC_obs); + test_assert_true( pca_plot_vector_is_instance( vector )); + pca_plot_vector_free( vector ); + } + matrix_free( PC ); + matrix_free( PC_obs ); +} + + +void test_get_vector() { + pca_plot_data_type * data = create_data(); + test_assert_true( pca_plot_vector_is_instance( pca_plot_data_iget_vector( data , 0 ))); + pca_plot_data_free( data ); +} + + +void test_content() { + rng_type * rng = rng_alloc(MZRAN , INIT_DEFAULT); + matrix_type * PC = matrix_alloc( 3 , 10); + matrix_type * PC_obs = matrix_alloc( 3 , 1 ); + matrix_random_init( PC , rng ); + matrix_random_init( PC_obs , rng ); + { + pca_plot_data_type * data = pca_plot_data_alloc("KEY" , PC , PC_obs); + for (int i=0; i < matrix_get_rows( PC ); i++) { + const pca_plot_vector_type * vector = pca_plot_data_iget_vector( data , i ); + + test_assert_double_equal( matrix_iget( PC_obs , i , 0) , + pca_plot_vector_get_obs_value( vector ) ); + + for (int j=0; j < matrix_get_columns( PC ); j++) + test_assert_double_equal( matrix_iget( PC , i , j ) , pca_plot_vector_iget_sim_value( vector , j )); + + test_assert_int_equal( matrix_get_columns( PC ) , pca_plot_vector_get_size( vector )); + + } + pca_plot_data_free( data ); + } + + matrix_free( PC ); + matrix_free( PC_obs ); +} + + +int main(int argc , char ** argv) { + test_create_data(); + test_create_vector(); + test_get_vector(); + test_content(); + exit(0); +} + diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_rng.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_rng.c index f5b5f9d02c..5a5b19cfef 100644 --- a/ThirdParty/Ert/devel/libenkf/tests/enkf_rng.c +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_rng.c @@ -31,7 +31,7 @@ int main(int argc , char ** argv) { unsigned int rand1,rand2; { - test_work_area_type * work_area = test_work_area_alloc("enkf-rng-0", false); + test_work_area_type * work_area = test_work_area_alloc("enkf-rng-0"); { enkf_main_type * enkf_main = enkf_main_alloc_empty(); enkf_main_resize_ensemble( enkf_main , 10 ); @@ -58,7 +58,7 @@ int main(int argc , char ** argv) { /*****************************************************************/ { - test_work_area_type * work_area = test_work_area_alloc("enkf-rng-1" , false ); + test_work_area_type * work_area = test_work_area_alloc("enkf-rng-1" ); const char * seed_file = "seed"; { enkf_main_type * enkf_main = enkf_main_alloc_empty(); @@ -99,7 +99,7 @@ int main(int argc , char ** argv) { { const char * config_path = argv[1]; const char * config_file = argv[2]; - test_work_area_type * work_area = test_work_area_alloc("enkf-rng-2" , false ); + test_work_area_type * work_area = test_work_area_alloc("enkf-rng-2" ); test_work_area_copy_directory_content( work_area , config_path ); { enkf_main_type * enkf_main = enkf_main_bootstrap( NULL , config_file , true , true ); diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_runpath_list.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_runpath_list.c index 44e66c0145..1a274d4538 100644 --- a/ThirdParty/Ert/devel/libenkf/tests/enkf_runpath_list.c +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_runpath_list.c @@ -99,7 +99,7 @@ int main(int argc , char ** argv) { } { - test_work_area_type * work_area = test_work_area_alloc("enkf_runpath_list" , true); + test_work_area_type * work_area = test_work_area_alloc("enkf_runpath_list" ); const char *filename = "runpath_list.txt"; { FILE * stream = util_fopen( filename, "w"); diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_state_map.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_state_map.c index fe035a2081..16f4807c1a 100644 --- a/ThirdParty/Ert/devel/libenkf/tests/enkf_state_map.c +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_state_map.c @@ -107,7 +107,7 @@ void test_copy() { void test_io( ) { - test_work_area_type * work_area = test_work_area_alloc( "enkf-state-map" , false ); + test_work_area_type * work_area = test_work_area_alloc( "enkf-state-map" ); { state_map_type * state_map = state_map_alloc(); state_map_type * copy1 , *copy2; @@ -153,6 +153,29 @@ void test_update_undefined( ) { } +void test_update_matching( ) { + state_map_type * map = state_map_alloc( ); + + state_map_iset( map , 10 , STATE_INITIALIZED ); + state_map_iset( map , 3 , STATE_PARENT_FAILURE ); + test_assert_int_equal( STATE_UNDEFINED , state_map_iget( map , 5 ) ); + test_assert_int_equal( STATE_INITIALIZED , state_map_iget( map , 10 ) ); + + state_map_update_matching( map , 5 , STATE_UNDEFINED | STATE_LOAD_FAILURE , STATE_INITIALIZED ); + state_map_update_matching( map , 10 , STATE_UNDEFINED | STATE_LOAD_FAILURE , STATE_INITIALIZED ); + state_map_update_matching( map , 3 , STATE_UNDEFINED | STATE_LOAD_FAILURE , STATE_INITIALIZED ); + + test_assert_int_equal( STATE_INITIALIZED , state_map_iget( map , 5 ) ); + test_assert_int_equal( STATE_INITIALIZED , state_map_iget( map , 10 ) ); + test_assert_int_equal( STATE_PARENT_FAILURE , state_map_iget( map , 3 ) ); + + state_map_update_undefined( map , 10 , STATE_INITIALIZED ); + test_assert_int_equal( STATE_INITIALIZED , state_map_iget( map , 10 ) ); + + state_map_free( map ); +} + + void test_select_matching( ) { state_map_type * map = state_map_alloc( ); bool_vector_type * mask1 = bool_vector_alloc(0 , false); diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_state_report_step_compatible.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_state_report_step_compatible.c index 50de52ec6e..acc9e53c93 100644 --- a/ThirdParty/Ert/devel/libenkf/tests/enkf_state_report_step_compatible.c +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_state_report_step_compatible.c @@ -55,7 +55,7 @@ int main(int argc , char ** argv) { test_assert_true( util_sscanf_bool( compatible_str , &check_compatible)); - test_work_area_type * work_area = test_work_area_alloc(config_file , false); + test_work_area_type * work_area = test_work_area_alloc(config_file ); test_work_area_copy_directory_content( work_area , root_path ); bool strict = true; diff --git a/ThirdParty/Ert/devel/libenkf/tests/enkf_time_map.c b/ThirdParty/Ert/devel/libenkf/tests/enkf_time_map.c index 034a3ccce2..1e68ba4356 100644 --- a/ThirdParty/Ert/devel/libenkf/tests/enkf_time_map.c +++ b/ThirdParty/Ert/devel/libenkf/tests/enkf_time_map.c @@ -57,7 +57,7 @@ void ecl_test( const char * ecl_case ) { void simple_test() { time_map_type * time_map = time_map_alloc( ); - test_work_area_type * work_area = test_work_area_alloc("enkf_time_map" , true); + test_work_area_type * work_area = test_work_area_alloc("enkf_time_map" ); const char * mapfile = "map"; test_assert_true( time_map_update( time_map , 0 , 100 ) ); diff --git a/ThirdParty/Ert/devel/libert_util/include/ert/util/arg_pack.h b/ThirdParty/Ert/devel/libert_util/include/ert/util/arg_pack.h index 5600411106..12ffd60e40 100644 --- a/ThirdParty/Ert/devel/libert_util/include/ert/util/arg_pack.h +++ b/ThirdParty/Ert/devel/libert_util/include/ert/util/arg_pack.h @@ -34,6 +34,7 @@ typedef void * (arg_node_copyc_ftype) (const void *); arg_pack_type * arg_pack_alloc(); UTIL_SAFE_CAST_HEADER( arg_pack ); UTIL_SAFE_CAST_HEADER_CONST( arg_pack ); + UTIL_IS_INSTANCE_HEADER( arg_pack ); void arg_pack_free(arg_pack_type * ); void arg_pack_free__(void *); @@ -56,6 +57,8 @@ typedef void * (arg_node_copyc_ftype) (const void *); void * arg_pack_iget_ptr(const arg_pack_type * , int); void * arg_pack_iget_adress(const arg_pack_type * , int); node_ctype arg_pack_iget_ctype(const arg_pack_type * arg_pack ,int index); + + int arg_pack_size( const arg_pack_type * arg_pack ); /*****************************************************************/ diff --git a/ThirdParty/Ert/devel/libert_util/include/ert/util/matrix.h b/ThirdParty/Ert/devel/libert_util/include/ert/util/matrix.h index b16bad7bae..7c2a466570 100644 --- a/ThirdParty/Ert/devel/libert_util/include/ert/util/matrix.h +++ b/ThirdParty/Ert/devel/libert_util/include/ert/util/matrix.h @@ -34,6 +34,7 @@ extern "C" { typedef struct matrix_struct matrix_type; + bool matrix_check_dims( const matrix_type * m , int rows , int columns); void matrix_fscanf_data( matrix_type * matrix , bool row_major_order , FILE * stream ); void matrix_fprintf( const matrix_type * matrix , const char * fmt , FILE * stream ); void matrix_pretty_fprint(const matrix_type * matrix , const char * name , const char * fmt , FILE * stream); diff --git a/ThirdParty/Ert/devel/libert_util/include/ert/util/stringlist.h b/ThirdParty/Ert/devel/libert_util/include/ert/util/stringlist.h index 450a875392..381602bfe1 100644 --- a/ThirdParty/Ert/devel/libert_util/include/ert/util/stringlist.h +++ b/ThirdParty/Ert/devel/libert_util/include/ert/util/stringlist.h @@ -103,6 +103,8 @@ typedef int ( string_cmp_ftype) (const void * , const void *); int stringlist_select_matching(stringlist_type * names , const char * pattern); #endif int stringlist_select_matching_files(stringlist_type * names , const char * path , const char * file_pattern); + int stringlist_select_matching_elements(stringlist_type * target , const stringlist_type * src , const char * pattern); + int stringlist_append_matching_elements(stringlist_type * target , const stringlist_type * src , const char * pattern); UTIL_IS_INSTANCE_HEADER(stringlist); #ifdef __cplusplus diff --git a/ThirdParty/Ert/devel/libert_util/include/ert/util/test_work_area.h b/ThirdParty/Ert/devel/libert_util/include/ert/util/test_work_area.h index 1cd04aa900..0559e4cc7d 100644 --- a/ThirdParty/Ert/devel/libert_util/include/ert/util/test_work_area.h +++ b/ThirdParty/Ert/devel/libert_util/include/ert/util/test_work_area.h @@ -26,9 +26,15 @@ extern "C" { #include +#include + typedef struct test_work_area_struct test_work_area_type; - test_work_area_type * test_work_area_alloc(const char * test_name , bool store); + test_work_area_type * test_work_area_alloc(const char * test_name ); + test_work_area_type * test_work_area_alloc_with_prefix(const char * prefix , const char * test_name); + test_work_area_type * test_work_area_alloc__(const char * prefix , const char * test_path); + void test_work_area_set_store( test_work_area_type * work_area , bool store); + void test_work_area_free(test_work_area_type * work_area); const char * test_work_area_get_cwd( const test_work_area_type * work_area ); const char * test_work_area_get_original_cwd( const test_work_area_type * work_area ); @@ -36,6 +42,11 @@ extern "C" { void test_work_area_copy_directory( test_work_area_type * work_area , const char * input_directory); void test_work_area_copy_directory_content( test_work_area_type * work_area , const char * input_directory); void test_work_area_copy_file( test_work_area_type * work_area , const char * input_file); + bool test_work_area_copy_parent_directory( test_work_area_type * work_area , const char * input_path); + bool test_work_area_copy_parent_content( test_work_area_type * work_area , const char * input_path); + + + UTIL_IS_INSTANCE_HEADER( test_work_area ); #ifdef __cplusplus } diff --git a/ThirdParty/Ert/devel/libert_util/include/ert/util/util.h b/ThirdParty/Ert/devel/libert_util/include/ert/util/util.h index 810f1ff419..5b6968efc3 100644 --- a/ThirdParty/Ert/devel/libert_util/include/ert/util/util.h +++ b/ThirdParty/Ert/devel/libert_util/include/ert/util/util.h @@ -253,6 +253,7 @@ typedef enum {left_pad = 0, char ** util_alloc_stringlist_copy(const char **, int ); void util_split_string(const char *, const char *, int *, char ***); void util_path_split(const char * , int *, char ***); + char * util_alloc_parent_path( const char * path); void util_binary_split_string(const char * , const char * , bool , char ** , char ** ); void util_binary_split_string_from_max_length(const char * , const char * , int , char ** , char ** ); char * util_alloc_joined_string(const char ** , int , const char * ); @@ -378,7 +379,7 @@ typedef enum {left_pad = 0, void util_unsetenv( const char * variable); char * util_alloc_envvar( const char * value ); bool util_is_link(const char * ); // Will always return false on windows - + int util_chdir(const char * path); #define UTIL_FWRITE_SCALAR(s,stream) { if (fwrite(&s , sizeof s , 1 , stream) != 1) util_abort("%s: write failed: %s\n",__func__ , strerror(errno)); } diff --git a/ThirdParty/Ert/devel/libert_util/include/ert/util/vector_template.h b/ThirdParty/Ert/devel/libert_util/include/ert/util/vector_template.h index 2ae2b65317..9b5b25f297 100644 --- a/ThirdParty/Ert/devel/libert_util/include/ert/util/vector_template.h +++ b/ThirdParty/Ert/devel/libert_util/include/ert/util/vector_template.h @@ -111,7 +111,8 @@ typedef @TYPE@ (@TYPE@_ftype) (@TYPE@); int @TYPE@_vector_count_equal( const @TYPE@_vector_type * vector , @TYPE@ cmp_value); int @TYPE@_vector_element_size( const @TYPE@_vector_type * vector ); - UTIL_SAFE_CAST_HEADER( @TYPE@_vector ); + //UTIL_SAFE_CAST_HEADER( @TYPE@_vector ); + UTIL_IS_INSTANCE_HEADER( @TYPE@_vector ); #ifdef __cplusplus } diff --git a/ThirdParty/Ert/devel/libert_util/src/CMakeLists.txt b/ThirdParty/Ert/devel/libert_util/src/CMakeLists.txt index 9004407e23..be5135c8b0 100644 --- a/ThirdParty/Ert/devel/libert_util/src/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libert_util/src/CMakeLists.txt @@ -1,11 +1,13 @@ -set(source_files rng.c lookup_table.c statistics.c mzran.c set.c hash_node.c hash_sll.c hash.c node_data.c node_ctype.c util.c thread_pool.c msg.c arg_pack.c path_fmt.c menu.c subst_list.c subst_func.c vector.c parser.c stringlist.c matrix.c buffer.c log.c template.c timer.c time_interval.c string_util.c type_vector_functions.c) +set(source_files rng.c lookup_table.c statistics.c mzran.c set.c hash_node.c hash_sll.c hash.c node_data.c node_ctype.c util.c thread_pool.c msg.c arg_pack.c path_fmt.c menu.c subst_list.c subst_func.c vector.c parser.c stringlist.c matrix.c buffer.c log.c template.c timer.c time_interval.c string_util.c type_vector_functions.c test_work_area.c) -set(header_files ssize_t.h type_macros.h rng.h lookup_table.h statistics.h mzran.h set.h hash.h hash_node.h hash_sll.h node_data.h node_ctype.h util.h thread_pool.h msg.h arg_pack.h path_fmt.h stringlist.h menu.h subst_list.h subst_func.h vector.h parser.h matrix.h buffer.h log.h template.h timer.h time_interval.h string_util.h type_vector_functions.h) +set(header_files ssize_t.h type_macros.h rng.h lookup_table.h statistics.h mzran.h set.h hash.h hash_node.h hash_sll.h node_data.h node_ctype.h util.h thread_pool.h msg.h arg_pack.h path_fmt.h stringlist.h menu.h subst_list.h subst_func.h vector.h parser.h matrix.h buffer.h log.h template.h timer.h time_interval.h string_util.h type_vector_functions.h test_work_area.h) -set( test_source test_util.c test_work_area.c ) +set( test_source test_util.c ) +set( test_headers test_util.h ) - -#set_property(SOURCE hash.c PROPERTY COMPILE_FLAGS "-Wno-error") +if (CMAKE_COMPILER_IS_GNUCC) + set_property(SOURCE hash.c PROPERTY COMPILE_FLAGS "-Wno-error") +endif() if (WITH_LATEX) @@ -91,6 +93,7 @@ endif() #----------------------------------------------------------------- if (INSTALL_ERT) install(TARGETS ert_util DESTINATION ${CMAKE_INSTALL_LIBDIR}) + foreach(header ${header_files}) install(FILES ../include/ert/util/${header} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/ert/util) endforeach() diff --git a/ThirdParty/Ert/devel/libert_util/src/arg_pack.c b/ThirdParty/Ert/devel/libert_util/src/arg_pack.c index 33e2884194..c9484a501c 100644 --- a/ThirdParty/Ert/devel/libert_util/src/arg_pack.c +++ b/ThirdParty/Ert/devel/libert_util/src/arg_pack.c @@ -335,6 +335,7 @@ static void arg_node_fprintf(const arg_node_type * node , FILE * stream) { UTIL_SAFE_CAST_FUNCTION( arg_pack , ARG_PACK_TYPE_ID) UTIL_SAFE_CAST_FUNCTION_CONST( arg_pack , ARG_PACK_TYPE_ID) +UTIL_IS_INSTANCE_FUNCTION(arg_pack , ARG_PACK_TYPE_ID) static void __arg_pack_assert_index(const arg_pack_type * arg , int iarg) { if (iarg < 0 || iarg >= arg->size) @@ -558,7 +559,9 @@ void arg_pack_append_owned_ptr(arg_pack_type * arg_pack, void * ptr, arg_node_fr arg_pack_iset_owned_ptr( arg_pack , arg_pack->size , ptr , freef); } - +int arg_pack_size( const arg_pack_type * arg_pack ) { + return arg_pack->size; +} /******************************************************************/ /* Functions for formatted reading/writing of arg_pack instances. */ diff --git a/ThirdParty/Ert/devel/libert_util/src/matrix.c b/ThirdParty/Ert/devel/libert_util/src/matrix.c index 1e18618559..9f20a19cde 100644 --- a/ThirdParty/Ert/devel/libert_util/src/matrix.c +++ b/ThirdParty/Ert/devel/libert_util/src/matrix.c @@ -1427,6 +1427,13 @@ double matrix_trace(const matrix_type *matrix) { } +bool matrix_check_dims( const matrix_type * m , int rows , int columns) { + if ((m->rows == rows) && (m->columns == columns)) + return true; + else + return false; +} + double matrix_diag_std(const matrix_type * Sk,double mean) { diff --git a/ThirdParty/Ert/devel/libert_util/src/path_stack.c b/ThirdParty/Ert/devel/libert_util/src/path_stack.c index 3391c1089e..f6190d6d85 100644 --- a/ThirdParty/Ert/devel/libert_util/src/path_stack.c +++ b/ThirdParty/Ert/devel/libert_util/src/path_stack.c @@ -82,7 +82,7 @@ void path_stack_free( path_stack_type * path_stack ) { bool path_stack_push( path_stack_type * path_stack , const char * path ) { if (path != NULL) - if (chdir( path ) != 0) + if (util_chdir( path ) != 0) return false; path_stack_push_cwd( path_stack ); @@ -98,7 +98,7 @@ void path_stack_push_cwd( path_stack_type * path_stack ) { const char * path_stack_pop( path_stack_type * path_stack ) { char * path = stringlist_pop( path_stack->stack ); - if (chdir( path ) == 0) + if (util_chdir( path ) == 0) return path; else { // The directory has become inaccesible ... diff --git a/ThirdParty/Ert/devel/libert_util/src/stringlist.c b/ThirdParty/Ert/devel/libert_util/src/stringlist.c index 7b762104a4..075d8c2147 100644 --- a/ThirdParty/Ert/devel/libert_util/src/stringlist.c +++ b/ThirdParty/Ert/devel/libert_util/src/stringlist.c @@ -732,7 +732,23 @@ int stringlist_select_matching_files(stringlist_type * names , const char * path #endif } - +int stringlist_append_matching_elements(stringlist_type * target , const stringlist_type * src , const char * pattern) { + int ielm; + int match_count = 0; + for (ielm = 0; ielm < stringlist_get_size( src ); ielm++) { + const char * item = stringlist_iget( src , ielm ); + if (util_fnmatch( pattern , item ) == 0) { + stringlist_append_copy( target , item ); + match_count++; + } + } + return match_count; +} + + int stringlist_select_matching_elements(stringlist_type * target , const stringlist_type * src , const char * pattern) { + stringlist_clear( target ); + return stringlist_append_matching_elements( target , src , pattern ); +} #ifdef __cplusplus } diff --git a/ThirdParty/Ert/devel/libert_util/src/test_work_area.c b/ThirdParty/Ert/devel/libert_util/src/test_work_area.c index fbe9f62fd1..bf9dd8203a 100644 --- a/ThirdParty/Ert/devel/libert_util/src/test_work_area.c +++ b/ThirdParty/Ert/devel/libert_util/src/test_work_area.c @@ -16,15 +16,19 @@ for more details. */ +#ifdef HAVE_GETUID #include #include #include +#endif + #include #include +#include - -#include #include +#include +#include #include /* @@ -38,7 +42,7 @@ problems, to achieve this the directories created will be per user. When creating the work area you pass in a boolean flag whether you - want the area to be retained when the destructor is called. After + want the area to be storeed when the destructor is called. After the the work_area is destroyed the cwd is changed back to the value it had before the area was created. @@ -70,59 +74,88 @@ ... -- Destroy test_work_area structure; since the work_area is created - -- with input flag @retain set to true the are on disk will not be + -- with input flag @store set to true the are on disk will not be -- cleared. After the test_work_area_free( ) function has been -- called the original cwd will be restored. test_work_area_free( work_area ); */ +#define DEFAULT_STORE false +#define DEFAULT_PREFIX "/tmp" + +#define TEST_PATH_FMT "%s/ert-test/%s/%08d" /* username/ert-test/test_name/random-integer */ +#define FULL_PATH_FMT "%s/%s" /* prefix/test-path */ -#define PATH_FMT "/tmp/%s/ert-test/%s/%08d" /* /tmp/username/ert-test/test_name/random-integer */ +#define TEST_WORK_AREA_TYPE_ID 1107355 struct test_work_area_struct { - bool retain; + UTIL_TYPE_ID_DECLARATION; + bool store; char * cwd; char * original_cwd; }; -static test_work_area_type * test_work_area_alloc__(const char * path , bool retain) { - util_make_path( path ); - if (true) { - test_work_area_type * work_area = util_malloc( sizeof * work_area ); - work_area->retain = retain; - work_area->cwd = util_alloc_string_copy( path ); - work_area->original_cwd = util_alloc_cwd(); - chdir( work_area->cwd ); - - return work_area; - } +test_work_area_type * test_work_area_alloc__(const char * prefix , const char * test_path) { + test_work_area_type * work_area = NULL; + + if (util_is_directory( prefix )) { + char * test_cwd = util_alloc_sprintf(FULL_PATH_FMT , prefix , test_path ); + util_make_path( test_cwd ); + if (true) { + work_area = util_malloc( sizeof * work_area ); + + UTIL_TYPE_ID_INIT( work_area , TEST_WORK_AREA_TYPE_ID ); + work_area->original_cwd = util_alloc_cwd(); + work_area->cwd = test_cwd; + util_chdir( work_area->cwd ); + test_work_area_set_store( work_area , DEFAULT_STORE); + } else + free( test_cwd ); + } + return work_area; } +UTIL_IS_INSTANCE_FUNCTION( test_work_area , TEST_WORK_AREA_TYPE_ID) -test_work_area_type * test_work_area_alloc(const char * test_name, bool retain) { +test_work_area_type * test_work_area_alloc_with_prefix(const char * prefix , const char * test_name) { if (test_name) { + rng_type * rng = rng_alloc(MZRAN , INIT_DEV_URANDOM ); +#ifdef HAVE_GETUID uid_t uid = getuid(); struct passwd * pw = getpwuid( uid ); - rng_type * rng = rng_alloc(MZRAN , INIT_DEV_URANDOM ); - char * path = util_alloc_sprintf( PATH_FMT , pw->pw_name , test_name , rng_get_int( rng , 100000000 )); - test_work_area_type * work_area = test_work_area_alloc__( path , retain ); - free( path ); + char * user_name = util_alloc_string_copy( pw->pw_name ); +#else + char * user_name = util_alloc_sprintf("ert-test-%08d" , rng_get_int(rng , 100000000)); +#endif + char * test_path = util_alloc_sprintf( TEST_PATH_FMT , user_name , test_name , rng_get_int( rng , 100000000 )); + test_work_area_type * work_area = test_work_area_alloc__( prefix , test_path); + free( test_path ); rng_free( rng ); + free( user_name ); return work_area; } else return NULL; } +test_work_area_type * test_work_area_alloc(const char * test_name) { + return test_work_area_alloc_with_prefix( DEFAULT_PREFIX , test_name); +} + + +void test_work_area_set_store( test_work_area_type * work_area , bool store) { + work_area->store = store; +} + void test_work_area_free(test_work_area_type * work_area) { - if (!work_area->retain) + if (!work_area->store) util_clear_directory( work_area->cwd , true , true ); - - chdir( work_area->original_cwd ); + + util_chdir( work_area->original_cwd ); free( work_area->original_cwd ); free( work_area->cwd ); free( work_area ); @@ -139,6 +172,7 @@ const char * test_work_area_get_original_cwd( const test_work_area_type * work_a } + /** The point of this function is that the test code should be able to access the file @input_file independent of the fact that it has @@ -214,3 +248,40 @@ void test_work_area_copy_file( test_work_area_type * work_area , const char * in } + +static bool test_work_area_copy_parent__( test_work_area_type * work_area , const char * input_path, bool copy_content) { + char * full_path; + + if (util_is_abs_path( input_path )) + full_path = util_alloc_string_copy( input_path ); + else + full_path = util_alloc_filename( work_area->original_cwd , input_path , NULL); + + if (util_entry_exists( full_path)) { + char * parent_path = NULL; + + parent_path = util_alloc_parent_path( full_path ); + + if (copy_content) + test_work_area_copy_directory_content( work_area , parent_path ); + else + test_work_area_copy_directory( work_area , parent_path ); + + free( full_path ); + free( parent_path ); + return true; + } else { + free( full_path ); + return false; + } +} + + +bool test_work_area_copy_parent_directory( test_work_area_type * work_area , const char * input_path) { + return test_work_area_copy_parent__( work_area , input_path , false ); +} + + +bool test_work_area_copy_parent_content( test_work_area_type * work_area , const char * input_path) { + return test_work_area_copy_parent__( work_area , input_path , true ); +} diff --git a/ThirdParty/Ert/devel/libert_util/src/thread_pool_posix.c b/ThirdParty/Ert/devel/libert_util/src/thread_pool_posix.c index 6865ff3c29..fd7cdca194 100644 --- a/ThirdParty/Ert/devel/libert_util/src/thread_pool_posix.c +++ b/ThirdParty/Ert/devel/libert_util/src/thread_pool_posix.c @@ -246,6 +246,11 @@ static void * thread_pool_main_loop( void * arg ) { Here is the actual pthread_create() call creating an additional running thread. */ + + /*Cleanup of previous run threads. Needed to avoid memory leak*/ + if (job_slot->run_count > 0) + pthread_join(job_slot->thread, NULL); + pthread_create( &job_slot->thread , NULL , thread_pool_start_job , tp_arg ); job_slot->run_count += 1; tp->queue_index++; diff --git a/ThirdParty/Ert/devel/libert_util/src/util.c b/ThirdParty/Ert/devel/libert_util/src/util.c index c73653748e..83ac2a2bd1 100644 --- a/ThirdParty/Ert/devel/libert_util/src/util.c +++ b/ThirdParty/Ert/devel/libert_util/src/util.c @@ -39,11 +39,13 @@ #ifdef WITH_PTHREAD #ifdef HAVE_EXECINFO #ifdef HAVE_GETPWUID +#ifdef HAVE_DLADDR #define HAVE_UTIL_ABORT #endif #endif #endif #endif +#endif #ifdef HAVE_UTIL_ABORT #define __USE_GNU // Must be defined to get access to the dladdr() function; Man page says the symbol should be: _GNU_SOURCE but that does not seem to work? @@ -4989,5 +4991,5 @@ int util_type_get_id( const void * data ) { return type_id; } - +#include "util_chdir.c" diff --git a/ThirdParty/Ert/devel/libert_util/src/util_abort_gnu.c b/ThirdParty/Ert/devel/libert_util/src/util_abort_gnu.c index 180ffc0a19..bc9ad0196e 100644 --- a/ThirdParty/Ert/devel/libert_util/src/util_abort_gnu.c +++ b/ThirdParty/Ert/devel/libert_util/src/util_abort_gnu.c @@ -26,7 +26,19 @@ This function is purely a helper function for util_abort(). */ - +#if !defined(__GLIBC__) /* note: not same as __GNUC__ */ +# if defined (__APPLE__) +# include /* alloca */ +# include /* PATH_MAX */ +# include /* _NSGetExecutablePath */ +# elif defined (__LINUX__) +# include /* alloca */ +# include /* PATH_MAX */ +# include /* readlink */ +# else +# error No known program_invocation_name in runtime library +# endif +#endif #define UNDEFINED_FUNCTION "??" @@ -213,6 +225,16 @@ void util_abort(const char * fmt , ...) { const bool include_backtrace = true; if (include_backtrace) { if (__abort_program_message != NULL) { +#if !defined(__GLIBC__) + /* allocate a temporary buffer to hold the path */ + char* program_invocation_name = alloca (PATH_MAX); +# if defined(__APPLE__) + uint32_t buflen = PATH_MAX; + _NSGetExecutablePath (program_invocation_name, &buflen); +# elif defined(__LINUX__) + readlink ("/proc/self/exe", program_invocation_name, PATH_MAX); +# endif +#endif /* !defined(__GLIBC__) */ fprintf(abort_dump,"--------------------------------------------------------------------------------\n"); fprintf(abort_dump,"%s",__abort_program_message); fprintf(abort_dump, "Current executable ..: %s\n" , program_invocation_name); diff --git a/ThirdParty/Ert/devel/libert_util/src/util_chdir.c b/ThirdParty/Ert/devel/libert_util/src/util_chdir.c new file mode 100644 index 0000000000..93f6d873e8 --- /dev/null +++ b/ThirdParty/Ert/devel/libert_util/src/util_chdir.c @@ -0,0 +1,37 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'util_chdir.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + +#ifdef HAVE_CHDIR +#include +#endif + +/* +#ifdef HAVE_WINDOWS_CHDIR +#include +#endif +*/ + +int util_chdir(const char * path) { +#ifdef HAVE_CHDIR + return chdir( path ); +#else +#ifdef HAVE_WINDOWS_CHDIR + return _chdir( path ); +#endif +#endif +} diff --git a/ThirdParty/Ert/devel/libert_util/src/util_fork.c b/ThirdParty/Ert/devel/libert_util/src/util_fork.c index 3af24be1a9..209cd844ef 100644 --- a/ThirdParty/Ert/devel/libert_util/src/util_fork.c +++ b/ThirdParty/Ert/devel/libert_util/src/util_fork.c @@ -75,7 +75,7 @@ pid_t util_fork_exec(const char * executable , int argc , const char ** argv , nice(19); /* Remote process is run with nice(19). */ if (run_path != NULL) { - if (chdir(run_path) != 0) + if (util_chdir(run_path) != 0) util_abort("%s: failed to change to directory:%s %s \n",__func__ , run_path , strerror(errno)); } diff --git a/ThirdParty/Ert/devel/libert_util/src/util_opendir.c b/ThirdParty/Ert/devel/libert_util/src/util_opendir.c index 05848bf898..61c71b9735 100644 --- a/ThirdParty/Ert/devel/libert_util/src/util_opendir.c +++ b/ThirdParty/Ert/devel/libert_util/src/util_opendir.c @@ -34,7 +34,7 @@ static void util_copy_directory__(const char * src_path , const char * target_pa } } - +/* Does not handle symlinks. */ void util_copy_directory_content(const char * src_path , const char * target_path) { int buffer_size = 16 * 1024 * 1024; /* 16 MB */ void * buffer = util_malloc( buffer_size ); @@ -47,7 +47,7 @@ void util_copy_directory_content(const char * src_path , const char * target_pat Equivalent to shell command cp -r src_path target_path */ -/* Does not handle symlinks (I think ...). */ +/* Does not handle symlinks. */ void util_copy_directory(const char * src_path , const char * __target_path) { diff --git a/ThirdParty/Ert/devel/libert_util/src/util_path.c b/ThirdParty/Ert/devel/libert_util/src/util_path.c index 2bf953f232..3ca5b285d0 100644 --- a/ThirdParty/Ert/devel/libert_util/src/util_path.c +++ b/ThirdParty/Ert/devel/libert_util/src/util_path.c @@ -231,3 +231,57 @@ char * util_split_alloc_filename( const char * input_path ) { void util_path_split(const char *line , int *_tokens, char ***_token_list) { util_split_string( line , UTIL_PATH_SEP_STRING , _tokens , _token_list); } + +/** + Observe that +*/ + +char * util_alloc_parent_path( const char * path) { + int path_ncomp; + char ** path_component_list; + char * parent_path = NULL; + + if (path) { + bool is_abs = util_is_abs_path( path ); + char * work_path; + + if (strstr(path , "..")) { + if (is_abs) + work_path = util_alloc_realpath__( path ); + else { + char * abs_path = util_alloc_realpath__( path ); + char * cwd = util_alloc_cwd(); + work_path = util_alloc_rel_path( cwd , abs_path ); + free( abs_path ); + free( cwd ); + } + } else + work_path = util_alloc_string_copy( path ); + + util_path_split( work_path , &path_ncomp , &path_component_list ); + if (path_ncomp > 0) { + int current_length = 4; + int ip; + + parent_path = util_realloc( parent_path , current_length * sizeof * parent_path); + parent_path[0] = '\0'; + + for (ip=0; ip < path_ncomp - 1; ip++) { + const char * ipath = path_component_list[ip]; + int min_length = strlen(parent_path) + strlen(ipath) + 1; + + if (min_length >= current_length) { + current_length = 2 * min_length; + parent_path = util_realloc( parent_path , current_length * sizeof * parent_path); + } + + if (is_abs || (ip > 0)) + strcat( parent_path , UTIL_PATH_SEP_STRING ); + strcat( parent_path , ipath ); + } + } + util_free_stringlist( path_component_list , path_ncomp ); + free( work_path ); + } + return parent_path; +} diff --git a/ThirdParty/Ert/devel/libert_util/src/vector_template.c b/ThirdParty/Ert/devel/libert_util/src/vector_template.c index 5ae8e9bb4b..57fde975be 100644 --- a/ThirdParty/Ert/devel/libert_util/src/vector_template.c +++ b/ThirdParty/Ert/devel/libert_util/src/vector_template.c @@ -132,9 +132,8 @@ typedef struct { } sort_node_type; - -UTIL_SAFE_CAST_FUNCTION(@TYPE@_vector , TYPE_VECTOR_ID); - +static UTIL_SAFE_CAST_FUNCTION(@TYPE@_vector , TYPE_VECTOR_ID); +UTIL_IS_INSTANCE_FUNCTION(@TYPE@_vector , TYPE_VECTOR_ID); static void @TYPE@_vector_realloc_data__(@TYPE@_vector_type * vector , int new_alloc_size) { @@ -930,19 +929,22 @@ int @TYPE@_vector_get_min_index(const @TYPE@_vector_type * vector, bool reverse) */ int @TYPE@_vector_index(const @TYPE@_vector_type * vector , @TYPE@ value) { - int index = 0; - while (true) { - if (vector->data[index] == value) - break; - - index++; - if (index == vector->size) { - index = -1; /* Not found */ - break; + if (vector->size) { + int index = 0; + while (true) { + if (vector->data[index] == value) + break; + + index++; + if (index == vector->size) { + index = -1; /* Not found */ + break; + } } - } - - return index; + + return index; + } else + return -1; } @@ -952,48 +954,51 @@ int @TYPE@_vector_index(const @TYPE@_vector_type * vector , @TYPE@ value) { */ int @TYPE@_vector_index_sorted(const @TYPE@_vector_type * vector , @TYPE@ value) { - if (value < vector->data[0]) - return -1; - if (value == vector->data[ 0 ]) - return 0; - - { - int last_index = vector->size - 1; - if (value > vector->data[ last_index ]) + if (vector->size) { + + if (value < vector->data[0]) return -1; - if (value == vector->data[ last_index]) - return last_index; - } - - - { - int lower_index = 0; - int upper_index = vector->size - 1; + if (value == vector->data[ 0 ]) + return 0; - while (true) { - if ((upper_index - lower_index) <= 1) - /* Not found */ + { + int last_index = vector->size - 1; + if (value > vector->data[ last_index ]) return -1; - - { - int center_index = (lower_index + upper_index) / 2; - @TYPE@ center_value = vector->data[ center_index ]; + if (value == vector->data[ last_index]) + return last_index; + } + + + { + int lower_index = 0; + int upper_index = vector->size - 1; + + while (true) { + if ((upper_index - lower_index) <= 1) + /* Not found */ + return -1; - if (center_value == value) - /* Found it */ - return center_index; - else { - if (center_value > value) - upper_index = center_index; - else - lower_index = center_index; + { + int center_index = (lower_index + upper_index) / 2; + @TYPE@ center_value = vector->data[ center_index ]; + + if (center_value == value) + /* Found it */ + return center_index; + else { + if (center_value > value) + upper_index = center_index; + else + lower_index = center_index; + } } } } - } + } else + return -1; } - /*****************************************************************/ /* Functions for sorting a vector instance. */ diff --git a/ThirdParty/Ert/devel/libert_util/tests/CMakeLists.txt b/ThirdParty/Ert/devel/libert_util/tests/CMakeLists.txt index 8c715300f2..6161835766 100644 --- a/ThirdParty/Ert/devel/libert_util/tests/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libert_util/tests/CMakeLists.txt @@ -14,6 +14,10 @@ add_executable( ert_util_type_vector_test ert_util_type_vector_test.c ) target_link_libraries( ert_util_type_vector_test ert_util test_util ) add_test( ert_util_type_vector_test ${EXECUTABLE_OUTPUT_PATH}/ert_util_type_vector_test ) +add_executable( ert_util_matrix ert_util_matrix.c ) +target_link_libraries( ert_util_matrix ert_util test_util ) +add_test( ert_util_matrix ${EXECUTABLE_OUTPUT_PATH}/ert_util_matrix ) + add_executable( ert_util_filename ert_util_filename.c ) target_link_libraries( ert_util_filename ert_util test_util ) add_test( ert_util_filename ${EXECUTABLE_OUTPUT_PATH}/ert_util_filename ) @@ -103,10 +107,14 @@ add_executable( ert_util_addr2line ert_util_addr2line.c ) target_link_libraries( ert_util_addr2line ert_util test_util ) add_test( ert_util_addr2line ${EXECUTABLE_OUTPUT_PATH}/ert_util_addr2line) +add_executable( ert_util_parent_path ert_util_parent_path.c ) +target_link_libraries( ert_util_parent_path ert_util test_util ) +add_test( ert_util_parent_path ${EXECUTABLE_OUTPUT_PATH}/ert_util_parent_path) + add_executable( ert_util_work_area ert_util_work_area.c ) target_link_libraries( ert_util_work_area ert_util test_util ) add_test( NAME ert_util_work_area - COMMAND ${EXECUTABLE_OUTPUT_PATH}/ert_util_work_area data/file1.txt ${CMAKE_CURRENT_SOURCE_DIR}/data/file2.txt data + COMMAND ${EXECUTABLE_OUTPUT_PATH}/ert_util_work_area data2/file1 ${CMAKE_CURRENT_SOURCE_DIR}/data2/file2 data2 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/ThirdParty/Ert/devel/python/python/ert/ert/__init__.py b/ThirdParty/Ert/devel/libert_util/tests/data2/dir2/file4 similarity index 100% rename from ThirdParty/Ert/devel/python/python/ert/ert/__init__.py rename to ThirdParty/Ert/devel/libert_util/tests/data2/dir2/file4 diff --git a/ThirdParty/Ert/devel/libert_util/tests/data2/file1 b/ThirdParty/Ert/devel/libert_util/tests/data2/file1 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ThirdParty/Ert/devel/libert_util/tests/data2/file2 b/ThirdParty/Ert/devel/libert_util/tests/data2/file2 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ThirdParty/Ert/devel/libert_util/tests/data2/file3 b/ThirdParty/Ert/devel/libert_util/tests/data2/file3 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ThirdParty/Ert/devel/libert_util/tests/ert_util_addr2line.c b/ThirdParty/Ert/devel/libert_util/tests/ert_util_addr2line.c index 4bb6c48054..c278264e79 100644 --- a/ThirdParty/Ert/devel/libert_util/tests/ert_util_addr2line.c +++ b/ThirdParty/Ert/devel/libert_util/tests/ert_util_addr2line.c @@ -41,7 +41,7 @@ void test_lookup(bool valid_address, bool change_cwd) { if (change_cwd) { char * cwd = util_alloc_cwd(); - chdir("/tmp"); + util_chdir("/tmp"); if (valid_address) { test_assert_false( util_addr2line_lookup( bt_addr[0] , &func_name , &file_name , &line_nr)); test_assert_string_equal( func_name , func ); @@ -53,7 +53,7 @@ void test_lookup(bool valid_address, bool change_cwd) { test_assert_string_equal( file_name , NULL); test_assert_int_equal( 0 , line_nr ); } - chdir(cwd); + util_chdir(cwd); free( cwd ); } else { if (valid_address) { @@ -87,7 +87,7 @@ int main( int argc , char ** argv) { */ util_alloc_file_components( argv[0] , &path , &name, NULL); - chdir(path); + util_chdir(path); dot_name = util_alloc_sprintf("./%s" , name); child_pid = util_fork_exec( dot_name , 0 , NULL , true , NULL , NULL , NULL , NULL , NULL); exit(0); diff --git a/ThirdParty/Ert/devel/libert_util/tests/ert_util_arg_pack.c b/ThirdParty/Ert/devel/libert_util/tests/ert_util_arg_pack.c index 0790c1b3a4..63ccdf5c14 100644 --- a/ThirdParty/Ert/devel/libert_util/tests/ert_util_arg_pack.c +++ b/ThirdParty/Ert/devel/libert_util/tests/ert_util_arg_pack.c @@ -35,12 +35,15 @@ int main( int argc , char ** argv) { const char * ptr2 = "Pointer2"; arg_pack_type * arg_pack = arg_pack_alloc(); + test_assert_int_equal( 0 , arg_pack_size( arg_pack )); arg_pack_append_const_ptr( arg_pack , ptr1 ); arg_pack_append_const_ptr( arg_pack , ptr2 ); - + test_assert_int_equal( 2 , arg_pack_size( arg_pack )); test_assert_ptr_equal( ptr1 , arg_pack_iget_const_ptr( arg_pack , 0 )); test_assert_ptr_equal( ptr2 , arg_pack_iget_const_ptr( arg_pack , 1 )); + + exit(0); } diff --git a/ThirdParty/Ert/devel/libert_util/tests/ert_util_logh.c b/ThirdParty/Ert/devel/libert_util/tests/ert_util_logh.c index 0528fe2601..9bc104d885 100644 --- a/ThirdParty/Ert/devel/libert_util/tests/ert_util_logh.c +++ b/ThirdParty/Ert/devel/libert_util/tests/ert_util_logh.c @@ -26,7 +26,7 @@ #define LOG_FILE "log.txt" int main(int argc , char ** argv) { - test_work_area_type * work_area = test_work_area_alloc("util/logh" , false); + test_work_area_type * work_area = test_work_area_alloc("util/logh"); { log_type * logh = log_open( NULL , 0 ); diff --git a/ThirdParty/Ert/devel/libert_util/tests/ert_util_matrix.c b/ThirdParty/Ert/devel/libert_util/tests/ert_util_matrix.c new file mode 100644 index 0000000000..f3ac1ba22b --- /dev/null +++ b/ThirdParty/Ert/devel/libert_util/tests/ert_util_matrix.c @@ -0,0 +1,39 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'ert_util_matrix.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + + + +#include + +#include +#include + + + +int main( int argc , char ** argv) { + const int rows = 10; + const int columns = 13; + matrix_type * m = matrix_alloc(rows , columns); + + test_assert_true( matrix_check_dims(m , rows , columns)); + test_assert_false( matrix_check_dims(m , rows + 1 , columns)); + test_assert_false( matrix_check_dims(m , rows , columns + 1)); + + matrix_free( m ); + exit(0); +} diff --git a/ThirdParty/Ert/devel/libert_util/tests/ert_util_parent_path.c b/ThirdParty/Ert/devel/libert_util/tests/ert_util_parent_path.c new file mode 100644 index 0000000000..4990846747 --- /dev/null +++ b/ThirdParty/Ert/devel/libert_util/tests/ert_util_parent_path.c @@ -0,0 +1,54 @@ +/* + Copyright (C) 2012 Statoil ASA, Norway. + + The file 'ert_util_parent_path.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + +#include +#include +#include +#include +#include + +#include +#include + + +void test_path(const char * expected_parent , const char * input_path ) { + char * parent_path = util_alloc_parent_path( input_path ); + test_assert_string_equal( expected_parent , parent_path); + free( parent_path ); +} + + + +int main(int argc , char ** argv) { + + test_path("" , "path"); + test_path(NULL , ""); + test_path(NULL , NULL); + + test_path("path/parent" , "path/parent/leaf"); + test_path("/path/parent" , "/path/parent/leaf"); + test_path("/path/parent" , "/path/parent/leaf/"); + test_path("/path/parent" , "/path/parent/leaf/../leaf"); + test_path("/path" , "/path/parent/leaf/.."); + + test_path("path/parent" , "path/parent/leaf/../leaf"); + test_path("path" , "path/parent/leaf/.."); + + + exit(0); +} diff --git a/ThirdParty/Ert/devel/libert_util/tests/ert_util_path_stack_test.c b/ThirdParty/Ert/devel/libert_util/tests/ert_util_path_stack_test.c index eecadb5a0c..c582c8b2a6 100644 --- a/ThirdParty/Ert/devel/libert_util/tests/ert_util_path_stack_test.c +++ b/ThirdParty/Ert/devel/libert_util/tests/ert_util_path_stack_test.c @@ -44,7 +44,7 @@ int main(int argc , char ** argv) { if (!path_stack_push( path_stack, path1 )) test_error_exit("Failed to push:%s \n",path1 ); - chdir( path2 ); + util_chdir( path2 ); if (util_is_cwd( path1 )) test_error_exit("Failed to chdir(%s) \n",path2 ); diff --git a/ThirdParty/Ert/devel/libert_util/tests/ert_util_relpath_test.c b/ThirdParty/Ert/devel/libert_util/tests/ert_util_relpath_test.c index f571fcfbb5..6b2ce539aa 100644 --- a/ThirdParty/Ert/devel/libert_util/tests/ert_util_relpath_test.c +++ b/ThirdParty/Ert/devel/libert_util/tests/ert_util_relpath_test.c @@ -80,7 +80,7 @@ int main(int argc , char ** argv) { test_path( 6 , root6 , path6 , true6 ); test_path( 7 , root7 , path7 , true7 ); { - chdir(root8); + util_chdir(root8); test_path( 8 , NULL , path8 , true8 ); } diff --git a/ThirdParty/Ert/devel/libert_util/tests/ert_util_stringlist_test.c b/ThirdParty/Ert/devel/libert_util/tests/ert_util_stringlist_test.c index c56706e9f7..99bb0774c3 100644 --- a/ThirdParty/Ert/devel/libert_util/tests/ert_util_stringlist_test.c +++ b/ThirdParty/Ert/devel/libert_util/tests/ert_util_stringlist_test.c @@ -95,10 +95,92 @@ void test_empty() { } +void test_split() { + stringlist_type * s1 = stringlist_alloc_from_split("My Name is Joakim Hove" , " "); + test_assert_int_equal( 5 , stringlist_get_size( s1 )); + test_assert_string_equal( "My" , stringlist_iget( s1 , 0 )); + test_assert_string_equal( "Name" , stringlist_iget( s1 , 1 )); + test_assert_string_equal( "is" , stringlist_iget( s1 , 2 )); + test_assert_string_equal( "Joakim" , stringlist_iget( s1 , 3 )); + test_assert_string_equal( "Hove" , stringlist_iget( s1 , 4 )); + stringlist_free( s1 ); + + + s1 = stringlist_alloc_from_split("StringWithNoSPlit" , " "); + test_assert_int_equal( 1 , stringlist_get_size( s1 )); + test_assert_string_equal( "StringWithNoSPlit" , stringlist_iget( s1 , 0 )); + stringlist_free( s1 ); + + s1 = stringlist_alloc_from_split("A:B::C:D:" , ":"); + test_assert_int_equal( 4 , stringlist_get_size( s1 )); + test_assert_string_equal( "A" , stringlist_iget( s1 , 0 )); + test_assert_string_equal( "B" , stringlist_iget( s1 , 1 )); + test_assert_string_equal( "C" , stringlist_iget( s1 , 2 )); + test_assert_string_equal( "D" , stringlist_iget( s1 , 3 )); + stringlist_free( s1 ); + + s1 = stringlist_alloc_from_split("A:B::C:D:" , "::"); + test_assert_int_equal( 4 , stringlist_get_size( s1 )); + test_assert_string_equal( "A" , stringlist_iget( s1 , 0 )); + test_assert_string_equal( "B" , stringlist_iget( s1 , 1 )); + test_assert_string_equal( "C" , stringlist_iget( s1 , 2 )); + test_assert_string_equal( "D" , stringlist_iget( s1 , 3 )); + stringlist_free( s1 ); +} + + +void test_matching() { + stringlist_type * s1 = stringlist_alloc_new(); + stringlist_type * s2 = stringlist_alloc_new(); + + stringlist_append_copy(s1 , "AAA"); + stringlist_append_copy(s1 , "ABC" ); + stringlist_append_copy(s1 , "123"); + stringlist_append_copy(s1 , "ABC:123"); + + stringlist_select_matching_elements( s2 , s1 , "*"); + test_assert_int_equal( 4 , stringlist_get_size( s2 )); + test_assert_string_equal( "AAA" , stringlist_iget( s2 , 0 )); + test_assert_string_equal( "ABC" , stringlist_iget( s2 , 1 )); + test_assert_string_equal( "123" , stringlist_iget( s2 , 2 )); + test_assert_string_equal( "ABC:123" , stringlist_iget( s2 , 3 )); + + stringlist_select_matching_elements( s2 , s1 , "*"); + test_assert_int_equal( 4 , stringlist_get_size( s2 )); + test_assert_string_equal( "AAA" , stringlist_iget( s2 , 0 )); + test_assert_string_equal( "ABC" , stringlist_iget( s2 , 1 )); + test_assert_string_equal( "123" , stringlist_iget( s2 , 2 )); + test_assert_string_equal( "ABC:123" , stringlist_iget( s2 , 3 )); + + + stringlist_append_matching_elements( s2 , s1 , "*"); + test_assert_int_equal( 8 , stringlist_get_size( s2 )); + test_assert_string_equal( "AAA" , stringlist_iget( s2 , 0 )); + test_assert_string_equal( "ABC" , stringlist_iget( s2 , 1 )); + test_assert_string_equal( "123" , stringlist_iget( s2 , 2 )); + test_assert_string_equal( "ABC:123" , stringlist_iget( s2 , 3 )); + + test_assert_string_equal( "AAA" , stringlist_iget( s2 , 4 )); + test_assert_string_equal( "ABC" , stringlist_iget( s2 , 5 )); + test_assert_string_equal( "123" , stringlist_iget( s2 , 6 )); + test_assert_string_equal( "ABC:123" , stringlist_iget( s2 , 7 )); + + stringlist_select_matching_elements( s2 , s1 , "*B*"); + test_assert_int_equal( 2 , stringlist_get_size( s2 )); + test_assert_string_equal( "ABC" , stringlist_iget( s2 , 0 )); + test_assert_string_equal( "ABC:123" , stringlist_iget( s2 , 1 )); + + stringlist_free( s2 ); + stringlist_free( s1 ); +} + + int main( int argc , char ** argv) { test_empty(); test_char(); test_reverse(); test_iget_as_int(); + test_split(); + test_matching(); exit(0); } diff --git a/ThirdParty/Ert/devel/libert_util/tests/ert_util_type_vector_test.c b/ThirdParty/Ert/devel/libert_util/tests/ert_util_type_vector_test.c index f2733a2176..06a6cfa4c4 100644 --- a/ThirdParty/Ert/devel/libert_util/tests/ert_util_type_vector_test.c +++ b/ThirdParty/Ert/devel/libert_util/tests/ert_util_type_vector_test.c @@ -19,6 +19,7 @@ #include #include +#include #include void assert_equal( bool equal ) { @@ -57,7 +58,12 @@ void test_alloc() { int main(int argc , char ** argv) { int_vector_type * int_vector = int_vector_alloc( 0 , 99); - + + test_assert_int_equal( -1 , int_vector_index(int_vector , 100)); + test_assert_int_equal( -1 , int_vector_index_sorted(int_vector , 100)); + + test_assert_true( int_vector_is_instance( int_vector )); + test_assert_false( double_vector_is_instance( int_vector )); int_vector_iset( int_vector , 2 , 0); int_vector_insert( int_vector , 2 , 77 ); int_vector_iset( int_vector , 5 , -10); diff --git a/ThirdParty/Ert/devel/libert_util/tests/ert_util_work_area.c b/ThirdParty/Ert/devel/libert_util/tests/ert_util_work_area.c index 5f257a70cd..a0630c678f 100644 --- a/ThirdParty/Ert/devel/libert_util/tests/ert_util_work_area.c +++ b/ThirdParty/Ert/devel/libert_util/tests/ert_util_work_area.c @@ -17,6 +17,7 @@ */ #include +#include #include #include #include @@ -26,7 +27,7 @@ void test_get_cwd() { - test_work_area_type * work_area = test_work_area_alloc( "CWD-TEST", false); + test_work_area_type * work_area = test_work_area_alloc( "CWD-TEST"); char * cwd = util_alloc_cwd(); test_assert_string_equal( cwd , test_work_area_get_cwd( work_area )); free( cwd ); @@ -36,7 +37,7 @@ void test_get_cwd() { void test_get_original_cwd() { char * cwd = util_alloc_cwd(); - test_work_area_type * work_area = test_work_area_alloc( "CWD-ORG-TEST", false); + test_work_area_type * work_area = test_work_area_alloc( "CWD-ORG-TEST"); test_assert_string_equal( cwd , test_work_area_get_original_cwd( work_area )); free( cwd ); test_work_area_free( work_area ); @@ -47,9 +48,10 @@ void test_get_original_cwd() { void create_test_area(const char * test_name , bool store) { char * pre_cwd = util_alloc_cwd(); - test_work_area_type * work_area = test_work_area_alloc( test_name , store); + test_work_area_type * work_area = test_work_area_alloc( test_name ); char * work_path = util_alloc_string_copy( test_work_area_get_cwd( work_area )); + test_work_area_set_store( work_area , store ); test_assert_true( util_is_directory( work_path )); test_work_area_free( work_area ); test_assert_bool_equal( store , util_entry_exists( work_path )); @@ -66,7 +68,7 @@ void create_test_area(const char * test_name , bool store) { void test_install_file_exists(const char * filename ) { char * abs_input_path = util_alloc_abs_path( filename ); - test_work_area_type * work_area = test_work_area_alloc( "FILE-TEST" , false); + test_work_area_type * work_area = test_work_area_alloc( "FILE-TEST" ); test_work_area_install_file( work_area , filename ); test_assert_true( util_files_equal( abs_input_path , filename )); @@ -76,7 +78,7 @@ void test_install_file_exists(const char * filename ) { void test_copy_directory(const char * rel_path) { - test_work_area_type * work_area = test_work_area_alloc( "FILE-TEST" , false); + test_work_area_type * work_area = test_work_area_alloc( "FILE-TEST" ); test_work_area_copy_directory( work_area , rel_path ); test_assert_true( util_is_directory( rel_path )); test_work_area_free( work_area ); @@ -84,7 +86,7 @@ void test_copy_directory(const char * rel_path) { void test_input() { - test_work_area_type * work_area = test_work_area_alloc( NULL , false ); + test_work_area_type * work_area = test_work_area_alloc( NULL ); test_assert_NULL( work_area ); } @@ -92,7 +94,7 @@ void test_input() { void test_copy_file( const char * src_file ) { char * filename = util_split_alloc_filename( src_file ); - test_work_area_type * work_area = test_work_area_alloc( "copy-file" , true ); + test_work_area_type * work_area = test_work_area_alloc( "copy-file" ); test_work_area_copy_file( work_area , src_file ); test_assert_true( util_file_exists( filename )); @@ -102,6 +104,111 @@ void test_copy_file( const char * src_file ) { } +void test_copy_parent_directory( const char * path ) { + test_work_area_type * work_area = test_work_area_alloc( "copy-parent-directory" ); + char * parent_path; + + { + char * full_path = util_alloc_abs_path( path ); + util_alloc_file_components( path , &parent_path , NULL , NULL); + free( full_path ); + } + + test_assert_false( test_work_area_copy_parent_directory( work_area , "Does/not/exist") ); + test_assert_true( test_work_area_copy_parent_directory( work_area , path ) ); + + test_assert_true( util_entry_exists( parent_path )); + test_assert_true( util_is_directory( parent_path )); + + test_work_area_free( work_area ); + free( parent_path ); +} + + +void test_copy_parent_content( const char * path ) { + char * full_path = util_alloc_abs_path( path ); + char * parent_path = util_alloc_parent_path( full_path ); + test_work_area_type * work_area = test_work_area_alloc( "copy-parent-content" ); + + test_assert_false( test_work_area_copy_parent_content( work_area , "Does/not/exist") ); + test_assert_true( test_work_area_copy_parent_content( work_area , path ) ); + + { + + struct dirent ** src_namelist; + struct dirent ** target_namelist; + int src_size = scandir( parent_path , &src_namelist , NULL , alphasort); + int target_size = scandir( test_work_area_get_cwd( work_area ) , &target_namelist , NULL , alphasort); + + test_assert_int_equal( src_size , target_size ); + for (int i=0; i < src_size; i++) { + test_assert_string_equal( src_namelist[i]->d_name , target_namelist[i]->d_name); + + free( src_namelist[i] ); + free( target_namelist[i] ); + } + + free( src_namelist ); + free( target_namelist ); + } + free( parent_path ); + free( full_path ); + + test_work_area_free( work_area ); +} + + +void test_with_prefix() { + test_work_area_type * work_area = test_work_area_alloc( "with-prefix" ); + + util_make_path( "PREFIX" ); + { + test_work_area_type * sub_area = test_work_area_alloc__("PREFIX" , "sub-work" ); + test_assert_true( test_work_area_is_instance( sub_area )); + test_work_area_free( sub_area ); + test_assert_true( util_entry_exists("PREFIX/sub-work")); + } + { + test_work_area_type * sub_area = test_work_area_alloc__("DoesNotExist" , "sub-work" ); + test_assert_NULL( sub_area ); + } + test_work_area_free( work_area ); +} + + +void test_update_store() { + { + test_work_area_type * work_area = test_work_area_alloc( "update-store1" ); + char * work_cwd = util_alloc_string_copy( test_work_area_get_cwd( work_area )); + test_work_area_set_store( work_area , true ); + test_work_area_free( work_area ); + test_assert_true( util_entry_exists( work_cwd )); + } + + { + test_work_area_type * work_area = test_work_area_alloc( "update-store2" ); + char * work_cwd = util_alloc_string_copy( test_work_area_get_cwd( work_area )); + test_work_area_free( work_area ); + test_assert_false( util_entry_exists( work_cwd )); + } + + { + test_work_area_type * work_area = test_work_area_alloc( "update-store3" ); + char * work_cwd = util_alloc_string_copy( test_work_area_get_cwd( work_area )); + test_work_area_set_store( work_area , false ); + test_work_area_free( work_area ); + test_assert_false( util_entry_exists( work_cwd )); + } + + { + test_work_area_type * work_area = test_work_area_alloc( "update-store4" ); + char * work_cwd = util_alloc_string_copy( test_work_area_get_cwd( work_area )); + test_work_area_set_store( work_area , true); + test_work_area_free( work_area ); + test_assert_true( util_entry_exists( work_cwd )); + } +} + int main(int argc , char ** argv) { const char * rel_path_file = argv[1]; @@ -120,5 +227,14 @@ int main(int argc , char ** argv) { test_copy_file( rel_path_file ); test_copy_file( abs_path_file ); + test_copy_parent_directory( rel_path_file ); + test_copy_parent_directory( abs_path_file ); + + test_copy_parent_content( rel_path_file ); + test_copy_parent_content( abs_path_file ); + + test_with_prefix(); + test_update_store(); + exit(0); } diff --git a/ThirdParty/Ert/devel/libjob_queue/CMakeLists.txt b/ThirdParty/Ert/devel/libjob_queue/CMakeLists.txt index 31482517e7..2a45e061a3 100644 --- a/ThirdParty/Ert/devel/libjob_queue/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libjob_queue/CMakeLists.txt @@ -1,27 +1,27 @@ -if (USE_LSF) - set( HAVE_LSF_LIBRARY ON ) - set( LSF_INCLUDE_PATH $ENV{LSF_INCLUDE_PATH} CACHE FILEPATH "Path to LSF header files") - set( LSF_LIB_PATH $ENV{LSF_HOME}/lib CACHE FILEPATH "Path to LSF library files") - - set( LSF_TEST_INCLUDE_PATH ${LSF_INCLUDE_PATH}/lsf ) - find_path( LSF_HEADER lsf.h ${LSF_TEST_INCLUDE_PATH}) - find_library( LSF_LIBRARY NAMES lsf PATHS ${LSF_LIB_PATH}) - - if (NOT DEFINED LSF_HEADER) - set( HAVE_LSF_LIBRARY OFF) - endif() - - if (NOT DEFINED LSF_LIBRARY) - set( HAVE_LSF_LIBRARY OFF ) - endif() - - if (HAVE_LSF_LIBRARY) - include_directories( ${LSF_INCLUDE_PATH} ) - add_definitions( -DHAVE_LSF_LIBRARY ) - endif() +set( HAVE_LSF_LIBRARY OFF ) +set( LSF_INCLUDE_PATH $ENV{LSF_INCLUDE_PATH} CACHE FILEPATH "Path to search for LSF header file lsf/lsf.h") +set( LSF_LIB_PATH $ENV{LSF_HOME}/lib CACHE FILEPATH "Path to search for LSF library files") + +find_path( LSF_HEADER_PATH lsf/lsf.h + PATHS ${LSF_INCLUDE_PATH}) + +find_library( LSF_LIBRARY NAMES lsf PATHS ${LSF_LIB_PATH}) + +if (LSF_HEADER_PATH) + if (LSF_LIBRARY) + set( HAVE_LSF_LIBRARY ON ) + endif() endif() +if (HAVE_LSF_LIBRARY) + include_directories( ${LSF_HEADER_PATH} ) + add_definitions( -DHAVE_LSF_LIBRARY ) + message(STATUS "Found LSF as ${LSF_HEADER_PATH} and ${LSF_LIBRARY}") +else() + message(STATUS "LSF not found") +endif() + add_subdirectory( src ) if (BUILD_APPLICATIONS) add_subdirectory( applications ) diff --git a/ThirdParty/Ert/devel/libjob_queue/applications/CMakeLists.txt b/ThirdParty/Ert/devel/libjob_queue/applications/CMakeLists.txt index 1358818a99..94693ed1a1 100644 --- a/ThirdParty/Ert/devel/libjob_queue/applications/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libjob_queue/applications/CMakeLists.txt @@ -1,8 +1,9 @@ -add_executable( block_node block_node.c ) -target_link_libraries( block_node job_queue ert_util) -if (USE_RUNPATH) - add_runpath( block_node ) -endif() +if (HAVE_LSF_LIBRARY) + add_executable( block_node block_node.c ) + target_link_libraries( block_node job_queue ert_util) + if (USE_RUNPATH) + add_runpath( block_node ) + endif() -set (destination ${CMAKE_INSTALL_PREFIX}/bin) -install(TARGETS block_node DESTINATION ${destination}) + install(TARGETS block_node DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) +endif() diff --git a/ThirdParty/Ert/devel/libjob_queue/include/ert/job_queue/job_queue.h b/ThirdParty/Ert/devel/libjob_queue/include/ert/job_queue/job_queue.h index 6c670ef579..ca8b31b3be 100644 --- a/ThirdParty/Ert/devel/libjob_queue/include/ert/job_queue/job_queue.h +++ b/ThirdParty/Ert/devel/libjob_queue/include/ert/job_queue/job_queue.h @@ -45,7 +45,8 @@ extern "C" { int job_queue_add_job_mt(job_queue_type * , const char * run_cmd , job_callback_ftype * done_callback, - job_callback_ftype * retry_callback , + job_callback_ftype * retry_callback, + job_callback_ftype * exit_callback, void * callback_arg , int num_cpu , const char * , @@ -56,7 +57,8 @@ extern "C" { int job_queue_add_job_st(job_queue_type * , const char * run_cmd , job_callback_ftype * done_callback, - job_callback_ftype * retry_callback , + job_callback_ftype * retry_callback, + job_callback_ftype * exit_callback, void * callback_arg , int num_cpu , const char * , @@ -64,7 +66,8 @@ extern "C" { int argc , const char ** argv ); - void job_queue_run_jobs(job_queue_type * , int , bool verbose); + void job_queue_reset(job_queue_type * queue); + void job_queue_run_jobs(job_queue_type * queue, int num_total_run, bool verbose); void job_queue_run_jobs_threaded(job_queue_type * queue , int num_total_run, bool verbose); void * job_queue_run_jobs__(void * ); job_status_type job_queue_iget_job_status(const job_queue_type * , int ); @@ -72,14 +75,20 @@ extern "C" { int job_queue_iget_status_summary( const job_queue_type * queue , job_status_type status); time_t job_queue_iget_sim_start( job_queue_type * queue, int job_index); + time_t job_queue_iget_sim_end( job_queue_type * queue, int job_index); time_t job_queue_iget_submit_time( job_queue_type * queue, int job_index); job_driver_type job_queue_lookup_driver_name( const char * driver_name ); + void job_queue_set_max_job_duration(job_queue_type * queue, int max_duration_seconds); + int job_queue_get_max_job_duration(const job_queue_type * queue); + void job_queue_set_job_stop_time(job_queue_type * queue, time_t time); + time_t job_queue_get_job_stop_time(const job_queue_type * queue); + void job_queue_set_auto_job_stop_time(job_queue_type * queue); bool job_queue_kill_job( job_queue_type * queue , int job_index); bool job_queue_is_running( const job_queue_type * queue ); void job_queue_set_max_submit( job_queue_type * job_queue , int max_submit ); int job_queue_get_max_submit(const job_queue_type * job_queue ); - + bool job_queue_get_open(const job_queue_type * job_queue); bool job_queue_get_pause( const job_queue_type * job_queue ); void job_queue_set_pause_on( job_queue_type * job_queue); void job_queue_set_pause_off( job_queue_type * job_queue); @@ -91,6 +100,7 @@ extern "C" { int job_queue_get_num_waiting( const job_queue_type * queue); int job_queue_get_num_complete( const job_queue_type * queue); int job_queue_get_num_failed( const job_queue_type * queue); + int job_queue_get_num_killed( const job_queue_type * queue); const char * job_queue_iget_failed_job( const job_queue_type * queue , int job_index); const char * job_queue_iget_error_reason( const job_queue_type * queue , int job_index); const char * job_queue_iget_stderr_capture( const job_queue_type * queue , int job_index); diff --git a/ThirdParty/Ert/devel/libjob_queue/include/ert/job_queue/lsf_job_stat.h b/ThirdParty/Ert/devel/libjob_queue/include/ert/job_queue/lsf_job_stat.h new file mode 100644 index 0000000000..03937cd402 --- /dev/null +++ b/ThirdParty/Ert/devel/libjob_queue/include/ert/job_queue/lsf_job_stat.h @@ -0,0 +1,31 @@ +/* + Copyright (C) 2011 Statoil ASA, Norway. + + The file 'lsf_driver.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + +#ifdef HAVE_LSF_LIBRARY +#include +#else +#define JOB_STAT_NULL 0 +#define JOB_STAT_PEND 1 +#define JOB_STAT_SSUSP 0x08 +#define JOB_STAT_USUSP 0x10 +#define JOB_STAT_PSUSP 0x02 +#define JOB_STAT_RUN 0x04 +#define JOB_STAT_EXIT 0x20 +#define JOB_STAT_DONE 0x40 +#define JOB_STAT_UNKWN 0x10000 +#endif diff --git a/ThirdParty/Ert/devel/libjob_queue/include/ert/job_queue/queue_driver.h b/ThirdParty/Ert/devel/libjob_queue/include/ert/job_queue/queue_driver.h index f99ab17254..63efc4bd27 100644 --- a/ThirdParty/Ert/devel/libjob_queue/include/ert/job_queue/queue_driver.h +++ b/ThirdParty/Ert/devel/libjob_queue/include/ert/job_queue/queue_driver.h @@ -73,19 +73,17 @@ extern "C" { #define JOB_STATUS_ENUM_DEFS \ {.value = 1 , .name = "JOB_QUEUE_NOT_ACTIVE" }, \ -{.value = 2 , .name = "JOB_QUEUE_LOADING" }, \ {.value = 4 , .name = "JOB_QUEUE_WAITING" }, \ {.value = 8 , .name = "JOB_QUEUE_SUBMITTED" }, \ {.value = 16 , .name = "JOB_QUEUE_PENDING" }, \ {.value = 32 , .name = "JOB_QUEUE_RUNNING" }, \ {.value = 64 , .name = "JOB_QUEUE_DONE" }, \ {.value = 128 , .name = "JOB_QUEUE_EXIT" }, \ -{.value = 256 , .name = "JOB_QUEUE_RUN_OK" }, \ -{.value = 512 , .name = "JOB_QUEUE_RUN_FAIL" }, \ -{.value = 1024 , .name = "JOB_QUEUE_ALL_OK" }, \ -{.value = 2048 , .name = "JOB_QUEUE_ALL_FAIL" }, \ {.value = 4096 , .name = "JOB_QUEUE_USER_KILLED" },\ -{.value = 8192 , .name = "JOB_QUEUE_USER_EXIT" } +{.value = 8192 , .name = "JOB_QUEUE_USER_EXIT" },\ +{.value = 16384 , .name = "JOB_QUEUE_SUCCESS" },\ +{.value = 32768 , .name = "JOB_QUEUE_RUNNING_CALLBACK" },\ +{.value = 65536 , .name = "JOB_QUEUE_FAILED" } #define JOB_STATUS_ENUM_SIZE JOB_QUEUE_MAX_STATE @@ -103,7 +101,7 @@ extern "C" { job which is not in this state, the only thing happening is that the function job_queue_kill_simulation() wil return false. */ -#define JOB_QUEUE_CAN_KILL (JOB_QUEUE_WAITING + JOB_QUEUE_RUNNING + JOB_QUEUE_PENDING + JOB_QUEUE_SUBMITTED) +#define JOB_QUEUE_CAN_KILL (JOB_QUEUE_WAITING + JOB_QUEUE_RUNNING + JOB_QUEUE_PENDING + JOB_QUEUE_SUBMITTED + JOB_QUEUE_USER_EXIT) @@ -144,7 +142,7 @@ extern "C" { void queue_driver_free(queue_driver_type * driver); void queue_driver_free__(void * driver); const char * queue_driver_type_enum_iget(int index, int * value); - const char * queue_driver_status_emun_iget(int index, int * value); + const char * queue_driver_status_enum_iget(int index, int * value); #ifdef __cplusplus } diff --git a/ThirdParty/Ert/devel/libjob_queue/src/CMakeLists.txt b/ThirdParty/Ert/devel/libjob_queue/src/CMakeLists.txt index 85dafa3738..164e078991 100644 --- a/ThirdParty/Ert/devel/libjob_queue/src/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libjob_queue/src/CMakeLists.txt @@ -4,14 +4,12 @@ set(source_files forward_model.c queue_driver.c job_queue.c local_driver.c rsh_d set(header_files job_queue.h queue_driver.h local_driver.h rsh_driver.h torque_driver.h ext_job.h ext_joblist.h forward_model.h workflow_job.h workflow.h workflow_joblist.h) set_property(SOURCE rsh_driver.c PROPERTY COMPILE_FLAGS "-Wno-error") -if (USE_LSF) - list( APPEND source_files lsf_driver.c) - list( APPEND header_files lsf_driver.h) - - if (HAVE_LSF_LIBRARY) - list( APPEND source_files lsb.c) - list( APPEND header_files lsb.h) - endif() +list( APPEND source_files lsf_driver.c) +list( APPEND header_files lsf_driver.h) + +if (HAVE_LSF_LIBRARY) + list( APPEND source_files lsb.c) + list( APPEND header_files lsb.h) endif() add_library( job_queue SHARED ${source_files} ) @@ -21,9 +19,7 @@ if (USE_RUNPATH) add_runpath( job_queue ) endif() -if (NEED_LIBDL) - target_link_libraries( job_queue dl ) -endif() +target_link_libraries( job_queue dl ) if (INSTALL_ERT) install(TARGETS job_queue DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/ThirdParty/Ert/devel/libjob_queue/src/job_queue.c b/ThirdParty/Ert/devel/libjob_queue/src/job_queue.c index 97fbe5acc9..e9e889180a 100644 --- a/ThirdParty/Ert/devel/libjob_queue/src/job_queue.c +++ b/ThirdParty/Ert/devel/libjob_queue/src/job_queue.c @@ -270,24 +270,26 @@ struct job_queue_node_struct { char **argv; /* The commandline arguments. */ time_t submit_time; /* When was the job added to job_queue - the FIRST TIME. */ time_t sim_start; /* When did the job change status -> RUNNING - the LAST TIME. */ + time_t sim_end ; /* When did the job finish successfully */ pthread_rwlock_t job_lock; /* This lock provides read/write locking of the job_data field. */ job_callback_ftype *done_callback; - job_callback_ftype *retry_callback; + job_callback_ftype *retry_callback; /* To determine if job can be retried */ + job_callback_ftype *exit_callback; /* Callback to perform any cleanup */ void *callback_arg; }; -static const int status_index[] = { JOB_QUEUE_NOT_ACTIVE , - JOB_QUEUE_WAITING , - JOB_QUEUE_SUBMITTED , - JOB_QUEUE_PENDING , - JOB_QUEUE_RUNNING , - JOB_QUEUE_DONE , - JOB_QUEUE_EXIT , - JOB_QUEUE_USER_KILLED , - JOB_QUEUE_USER_EXIT , - JOB_QUEUE_SUCCESS , - JOB_QUEUE_RUNNING_CALLBACK, - JOB_QUEUE_FAILED }; +static const int status_index[] = { JOB_QUEUE_NOT_ACTIVE , // Initial, allocated job state, job not added - controlled by job_queue + JOB_QUEUE_WAITING , // The job is ready to be started - controlled by job_queue + JOB_QUEUE_SUBMITTED , // Job is submitted to driver - temporary state - controlled by job_queue + JOB_QUEUE_PENDING , // Job is pending, before actual execution - controlled by queue_driver + JOB_QUEUE_RUNNING , // Job is executing - controlled by queue_driver + JOB_QUEUE_DONE , // Job is done (sucessful or not), temporary state - controlled/returned by by queue_driver + JOB_QUEUE_EXIT , // Job is done, with exit status != 0, temporary state - controlled/returned by by queue_driver + JOB_QUEUE_USER_EXIT , // User / queue system has requested killing of job - controlled by job_queue / external scope + JOB_QUEUE_USER_KILLED, // Job has been killed, due to JOB_QUEUE_USER_EXIT, FINAL STATE - controlled by job_queue + JOB_QUEUE_SUCCESS , // All good, comes after JOB_QUEUE_DONE, with additional checks, FINAL STATE - controlled by job_queue + JOB_QUEUE_RUNNING_CALLBACK, // Temporary state, while running requested callbacks after an ended job - controlled by job_queue + JOB_QUEUE_FAILED }; // Job has failed, no more retries, FINAL STATE static const char* status_name[] = { "JOB_QUEUE_NOT_ACTIVE" , "JOB_QUEUE_WAITING" , @@ -330,13 +332,15 @@ struct job_queue_struct { queue_driver_type * driver; /* A pointer to a driver instance (LSF|LOCAL|RSH) which actually 'does it'. */ int status_list[JOB_QUEUE_MAX_STATE]; /* The number of jobs in the different states. */ int old_status_list[JOB_QUEUE_MAX_STATE]; /* Should the display be updated ?? */ - + bool open; /* True if the queue has been reset and is ready for use, false if the queue has been used and not reset */ bool user_exit; /* If there comes an external signal to abondond the whole thing user_exit will be set to true, and things start to dwindle down. */ bool running; bool pause_on; bool submit_complete; bool grow; /* The function adding new jobs is requesting the job_queue function to grow the jobs array. */ int max_ok_wait_time; /* Seconds to wait for an OK file - when the job itself has said all OK. */ + int max_duration; /* Maximum allowed time for a job to run, 0 = unlimited */ + time_t stop_time; /* A job is only allowed to run until this time. 0 = no time set, ignore stop_time */ unsigned long usleep_time; /* The sleep time before checking for updates. */ pthread_mutex_t status_mutex; /* This mutex ensure that the status-change code is only run by one thread. */ pthread_mutex_t run_mutex; /* This mutex is used to ensure that ONLY one thread is executing the job_queue_run_jobs(). */ @@ -486,10 +490,12 @@ static void job_queue_node_clear(job_queue_node_type * node) { node->run_cmd = NULL; node->argc = 0; node->argv = NULL; - + node->exit_callback = NULL; node->retry_callback = NULL; node->done_callback = NULL; node->callback_arg = NULL; + node->sim_start = 0; + node->sim_end = 0; } @@ -504,15 +510,10 @@ static job_queue_node_type * job_queue_node_alloc( ) { } - -static void job_queue_node_set_status(job_queue_node_type * node, job_status_type status) { - node->job_status = status; -} - /* - The error information is retained even after the job has completede - completely, so that calling scope can ask for it - that is the - reason there are separte free() and clear functions for the error related fields. + The error information is retained even after the job has completed + completely, so that calling scope can ask for it - that is the + reason there are separate free() and clear functions for the error related fields. */ static void job_queue_node_free_data(job_queue_node_type * node) { @@ -521,6 +522,11 @@ static void job_queue_node_free_data(job_queue_node_type * node) { util_safe_free( node->ok_file ); util_safe_free( node->run_cmd ); util_free_stringlist( node->argv , node->argc ); + if (node->callback_arg) { + arg_pack_free( node->callback_arg ); + node->callback_arg = NULL; + } + if (node->job_data != NULL) util_abort("%s: internal error - driver spesific job data has not been freed - will leak.\n",__func__); } @@ -556,7 +562,8 @@ static bool job_queue_change_node_status(job_queue_type * , job_queue_node_type static void job_queue_initialize_node(job_queue_type * queue , const char * run_cmd , job_callback_ftype * done_callback, - job_callback_ftype * retry_callback, + job_callback_ftype * retry_callback, + job_callback_ftype * exit_callback, void * callback_arg , int num_cpu , const char * run_path , @@ -588,10 +595,12 @@ static void job_queue_initialize_node(job_queue_type * queue , node->ok_file = util_alloc_filename(node->run_path , queue->ok_file , NULL); node->run_cmd = util_alloc_string_copy( run_cmd ); + node->exit_callback = exit_callback; node->retry_callback = retry_callback; node->done_callback = done_callback; node->callback_arg = callback_arg; - node->sim_start = -1; + node->sim_start = 0; + node->sim_end = 0; node->submit_time = time( NULL ); /* Now the job is ready to be picked by the queue manager. */ @@ -628,12 +637,16 @@ static bool job_queue_change_node_status(job_queue_type * queue , job_queue_node job_status_type old_status = job_queue_node_get_status( node ); if (new_status != old_status) { - job_queue_node_set_status(node , new_status); + node->job_status = new_status; queue->status_list[ STATUS_INDEX(old_status) ]--; queue->status_list[ STATUS_INDEX(new_status) ]++; if (new_status == JOB_QUEUE_RUNNING) node->sim_start = time( NULL ); + + if (new_status == JOB_QUEUE_SUCCESS) + node->sim_end = time( NULL ); + status_change = true; if (new_status == JOB_QUEUE_FAILED) @@ -840,10 +853,47 @@ int job_queue_get_num_failed( const job_queue_type * queue) { return job_queue_iget_status_summary( queue , JOB_QUEUE_FAILED ); } +int job_queue_get_num_killed( const job_queue_type * queue) { + return job_queue_iget_status_summary( queue , JOB_QUEUE_USER_KILLED ); +} + int job_queue_get_active_size( const job_queue_type * queue ) { return queue->active_size; } +void job_queue_set_max_job_duration(job_queue_type * queue, int max_duration_seconds) { + queue->max_duration = max_duration_seconds; +} + +int job_queue_get_max_job_duration(const job_queue_type * queue) { + return queue->max_duration; +} + +void job_queue_set_job_stop_time(job_queue_type * queue, time_t time) { + queue->stop_time = time; +} + +time_t job_queue_get_job_stop_time(const job_queue_type * queue) { + return queue->stop_time; +} + +void job_queue_set_auto_job_stop_time(job_queue_type * queue) { + time_t sum_run_time_succeded_jobs = 0; + int num_succeded_jobs = 0; + for (int i = 0; i < queue->active_size; ++i) { + if (JOB_QUEUE_SUCCESS == job_queue_iget_job_status(queue,i)) { + sum_run_time_succeded_jobs += difftime(job_queue_iget_sim_end(queue, i), job_queue_iget_sim_start(queue, i)); + ++num_succeded_jobs; + } + } + + if (num_succeded_jobs > 0) { + time_t avg_run_time_succeded_jobs = sum_run_time_succeded_jobs / num_succeded_jobs; + time_t stop_time = time(NULL) + (avg_run_time_succeded_jobs * 0.25); + job_queue_set_job_stop_time(queue, stop_time); + } +} + /** Observe that jobs with status JOB_QUEUE_WAITING can also be killed; for those jobs the kill should be interpreted as "Forget about this job for now and set @@ -862,10 +912,9 @@ int job_queue_get_active_size( const job_queue_type * queue ) { to the queue system, and there is not yet established a mapping between external id and queue_index. */ - -bool job_queue_kill_job( job_queue_type * queue , int job_index) { +bool job_queue_kill_job_node( job_queue_type * queue , job_queue_node_type * node) { bool result = false; - job_queue_node_type * node = queue->jobs[job_index]; + pthread_rwlock_wrlock( &node->job_lock ); { if (node->job_status & JOB_QUEUE_CAN_KILL) { @@ -888,6 +937,10 @@ bool job_queue_kill_job( job_queue_type * queue , int job_index) { return result; } +bool job_queue_kill_job( job_queue_type * queue , int job_index) { + job_queue_node_type * node = queue->jobs[job_index]; + return job_queue_kill_job_node(queue, node); +} /** @@ -931,6 +984,11 @@ time_t job_queue_iget_sim_start( job_queue_type * queue, int job_index) { return node->sim_start; } +time_t job_queue_iget_sim_end( job_queue_type * queue, int job_index) { + job_queue_node_type * node = queue->jobs[job_index]; + return node->sim_end; +} + time_t job_queue_iget_submit_time( job_queue_type * queue, int job_index) { job_queue_node_type * node = queue->jobs[job_index]; return node->submit_time; @@ -993,9 +1051,9 @@ static void job_queue_clear_status( job_queue_type * queue ) { load like states?? They */ -static void job_queue_finalize(job_queue_type * queue) { +void job_queue_reset(job_queue_type * queue) { int i; - + for (i=0; i < queue->active_size; i++) job_queue_node_finalize(queue->jobs[i]); @@ -1008,6 +1066,7 @@ static void job_queue_finalize(job_queue_type * queue) { queue->submit_complete = false; queue->pause_on = false; queue->user_exit = false; + queue->open = true; queue->active_size = 0; } @@ -1017,13 +1076,9 @@ bool job_queue_is_running( const job_queue_type * queue ) { } - static void job_queue_user_exit__( job_queue_type * queue ) { int queue_index; - - for (queue_index = 0; queue_index < queue->active_size; queue_index++) { - job_queue_kill_job( queue , queue_index ); job_queue_change_node_status( queue , queue->jobs[queue_index] , JOB_QUEUE_USER_EXIT); } } @@ -1096,7 +1151,6 @@ static void job_queue_handle_DONE( job_queue_type * queue , job_queue_node_type } - static void * job_queue_run_EXIT_callback( void * arg ) { job_queue_type * job_queue; job_queue_node_type * node; @@ -1112,21 +1166,57 @@ static void * job_queue_run_EXIT_callback( void * arg ) { job_queue_change_node_status( job_queue , node , JOB_QUEUE_WAITING ); /* The job will be picked up for antother go. */ else { bool retry = false; + if (node->retry_callback != NULL) retry = node->retry_callback( node->callback_arg ); - + if (retry) { /* OK - we have invoked the retry_callback() - and that has returned true; giving this job a brand new start. */ node->submit_attempt = 0; job_queue_change_node_status(job_queue , node , JOB_QUEUE_WAITING); - } else + } else { + // It's time to call it a day + + if (node->exit_callback != NULL) + node->exit_callback( node->callback_arg ); job_queue_change_node_status(job_queue , node , JOB_QUEUE_FAILED); + } } return NULL; } +static void * job_queue_run_USER_EXIT_callback( void * arg ) { + job_queue_type * job_queue; + job_queue_node_type * node; + { + arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); + job_queue = arg_pack_iget_ptr( arg_pack , 0 ); + node = arg_pack_iget_ptr( arg_pack , 1 ); + arg_pack_free( arg_pack ); + } + job_queue_free_job_driver_data( job_queue , node ); + + // It's time to call it a day + if (node->exit_callback != NULL) + node->exit_callback( node->callback_arg ); + + job_queue_change_node_status(job_queue, node, JOB_QUEUE_USER_KILLED); + return NULL; +} + +static void job_queue_handle_USER_EXIT( job_queue_type * queue , job_queue_node_type * node) { + // TODO: Right place for this? + job_queue_kill_job_node(queue, node); + job_queue_change_node_status(queue , node , JOB_QUEUE_RUNNING_CALLBACK ); + { + arg_pack_type * arg_pack = arg_pack_alloc(); + arg_pack_append_ptr( arg_pack , queue ); + arg_pack_append_ptr( arg_pack , node ); + thread_pool_add_job( queue->work_pool , job_queue_run_USER_EXIT_callback , arg_pack ); + } +} static void job_queue_handle_EXIT( job_queue_type * queue , job_queue_node_type * node) { job_queue_change_node_status(queue , node , JOB_QUEUE_RUNNING_CALLBACK ); @@ -1187,6 +1277,38 @@ int job_queue_inc_max_runnning( job_queue_type * queue, int delta ) { /*****************************************************************/ +static void job_queue_check_expired(job_queue_type * queue) { + if ((job_queue_get_max_job_duration(queue) <= 0) && (job_queue_get_job_stop_time(queue) <= 0)) + return; + + for (int i = 0; i < queue->active_size; i++) { + job_queue_node_type * node = queue->jobs[i]; + + if (job_queue_node_get_status(node) == JOB_QUEUE_RUNNING) { + time_t now = time(NULL); + if ( job_queue_get_max_job_duration(queue) > 0) { + double elapsed = difftime(now, node->sim_start); + if (elapsed > job_queue_get_max_job_duration(queue)) { + job_queue_change_node_status(queue, node, JOB_QUEUE_USER_EXIT); + } + } + if (job_queue_get_job_stop_time(queue) > 0) { + if (now >= job_queue_get_job_stop_time(queue)) { + job_queue_change_node_status(queue, node, JOB_QUEUE_USER_EXIT); + } + } + } + } +} + +bool job_queue_get_open(const job_queue_type * job_queue) { + return job_queue->open; +} + +void job_queue_check_open(job_queue_type* queue) { + if (!job_queue_get_open(queue)) + util_abort("%s: queue not open and not ready for use; method job_queue_reset must be called before using the queue - aborting\n", __func__ ); +} /** If the total number of jobs is not known in advance the job_queue_run_jobs @@ -1200,6 +1322,10 @@ void job_queue_run_jobs(job_queue_type * queue , int num_total_run, bool verbose util_abort("%s: another thread is already running the queue_manager\n",__func__); else { /* OK - we have got an exclusive lock to the run_jobs code. */ + + //Check if queue is open. Fails hard if not open + job_queue_check_open(queue); + const int NUM_WORKER_THREADS = 16; queue->running = true; queue->work_pool = thread_pool_alloc( NUM_WORKER_THREADS , true ); @@ -1217,6 +1343,9 @@ void job_queue_run_jobs(job_queue_type * queue , int num_total_run, bool verbose job_queue_user_exit__( queue ); local_user_exit = true; } + + job_queue_check_expired(queue); + /*****************************************************************/ { bool update_status = job_queue_update_status( queue ); @@ -1230,12 +1359,12 @@ void job_queue_run_jobs(job_queue_type * queue , int num_total_run, bool verbose { int num_complete = queue->status_list[ STATUS_INDEX(JOB_QUEUE_SUCCESS) ] + queue->status_list[ STATUS_INDEX(JOB_QUEUE_FAILED) ] + - queue->status_list[ STATUS_INDEX(JOB_QUEUE_USER_EXIT) ]; + queue->status_list[ STATUS_INDEX(JOB_QUEUE_USER_KILLED) ]; if ((num_total_run > 0) && (num_total_run == num_complete)) /* The number of jobs completed is equal to the number of jobs we have said we want to run; so we are finished. - */ + */ cont = false; else { if (num_total_run == 0) { @@ -1249,7 +1378,7 @@ void job_queue_run_jobs(job_queue_type * queue , int num_total_run, bool verbose 2. The user has used job_queue_complete_submit() to signal that no more jobs will be forthcoming. */ - if ((num_complete == queue->active_size) && queue->submit_complete) + if ((num_complete == queue->active_size) && queue->submit_complete) cont = false; } } @@ -1303,21 +1432,27 @@ void job_queue_run_jobs(job_queue_type * queue , int num_total_run, bool verbose { /* - Checking for complete / exited jobs. - */ + Checking for complete / exited / overtime jobs + */ int queue_index; for (queue_index = 0; queue_index < queue->active_size; queue_index++) { - job_queue_node_type * node = queue->jobs[queue_index]; - switch ( job_queue_node_get_status(node) ) { - case(JOB_QUEUE_DONE): - job_queue_handle_DONE( queue , node ); - break; - case(JOB_QUEUE_EXIT): - job_queue_handle_EXIT( queue , node ); - break; - default: - break; + job_queue_node_type * node = queue->jobs[queue_index]; + + switch (job_queue_node_get_status(node)) { + case(JOB_QUEUE_DONE): + job_queue_handle_DONE(queue, node); + break; + case(JOB_QUEUE_EXIT): + job_queue_handle_EXIT(queue, node); + break; + case(JOB_QUEUE_USER_EXIT): + job_queue_handle_USER_EXIT(queue, node); + break; + default: + break; } + + } } @@ -1335,7 +1470,7 @@ void job_queue_run_jobs(job_queue_type * queue , int num_total_run, bool verbose util_usleep(queue->usleep_time); } } - + } while ( cont ); queue->running = false; } @@ -1344,12 +1479,17 @@ void job_queue_run_jobs(job_queue_type * queue , int num_total_run, bool verbose thread_pool_join( queue->work_pool ); thread_pool_free( queue->work_pool ); } + /* - Observe that after the job_queue_finalize() function has been - called the queue object should not be queried on any longer; that - will silently give horribly wrong results. - */ - job_queue_finalize( queue ); + Set the queue's "open" flag to false to signal that the queue is not ready to be used in a + new job_queue_run_jobs or job_queue_add_job method call as it has not been reset yet. Not + resetting the queue here implies that the queue object is still available for queries after + this method has finished + */ + + queue->open = false; + + pthread_mutex_unlock( &queue->run_mutex ); } @@ -1366,7 +1506,6 @@ void job_queue_user_exit( job_queue_type * queue) { - void * job_queue_run_jobs__(void * __arg_pack) { arg_pack_type * arg_pack = arg_pack_safe_cast(__arg_pack); job_queue_type * queue = arg_pack_iget_ptr(arg_pack , 0); @@ -1457,6 +1596,7 @@ static int job_queue_add_job__(job_queue_type * queue , const char * run_cmd , job_callback_ftype * done_callback, job_callback_ftype * retry_callback, + job_callback_ftype * exit_callback, void * callback_arg , int num_cpu , const char * run_path , @@ -1465,6 +1605,9 @@ static int job_queue_add_job__(job_queue_type * queue , const char ** argv, bool mt) { + //Fail hard if queue is not open + job_queue_check_open(queue); + if (!queue->user_exit) {/* We do not accept new jobs if a user-shutdown has been iniated. */ int job_index; // This should be better protected lockwise @@ -1492,7 +1635,7 @@ static int job_queue_add_job__(job_queue_type * queue , } pthread_mutex_unlock( &queue->queue_mutex ); - job_queue_initialize_node(queue , run_cmd , done_callback , retry_callback , callback_arg , num_cpu , run_path , job_name , job_index , argc , argv); + job_queue_initialize_node(queue , run_cmd , done_callback , retry_callback , exit_callback, callback_arg , num_cpu , run_path , job_name , job_index , argc , argv); return job_index; /* Handle used by the calling scope. */ } else return -1; @@ -1506,14 +1649,15 @@ static int job_queue_add_job__(job_queue_type * queue , int job_queue_add_job_mt(job_queue_type * queue , const char * run_cmd , job_callback_ftype * done_callback, - job_callback_ftype * retry_callback, + job_callback_ftype * retry_callback, + job_callback_ftype * exit_callback, void * callback_arg , int num_cpu , const char * run_path , const char * job_name , int argc , const char ** argv) { - return job_queue_add_job__(queue , run_cmd , done_callback, retry_callback , callback_arg , num_cpu , run_path , job_name , argc , argv , true); + return job_queue_add_job__(queue , run_cmd , done_callback, retry_callback, exit_callback , callback_arg , num_cpu , run_path , job_name , argc , argv , true); } @@ -1525,14 +1669,15 @@ int job_queue_add_job_mt(job_queue_type * queue , int job_queue_add_job_st(job_queue_type * queue , const char * run_cmd , job_callback_ftype * done_callback, - job_callback_ftype * retry_callback, + job_callback_ftype * retry_callback, + job_callback_ftype * exit_callback, void * callback_arg , int num_cpu , const char * run_path , const char * job_name , int argc , const char ** argv) { - return job_queue_add_job__(queue , run_cmd , done_callback , retry_callback , callback_arg , num_cpu , run_path , job_name , argc , argv , false); + return job_queue_add_job__(queue , run_cmd , done_callback , retry_callback, exit_callback , callback_arg , num_cpu , run_path , job_name , argc , argv , false); } @@ -1571,7 +1716,6 @@ bool job_queue_has_driver(const job_queue_type * queue ) { } - job_driver_type job_queue_lookup_driver_name( const char * driver_name ) { if (strcmp( driver_name , "LOCAL") == 0) return LOCAL_DRIVER; @@ -1604,12 +1748,14 @@ static void job_queue_grow( job_queue_type * queue ) { int alloc_size = util_int_max( 2 * queue->alloc_size , JOB_QUEUE_START_SIZE ); job_queue_node_type ** new_jobs = util_calloc(alloc_size , sizeof * queue->jobs ); job_queue_node_type ** old_jobs = queue->jobs; - if (old_jobs != NULL) + if (old_jobs != NULL) memcpy( new_jobs , queue->jobs , queue->alloc_size * sizeof * queue->jobs ); + + { int i; /* Creating the new nodes. */ - for (i = queue->alloc_size; i < alloc_size; i++) + for (i = queue->alloc_size; i < alloc_size; i++) new_jobs[i] = job_queue_node_alloc(); /* Assigning the job pointer to the new array. */ @@ -1643,11 +1789,14 @@ job_queue_type * job_queue_alloc(int max_submit , job_queue_type * queue = util_malloc(sizeof * queue ); queue->jobs = NULL; queue->usleep_time = 250000; /* 1000000 : 1 second */ - queue->max_ok_wait_time = 60; + queue->max_ok_wait_time = 60; + queue->max_duration = 0; + queue->stop_time = 0; queue->max_submit = max_submit; queue->driver = NULL; queue->ok_file = util_alloc_string_copy( ok_file ); queue->exit_file = util_alloc_string_copy( exit_file ); + queue->open = true; queue->user_exit = false; queue->pause_on = false; queue->running = false; @@ -1664,8 +1813,6 @@ job_queue_type * job_queue_alloc(int max_submit , pthread_mutex_init( &queue->queue_mutex , NULL); pthread_mutex_init( &queue->run_mutex , NULL ); - - return queue; } @@ -1708,8 +1855,9 @@ void job_queue_free(job_queue_type * queue) { util_safe_free( queue->exit_file ); { int i; - for (i=0; i < queue->active_size; i++) + for (i=0; i < queue->alloc_size; i++) job_queue_node_free(queue->jobs[i]); + free(queue->jobs); } free(queue); diff --git a/ThirdParty/Ert/devel/libjob_queue/src/local_driver.c b/ThirdParty/Ert/devel/libjob_queue/src/local_driver.c index 2d57a2c914..877fed7d5f 100644 --- a/ThirdParty/Ert/devel/libjob_queue/src/local_driver.c +++ b/ThirdParty/Ert/devel/libjob_queue/src/local_driver.c @@ -104,17 +104,12 @@ void local_driver_free_job( void * __job ) { void local_driver_kill_job( void * __driver , void * __job) { local_job_type * job = local_job_safe_cast( __job ); - kill( job->child_process , SIGSTOP ); - if (job->active) - pthread_cancel( job->run_thread ); + if (job->active) { + pthread_cancel( job->run_thread ); + } -} - - - - - - + kill( job->child_process , SIGTERM ); + } void * submit_job_thread__(void * __arg) { @@ -129,12 +124,13 @@ void * submit_job_thread__(void * __arg) { int argc = arg_pack_iget_int(arg_pack , 2); char ** argv = arg_pack_iget_ptr(arg_pack , 3); local_job_type * job = arg_pack_iget_ptr(arg_pack , 4); + arg_pack_free(arg_pack); job->child_process = util_fork_exec(executable , argc , (const char **) argv , false , NULL , NULL /* run_path */ , NULL , NULL , NULL); + util_free_stringlist( argv , argc ); waitpid(job->child_process , NULL , 0); job->status = JOB_QUEUE_DONE; pthread_exit(NULL); - util_free_stringlist( argv , argc ); return NULL; } diff --git a/ThirdParty/Ert/devel/libjob_queue/src/lsb.c b/ThirdParty/Ert/devel/libjob_queue/src/lsb.c index 6702eeaa3e..f09e24e91e 100644 --- a/ThirdParty/Ert/devel/libjob_queue/src/lsb.c +++ b/ThirdParty/Ert/devel/libjob_queue/src/lsb.c @@ -154,6 +154,7 @@ int lsb_initialize( const lsb_type * lsb) { thing will crash and burn if this is not properly set. */ if ( lsb->lsb_init(NULL) != 0 ) { + fprintf(stderr,"LSF_ENVDIR: "); if (getenv("LSF_ENVDIR") != NULL) fprintf(stderr,"%s\n", getenv("LSF_ENVDIR")); diff --git a/ThirdParty/Ert/devel/libjob_queue/src/lsf_driver.c b/ThirdParty/Ert/devel/libjob_queue/src/lsf_driver.c index 36265836e6..31ed9a3b1b 100644 --- a/ThirdParty/Ert/devel/libjob_queue/src/lsf_driver.c +++ b/ThirdParty/Ert/devel/libjob_queue/src/lsf_driver.c @@ -28,8 +28,8 @@ #include #include +#include -#include #ifdef HAVE_LSF_LIBRARY #include #endif @@ -383,6 +383,7 @@ static int lsf_driver_submit_internal_job( lsf_driver_type * driver , } #else lsf_driver_internal_error( driver ); + return -1; #endif } @@ -762,6 +763,7 @@ static void lsf_driver_set_bkill_cmd( lsf_driver_type * driver , const char * bk driver->bkill_cmd = util_realloc_string_copy( driver->bkill_cmd , bkill_cmd ); } +#ifdef HAVE_LSF_LIBRARY static void lsf_driver_set_internal_submit( lsf_driver_type * driver) { /* No remote server has been set - assuming we can issue proper library calls. */ /* The BSUB_QUEUE variable must NOT be set when using the shell @@ -772,7 +774,7 @@ static void lsf_driver_set_internal_submit( lsf_driver_type * driver) { util_safe_free( driver->remote_lsf_server ); driver->remote_lsf_server = NULL; } - +#endif static void lsf_driver_set_remote_server( lsf_driver_type * driver , const char * remote_server) { if (remote_server == NULL) { diff --git a/ThirdParty/Ert/devel/libjob_queue/src/queue_driver.c b/ThirdParty/Ert/devel/libjob_queue/src/queue_driver.c index be68d3f475..3778d1c278 100644 --- a/ThirdParty/Ert/devel/libjob_queue/src/queue_driver.c +++ b/ThirdParty/Ert/devel/libjob_queue/src/queue_driver.c @@ -85,6 +85,78 @@ struct queue_driver_struct { }; + + +/*****************************************************************/ + + +/*****************************************************************/ + +void queue_driver_set_max_running(queue_driver_type * driver, int max_running) { + driver->max_running_string = util_realloc_sprintf(driver->max_running_string,"%d", max_running); + driver->max_running = max_running; +} + +int queue_driver_get_max_running(const queue_driver_type * driver) { + return driver->max_running; +} + +const char * queue_driver_get_name(const queue_driver_type * driver) { + return driver->name; +} + + +static bool queue_driver_set_generic_option__(queue_driver_type * driver, const char * option_key, const void * value) { + bool option_set = true; + { + if (strcmp(MAX_RUNNING, option_key) == 0) { + int max_running_int = 0; + if (util_sscanf_int(value, &max_running_int)) { + queue_driver_set_max_running(driver, max_running_int); + option_set = true; + } + else + option_set = false; + } else + option_set = false; + } + return option_set; +} + +static void * queue_driver_get_generic_option__(queue_driver_type * driver, const char * option_key) { + if (strcmp(MAX_RUNNING, option_key) == 0) { + return driver->max_running_string; + } else { + util_abort("%s: driver:%s does not support generic option %s\n", __func__, driver->name, option_key); + return NULL; + } +} + +static bool queue_driver_has_generic_option__(queue_driver_type * driver, const char * option_key) { + if (strcmp(MAX_RUNNING, option_key) == 0) + return true; + else + return false; +} + +/** + Set option - can also be used to perform actions - not only setting + of parameters. There is no limit :-) + */ +bool queue_driver_set_option(queue_driver_type * driver, const char * option_key, const void * value) { + if (queue_driver_set_generic_option__(driver, option_key, value)) { + return true; + } else if (driver->set_option != NULL) + /* The actual low level set functions can not fail! */ + return driver->set_option(driver->data, option_key, value); + else { + util_abort("%s: driver:%s does not support run time setting of options\n", __func__, driver->name); + return false; + } + return false; +} + + /** Observe that after the driver instance has been allocated it does NOT support modification of the common fields, only the data owned @@ -98,7 +170,6 @@ struct queue_driver_struct { static queue_driver_type * queue_driver_alloc_empty() { queue_driver_type * driver = util_malloc(sizeof * driver); UTIL_TYPE_ID_INIT(driver, QUEUE_DRIVER_ID); - driver->max_running = 0; driver->driver_type = NULL_DRIVER; driver->submit = NULL; driver->get_status = NULL; @@ -113,6 +184,8 @@ static queue_driver_type * queue_driver_alloc_empty() { driver->max_running_string = NULL; driver->init_options = NULL; + queue_driver_set_generic_option__(driver, MAX_RUNNING, "0"); + return driver; } @@ -181,80 +254,11 @@ queue_driver_type * queue_driver_alloc(job_driver_type type) { default: util_abort("%s: unrecognized driver type:%d \n", __func__, type); } + + queue_driver_set_generic_option__(driver, MAX_RUNNING, "0"); return driver; } -/*****************************************************************/ - - -/*****************************************************************/ - -void queue_driver_set_max_running(queue_driver_type * driver, int max_running) { - driver->max_running_string = util_realloc_sprintf(driver->max_running_string,"%d", max_running); - driver->max_running = max_running; -} - -int queue_driver_get_max_running(const queue_driver_type * driver) { - return driver->max_running; -} - -const char * queue_driver_get_name(const queue_driver_type * driver) { - return driver->name; -} - - -/*****************************************************************/ - - -static bool queue_driver_set_generic_option__(queue_driver_type * driver, const char * option_key, const void * value) { - bool option_set = true; - { - if (strcmp(MAX_RUNNING, option_key) == 0) { - int max_running_int = 0; - if (util_sscanf_int(value, &max_running_int)) { - queue_driver_set_max_running(driver, max_running_int); - option_set = true; - } - else - option_set = false; - } else - option_set = false; - } - return option_set; -} - -static void * queue_driver_get_generic_option__(queue_driver_type * driver, const char * option_key) { - if (strcmp(MAX_RUNNING, option_key) == 0) { - return driver->max_running_string; - } else { - util_abort("%s: driver:%s does not support generic option %s\n", __func__, driver->name, option_key); - return NULL; - } -} - -static bool queue_driver_has_generic_option__(queue_driver_type * driver, const char * option_key) { - if (strcmp(MAX_RUNNING, option_key) == 0) - return true; - else - return false; -} - -/** - Set option - can also be used to perform actions - not only setting - of parameters. There is no limit :-) - */ -bool queue_driver_set_option(queue_driver_type * driver, const char * option_key, const void * value) { - if (queue_driver_set_generic_option__(driver, option_key, value)) { - return true; - } else if (driver->set_option != NULL) - /* The actual low level set functions can not fail! */ - return driver->set_option(driver->data, option_key, value); - else { - util_abort("%s: driver:%s does not support run time setting of options\n", __func__, driver->name); - return false; - } - return false; -} /*****************************************************************/ @@ -375,7 +379,7 @@ const char * queue_driver_type_enum_iget(int index, int * value) { }, value); } -const char * queue_driver_status_emun_iget(int index, int * value) { +const char * queue_driver_status_enum_iget(int index, int * value) { return util_enum_iget(index, JOB_STATUS_ENUM_SIZE, (const util_enum_element_type []) { JOB_STATUS_ENUM_DEFS diff --git a/ThirdParty/Ert/devel/libjob_queue/tests/CMakeLists.txt b/ThirdParty/Ert/devel/libjob_queue/tests/CMakeLists.txt index 7612e1aec7..67c7d57e58 100644 --- a/ThirdParty/Ert/devel/libjob_queue/tests/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libjob_queue/tests/CMakeLists.txt @@ -21,9 +21,16 @@ add_test( job_loadFail2 ${EXECUTABLE_OUTPUT_PATH}/job_loadFail ${CMAKE_CURRENT_S add_test( job_loadFail3 ${EXECUTABLE_OUTPUT_PATH}/job_loadFail ${CMAKE_CURRENT_SOURCE_DIR}/data/internalFail ${CMAKE_CURRENT_SOURCE_DIR}/data/externalFail) -add_executable( job_queue_test job_queue_test.c ) +add_executable( job_program_output job_program_output.c ) +target_link_libraries( job_program_output util test_util) + +add_executable( job_queue_test job_job_queue_test.c ) target_link_libraries( job_queue_test job_queue test_util ) -add_test( job_queue_test ${EXECUTABLE_OUTPUT_PATH}/job_queue_test ) +add_test( job_queue_test ${EXECUTABLE_OUTPUT_PATH}/job_queue_test ${EXECUTABLE_OUTPUT_PATH}/job_program_output ) + +add_executable( job_queue_driver_test job_queue_driver_test.c ) +target_link_libraries( job_queue_driver_test job_queue test_util ) +add_test( job_queue_driver_test ${EXECUTABLE_OUTPUT_PATH}/job_queue_driver_test ) # This should be a space separated list of servers which will be @@ -35,14 +42,13 @@ add_test( job_queue_test ${EXECUTABLE_OUTPUT_PATH}/job_queue_test ) # set(LSF_SERVERS "LOCAL" CACHE STRING "List of LSF servers for testing") +if (HAVE_LSF_LIBRARY) + add_executable( job_lsf_test job_lsf_test.c ) + target_link_libraries( job_lsf_test job_queue util test_util ) + add_test( job_lsf_test ${EXECUTABLE_OUTPUT_PATH}/job_lsf_test ) +endif() -add_executable( job_lsf_test job_lsf_test.c ) -target_link_libraries( job_lsf_test job_queue util test_util ) -add_executable( job_lsf_submit_test job_lsf_submit_test.c ) -target_link_libraries( job_lsf_submit_test job_queue util test_util ) - -add_executable( job_program job_program.c ) if (HAVE_LSF_LIBRARY) add_executable( job_lsb job_lsb.c ) @@ -50,8 +56,10 @@ if (HAVE_LSF_LIBRARY) add_test( job_lsb ${EXECUTABLE_OUTPUT_PATH}/job_lsb ) endif() +add_executable( job_lsf_submit_test job_lsf_submit_test.c ) +target_link_libraries( job_lsf_submit_test job_queue util test_util ) +add_executable( job_program job_program.c ) -add_test( job_lsf_test ${EXECUTABLE_OUTPUT_PATH}/job_lsf_test ) if (LSF_SERVERS) add_test( job_lsf_submit_test ${EXECUTABLE_OUTPUT_PATH}/job_lsf_submit_test ${EXECUTABLE_OUTPUT_PATH}/job_program ${LSF_SERVERS}) set_property( TEST job_lsf_submit_test PROPERTY LABELS LSF) diff --git a/ThirdParty/Ert/devel/libjob_queue/tests/job_job_queue_test.c b/ThirdParty/Ert/devel/libjob_queue/tests/job_job_queue_test.c new file mode 100644 index 0000000000..3ed40d626f --- /dev/null +++ b/ThirdParty/Ert/devel/libjob_queue/tests/job_job_queue_test.c @@ -0,0 +1,474 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'job_queue_test.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. + */ +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +void submit_jobs_to_queue(job_queue_type * queue, test_work_area_type * work_area, char * executable_to_run, int number_of_jobs, int number_of_slowjobs, char* sleep_short, char* sleep_long, bool multithreaded) { + int submitted_slowjobs = 0; + for (int i = 0; i < number_of_jobs; i++) { + char * runpath = util_alloc_sprintf("%s/%s_%d", test_work_area_get_cwd(work_area), "job", i); + util_make_path(runpath); + + char * sleeptime = sleep_short; + if (submitted_slowjobs < number_of_slowjobs) { + sleeptime = sleep_long; + submitted_slowjobs++; + } + + if (multithreaded) { + + job_queue_add_job_mt(queue, executable_to_run, NULL, NULL, NULL, NULL, 1, runpath, "Testjob", 2, (const char *[2]) { + runpath, sleeptime + }); + } else { + + job_queue_add_job_st(queue, executable_to_run, NULL, NULL, NULL, NULL, 1, runpath, "Testjob", 2, (const char *[2]) { + runpath, sleeptime + }); + } + free(runpath); + } +} + +void monitor_job_queue(job_queue_type * queue, int max_job_duration, time_t stop_time, int min_realizations) { + bool cont = true; + + if (0 >= min_realizations) + cont = false; + + while (cont) { + //Check if minimum number of realizations have run, and if so, kill the rest after a certain time + if ((job_queue_get_num_complete(queue) >= min_realizations)) { + job_queue_set_max_job_duration(queue, max_job_duration); + + job_queue_set_job_stop_time(queue, stop_time); + + cont = false; + } + + if (cont) { + util_usleep(100); + } + } +} + +void run_jobs_with_time_limit_test(char * executable_to_run, int number_of_jobs, int number_of_slowjobs, char * sleep_short, char * sleep_long, int max_sleep) { + test_work_area_type * work_area = test_work_area_alloc("job_queue"); + job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "ERROR"); + + queue_driver_type * driver = queue_driver_alloc_local(); + job_queue_set_driver(queue, driver); + job_queue_set_max_job_duration(queue, max_sleep); + + submit_jobs_to_queue(queue, work_area, executable_to_run, number_of_jobs, number_of_slowjobs, sleep_short, sleep_long, false); + + job_queue_run_jobs(queue, number_of_jobs, true); + + test_assert_int_equal(number_of_jobs - number_of_slowjobs, job_queue_get_num_complete(queue)); + test_assert_int_equal(number_of_slowjobs, job_queue_get_num_killed(queue)); + + test_assert_bool_equal(false, job_queue_get_open(queue)); + job_queue_reset(queue); + test_assert_bool_equal(true, job_queue_get_open(queue)); + + test_assert_int_equal(0, job_queue_get_num_complete(queue)); + + job_queue_free(queue); + queue_driver_free(driver); + test_work_area_free(work_area); +} + + +void run_and_monitor_jobs(char * executable_to_run, int max_job_duration, time_t stop_time, int min_realizations, int num_completed, int interval_between_jobs) { + int number_of_jobs = 10; + test_work_area_type * work_area = test_work_area_alloc("job_queue"); + job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "ERROR"); + queue_driver_type * driver = queue_driver_alloc_local(); + job_queue_set_driver(queue, driver); + + arg_pack_type * arg_pack = arg_pack_alloc(); + arg_pack_append_ptr(arg_pack, queue); + arg_pack_append_int(arg_pack, 0); + arg_pack_append_bool(arg_pack, true); + + thread_pool_type * pool = thread_pool_alloc(1, true); + thread_pool_add_job(pool, job_queue_run_jobs__, arg_pack); + + int job_run_time = 0; + + for (int i = 0; i < number_of_jobs; i++) { + char * runpath = util_alloc_sprintf("%s/%s_%d", test_work_area_get_cwd(work_area), "job", i); + util_make_path(runpath); + + char * sleeptime = util_alloc_sprintf("%d", job_run_time); + + job_queue_add_job_mt(queue, executable_to_run, NULL, NULL, NULL, NULL, 1, runpath, "Testjob", 2, (const char *[2]) { + runpath, sleeptime + }); + job_run_time += interval_between_jobs; + + free(sleeptime); + free(runpath); + } + + job_queue_submit_complete(queue); + + monitor_job_queue(queue, max_job_duration, stop_time, min_realizations); + + thread_pool_join(pool); + thread_pool_free(pool); + + + test_assert_int_equal(num_completed, job_queue_get_num_complete(queue)); + test_assert_int_equal(number_of_jobs - num_completed, job_queue_get_num_killed(queue)); + test_assert_bool_equal(false, job_queue_get_open(queue)); + job_queue_reset(queue); + test_assert_bool_equal(true, job_queue_get_open(queue)); + test_assert_int_equal(0, job_queue_get_num_complete(queue)); + + job_queue_free(queue); + queue_driver_free(driver); + test_work_area_free(work_area); +} + +void run_jobs_time_limit_multithreaded(char * executable_to_run, int number_of_jobs, int number_of_slowjobs, char * sleep_short, char * sleep_long, int max_sleep) { + test_work_area_type * work_area = test_work_area_alloc("job_queue"); + + + job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "ERROR"); + queue_driver_type * driver = queue_driver_alloc_local(); + job_queue_set_driver(queue, driver); + job_queue_set_max_job_duration(queue, max_sleep); + + arg_pack_type * arg_pack = arg_pack_alloc(); + arg_pack_append_ptr(arg_pack, queue); + arg_pack_append_int(arg_pack, 0); + arg_pack_append_bool(arg_pack, true); + + thread_pool_type * pool = thread_pool_alloc(1, true); + thread_pool_add_job(pool, job_queue_run_jobs__, arg_pack); + + submit_jobs_to_queue(queue, work_area, executable_to_run, number_of_jobs, number_of_slowjobs, sleep_short, sleep_long, true); + + job_queue_submit_complete(queue); + thread_pool_join(pool); + thread_pool_free(pool); + + test_assert_int_equal(number_of_jobs - number_of_slowjobs, job_queue_get_num_complete(queue)); + test_assert_int_equal(number_of_slowjobs, job_queue_get_num_killed(queue)); + test_assert_bool_equal(false, job_queue_get_open(queue)); + job_queue_reset(queue); + test_assert_bool_equal(true, job_queue_get_open(queue)); + test_assert_int_equal(0, job_queue_get_num_complete(queue)); + + job_queue_free(queue); + queue_driver_free(driver); + test_work_area_free(work_area); +} + +void JobQueueRunJobs_ReuseQueue_AllOk(char ** argv) { + printf("Running JobQueueRunJobs_ReuseQueue_AllOk\n"); + + int number_of_jobs = 20; + int number_of_queue_reuse = 10; + + test_work_area_type * work_area = test_work_area_alloc("job_queue"); + + job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "ERROR"); + queue_driver_type * driver = queue_driver_alloc_local(); + job_queue_set_driver(queue, driver); + + for (int j = 0; j < number_of_queue_reuse; j++) { + submit_jobs_to_queue(queue, work_area, argv[1], number_of_jobs, 0, "0", "0", false); + + job_queue_run_jobs(queue, number_of_jobs, true); + + test_assert_int_equal(number_of_jobs, job_queue_get_num_complete(queue)); + test_assert_bool_equal(false, job_queue_get_open(queue)); + job_queue_reset(queue); + test_assert_bool_equal(true, job_queue_get_open(queue)); + test_assert_int_equal(0, job_queue_get_num_complete(queue)); + } + job_queue_free(queue); + queue_driver_free(driver); + test_work_area_free(work_area); + +} + +void JobQueueSetStopTime_StopTimeEarly_MinRealisationsAreRun(char ** argv) { + printf("Running JobQueueSetStopTime_StopTimeEarly_MinRealisationsAreRun\n"); + + //Use stop_time to to stop jobs after min_realizations are finished + int min_realizations = 5; + int num_expected_completed = 5; + int max_duration_time = 0; + int interval_between_jobs = 2; + time_t currenttime; + time(¤ttime); + time_t stoptime = currenttime; + run_and_monitor_jobs(argv[1], max_duration_time, stoptime, min_realizations, num_expected_completed, interval_between_jobs); + +} + +void JobQueueSetStopTime_StopTimeLate_AllRealisationsAreRun(char ** argv) { + printf("Running JobQueueSetStopTime_StopTimeLate_AllRealisationsAreRun\n"); + + //Use stop_time to to stop jobs after min_realizations are finished + int min_realizations = 5; + int num_expected_completed = 10; + int max_duration_time = 0; + int interval_between_jobs = 0; + time_t currenttime; + time(¤ttime); + time_t stoptime = currenttime + 15; + run_and_monitor_jobs(argv[1], max_duration_time, stoptime, min_realizations, num_expected_completed, interval_between_jobs); +} + +void JobQueueSetStopTime_StopTimeMedium_MoreThanMinRealisationsAreRun(char ** argv) { + printf("Running JobQueueSetStopTime_StopTimeMedium_MoreThanMinRealisationsAreRun\n"); + + //Use stop_time to to stop jobs after min_realizations are finished + int min_realizations = 1; + int num_expected_completed = 2; + int max_duration_time = 0; + int interval_between_jobs = 3; + time_t currenttime; + time(¤ttime); + time_t stoptime = currenttime + 5; + run_and_monitor_jobs(argv[1], max_duration_time, stoptime, min_realizations, num_expected_completed, interval_between_jobs); + +} + +void JobQueueSetStopTimeAndMaxDuration_MaxDurationShort_StopTimeLate_MinRealisationsAreRun(char ** argv) { + printf("Running JobQueueSetStopTimeAndMaxDuration_MaxDurationShort_StopTimeLong_MinRealisationsAreRun\n"); + + int min_realizations = 1; + int num_expected_completed = 1; + int max_duration_time = 1; + int interval_between_jobs = 2; + time_t currenttime; + time(¤ttime); + time_t stoptime = currenttime + 10; + run_and_monitor_jobs(argv[1], max_duration_time, stoptime, min_realizations, num_expected_completed, interval_between_jobs); + +} + +void JobQueueSetStopTimeAndMaxDuration_MaxDurationLong_StopTimeEarly_MinRealisationsAreRun(char ** argv) { + printf("Running JobQueueSetStopTimeAndMaxDuration_MaxDurationLong_StopTimeEarly_MinRealisationsAreRun\n"); + + int min_realizations = 1; + int num_expected_completed = 1; + int max_duration_time = 10; + int interval_between_jobs = 2; + time_t currenttime; + time(¤ttime); + time_t stoptime = currenttime + 1; + run_and_monitor_jobs(argv[1], max_duration_time, stoptime, min_realizations, num_expected_completed, interval_between_jobs); +} + +void JobQueueSetMaxDurationAfterMinRealizations_MaxDurationShort_OnlyMinRealizationsAreRun(char ** argv) { + printf("Running JobQueueSetMaxDurationAfterMinRealizations_MaxDurationShort_OnlyMinRealizationsAreRun\n"); + + // Must have one job completed, the rest are then killed due to the max_duration_time gets exceeded. + int min_realizations = 1; + int num_expected_completed = 1; + int max_duration_time = 1; + int interval_between_jobs = 2; + time_t currenttime = 0; + + run_and_monitor_jobs(argv[1], max_duration_time, currenttime, min_realizations, num_expected_completed, interval_between_jobs); +} + +void JobQueueSetMaxDurationAfterMinRealizations_MaxDurationLooong_AllRealizationsAreRun(char ** argv) { + printf("Running JobQueueSetMaxDurationAfterMinRealizations_MaxDurationLooong_AllRealizationsAreRun\n"); + + // Min realizations is 1, but the max running time exceeds the time used by any of the jobs, so all run to completion + int min_realizations = 1; + int num_expected_completed = 10; + int max_duration_time = 12; + int interval_between_jobs = 1; + time_t currenttime = 0; + run_and_monitor_jobs(argv[1], max_duration_time, currenttime, min_realizations, num_expected_completed, interval_between_jobs); +} + +void JobQueueSetMaxDurationAfterMinRealizations_MaxDurationSemiLong_MoreThanMinRealizationsAreRun(char ** argv) { + printf("Running JobQueueSetMaxDurationAfterMinRealizations_MaxDurationSemiLong_MoreThanMinRealizationsAreRun\n"); + + // Min is 3, but max_duration_time allows for one more to be completed + int min_realizations = 3; + int num_expected_completed = 4; + int max_duration_time = 7; + int interval_between_jobs = 2; + time_t currenttime = 0; + run_and_monitor_jobs(argv[1], max_duration_time, currenttime, min_realizations, num_expected_completed, interval_between_jobs); +} + +void JobQueueSetMaxDurationAfterMinRealizations_MaxDurationShortButMinRealizationsIsAll_AllRealizationsAreRun(char ** argv) { + printf("Running JobQueueSetMaxDurationAfterMinRealizations_MaxDurationShortButMinRealizationsIsAll_AllRealizationsAreRun\n"); + + // Min is 10, so all run to completion + int min_realizations = 10; + int num_expected_completed = 10; + int max_duration_time = 1; + int interval_between_jobs = 0; + time_t currenttime = 0; + run_and_monitor_jobs(argv[1], max_duration_time, currenttime, min_realizations, num_expected_completed, interval_between_jobs); +} + +void JobQueueSetMaxDuration_DurationZero_AllRealisationsAreRun(char ** argv) { + printf("Running JobQueueSetMaxDuration_DurationZero_AllRealisationsAreRun\n"); + run_jobs_with_time_limit_test(argv[1], 10, 0, "1", "100", 0); // 0 as limit means no limit*/ +} + +void JobQueueSetMaxDuration_Duration5Seconds_KillsAllJobsWithDurationMoreThan5Seconds(char ** argv) { + printf("Running JobQueueSetMaxDuration_Duration5Seconds_KillsAllJobsWithDurationMoreThan5Seconds\n"); + run_jobs_with_time_limit_test(argv[1], 100, 23, "1", "100", 5); +} + +void JobQueueSetMaxDurationRunJobsLoopInThread_Duration5Seconds_KillsAllJobsWithDurationMoreThan5Seconds(char ** argv) { + printf("Running JobQueueSetMaxDurationRunJobsLoopInThread_Duration5Seconds_KillsAllJobsWithDurationMoreThan5Seconds\n"); + run_jobs_time_limit_multithreaded(argv[1], 100, 23, "1", "100", 5); +} + +void JobQueueSetAutoStopTime_ThreeQuickJobs_AutoStopTimeKillsTheRest(char ** argv) { + printf("Running JobQueueSetMaxDurationRunJobsLoopInThread_Duration5Seconds_KillsAllJobsWithDurationMoreThan5Seconds\n"); + + int number_of_jobs = 10; + + test_work_area_type * work_area = test_work_area_alloc("job_queue"); + job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "ERROR"); + queue_driver_type * driver = queue_driver_alloc_local(); + job_queue_set_driver(queue, driver); + + arg_pack_type * arg_pack = arg_pack_alloc(); + arg_pack_append_ptr(arg_pack, queue); + arg_pack_append_int(arg_pack, 0); + arg_pack_append_bool(arg_pack, true); + + thread_pool_type * pool = thread_pool_alloc(1, true); + thread_pool_add_job(pool, job_queue_run_jobs__, arg_pack); + + int number_of_slowjobs = 3; + char * sleep_short = "0"; + char * sleep_long = "100"; + + submit_jobs_to_queue(queue, work_area, argv[1], number_of_jobs, number_of_slowjobs, sleep_short, sleep_long, false); + + util_usleep(1000000); + job_queue_submit_complete(queue); + job_queue_set_auto_job_stop_time(queue); + thread_pool_join(pool); + + test_assert_int_equal(number_of_jobs - number_of_slowjobs, job_queue_get_num_complete(queue)); + test_assert_int_equal(number_of_slowjobs, job_queue_get_num_killed(queue)); + + test_assert_bool_equal(false, job_queue_get_open(queue)); + job_queue_reset(queue); + test_assert_bool_equal(true, job_queue_get_open(queue)); + + test_assert_int_equal(0, job_queue_get_num_complete(queue)); + + thread_pool_free(pool); + job_queue_free(queue); + queue_driver_free(driver); + test_work_area_free(work_area); +} + +void JobQueueSetAutoStopTime_NoJobsAreFinished_AutoStopDoesNothing(char ** argv) { + printf("Running JobQueueSetAutoStopTime_NoJobsAreFinished_AutoStopDoesNothing\n"); + + int number_of_jobs = 10; + + test_work_area_type * work_area = test_work_area_alloc("job_queue"); + job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "ERROR"); + queue_driver_type * driver = queue_driver_alloc_local(); + job_queue_set_driver(queue, driver); + + char * sleep_long = "100"; + + submit_jobs_to_queue(queue, work_area, argv[1], number_of_jobs, number_of_jobs, "0", sleep_long, false); + + job_queue_set_auto_job_stop_time(queue); + + test_assert_int_equal(0, job_queue_get_num_complete(queue)); + test_assert_bool_equal(true, job_queue_get_open(queue)); + + job_queue_free(queue); + queue_driver_free(driver); + test_work_area_free(work_area); +} + +void JobQueueSetAutoStopTime_AllJobsAreFinished_AutoStopDoesNothing(char ** argv) { + printf("Running JobQueueSetAutoStopTime_AllJobsAreFinished_AutoStopDoesNothing\n"); + + int number_of_jobs = 10; + test_work_area_type * work_area = test_work_area_alloc("job_queue"); + job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "ERROR"); + + queue_driver_type * driver = queue_driver_alloc_local(); + job_queue_set_driver(queue, driver); + + submit_jobs_to_queue(queue, work_area, argv[1], number_of_jobs, 0, "0", "0", false); + + job_queue_run_jobs(queue, number_of_jobs, true); + + test_assert_int_equal(number_of_jobs, job_queue_get_num_complete(queue)); + test_assert_bool_equal(false, job_queue_get_open(queue)); + job_queue_reset(queue); + test_assert_bool_equal(true, job_queue_get_open(queue)); + test_assert_int_equal(0, job_queue_get_num_complete(queue)); + job_queue_free(queue); + queue_driver_free(driver); + test_work_area_free(work_area); +} + +int main(int argc, char ** argv) { + JobQueueRunJobs_ReuseQueue_AllOk(argv); + + JobQueueSetMaxDuration_DurationZero_AllRealisationsAreRun(argv); + JobQueueSetMaxDuration_Duration5Seconds_KillsAllJobsWithDurationMoreThan5Seconds(argv); + JobQueueSetMaxDurationRunJobsLoopInThread_Duration5Seconds_KillsAllJobsWithDurationMoreThan5Seconds(argv); + + JobQueueSetMaxDurationAfterMinRealizations_MaxDurationShort_OnlyMinRealizationsAreRun(argv); + JobQueueSetMaxDurationAfterMinRealizations_MaxDurationLooong_AllRealizationsAreRun(argv); + JobQueueSetMaxDurationAfterMinRealizations_MaxDurationSemiLong_MoreThanMinRealizationsAreRun(argv); + JobQueueSetMaxDurationAfterMinRealizations_MaxDurationShortButMinRealizationsIsAll_AllRealizationsAreRun(argv); + + JobQueueSetStopTime_StopTimeEarly_MinRealisationsAreRun(argv); + JobQueueSetStopTime_StopTimeLate_AllRealisationsAreRun(argv); + JobQueueSetStopTime_StopTimeMedium_MoreThanMinRealisationsAreRun(argv); + + JobQueueSetStopTimeAndMaxDuration_MaxDurationShort_StopTimeLate_MinRealisationsAreRun(argv); + JobQueueSetStopTimeAndMaxDuration_MaxDurationLong_StopTimeEarly_MinRealisationsAreRun(argv); + + JobQueueSetAutoStopTime_ThreeQuickJobs_AutoStopTimeKillsTheRest(argv); + JobQueueSetAutoStopTime_NoJobsAreFinished_AutoStopDoesNothing(argv); + JobQueueSetAutoStopTime_AllJobsAreFinished_AutoStopDoesNothing(argv); + + exit(0); +} diff --git a/ThirdParty/Ert/devel/libjob_queue/tests/job_lsf_submit_test.c b/ThirdParty/Ert/devel/libjob_queue/tests/job_lsf_submit_test.c index f93160388a..461a9171c2 100644 --- a/ThirdParty/Ert/devel/libjob_queue/tests/job_lsf_submit_test.c +++ b/ThirdParty/Ert/devel/libjob_queue/tests/job_lsf_submit_test.c @@ -17,14 +17,13 @@ */ #include #include - -#include +#include #include #include #include - +#include void test_submit(lsf_driver_type * driver , const char * server , const char * bsub_cmd , const char * bjobs_cmd , const char * bkill_cmd , const char * cmd) { diff --git a/ThirdParty/Ert/devel/libjob_queue/tests/job_lsf_test.c b/ThirdParty/Ert/devel/libjob_queue/tests/job_lsf_test.c index 3972d671b1..a4a22b9d99 100644 --- a/ThirdParty/Ert/devel/libjob_queue/tests/job_lsf_test.c +++ b/ThirdParty/Ert/devel/libjob_queue/tests/job_lsf_test.c @@ -18,10 +18,9 @@ #include #include -#include - #include +#include #include #include diff --git a/ThirdParty/Ert/devel/libjob_queue/tests/job_program_output.c b/ThirdParty/Ert/devel/libjob_queue/tests/job_program_output.c new file mode 100644 index 0000000000..28cc0ce62a --- /dev/null +++ b/ThirdParty/Ert/devel/libjob_queue/tests/job_program_output.c @@ -0,0 +1,35 @@ +/* + Copyright (C) 2012 Statoil ASA, Norway. + + The file 'job_program.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ +#include +#include +#include +int main( int argc , char ** argv) { + int sleep_time; + util_sscanf_int(argv[2], &sleep_time); + sleep(sleep_time); + + char * filename = util_alloc_filename(argv[1], "OK", "status"); + + if (util_file_exists(argv[1])) { + FILE * file = util_fopen(filename, "w"); + fprintf(file, "All good"); + util_fclose(file); + exit(0); + } else + exit(1); +} diff --git a/ThirdParty/Ert/devel/libjob_queue/tests/job_queue_test.c b/ThirdParty/Ert/devel/libjob_queue/tests/job_queue_driver_test.c similarity index 98% rename from ThirdParty/Ert/devel/libjob_queue/tests/job_queue_test.c rename to ThirdParty/Ert/devel/libjob_queue/tests/job_queue_driver_test.c index d3de35cda7..00993fdcd5 100644 --- a/ThirdParty/Ert/devel/libjob_queue/tests/job_queue_test.c +++ b/ThirdParty/Ert/devel/libjob_queue/tests/job_queue_driver_test.c @@ -18,8 +18,6 @@ #include #include -#include - #include #include @@ -27,7 +25,7 @@ #include #include -#include "ert/job_queue/torque_driver.h" +#include #include void job_queue_set_driver_(job_driver_type driver_type) { @@ -41,6 +39,7 @@ void job_queue_set_driver_(job_driver_type driver_type) { job_queue_free(queue); queue_driver_free(driver); + } void set_option_max_running_max_running_value_set() { @@ -154,8 +153,10 @@ void get_driver_option_lists() { int main(int argc, char ** argv) { job_queue_set_driver_(LSF_DRIVER); + job_queue_set_driver_(LOCAL_DRIVER); + job_queue_set_driver_(RSH_DRIVER); job_queue_set_driver_(TORQUE_DRIVER); - + set_option_max_running_max_running_value_set(); set_option_max_running_max_running_option_set(); set_option_invalid_option_returns_false(); diff --git a/ThirdParty/Ert/devel/libjob_queue/tests/job_torque_test.c b/ThirdParty/Ert/devel/libjob_queue/tests/job_torque_test.c index 3f4ffe6aea..10fd68d544 100644 --- a/ThirdParty/Ert/devel/libjob_queue/tests/job_torque_test.c +++ b/ThirdParty/Ert/devel/libjob_queue/tests/job_torque_test.c @@ -72,7 +72,7 @@ void getoption_nooptionsset_defaultoptionsreturned() { } void create_submit_script_script_according_to_input() { - test_work_area_type * work_area = test_work_area_alloc("job_torque_test" , true); + test_work_area_type * work_area = test_work_area_alloc("job_torque_test" ); const char * script_filename = "qsub_script.sh"; { diff --git a/ThirdParty/Ert/devel/libjob_queue/tests/job_workflow_test.c b/ThirdParty/Ert/devel/libjob_queue/tests/job_workflow_test.c index 00e9bb5678..466ad60ff1 100644 --- a/ThirdParty/Ert/devel/libjob_queue/tests/job_workflow_test.c +++ b/ThirdParty/Ert/devel/libjob_queue/tests/job_workflow_test.c @@ -82,7 +82,7 @@ int main( int argc , char ** argv) { const char * exjob_file = "job"; const char * bin_path = argv[1]; const char * internal_workflow = argv[2]; - test_work_area_type * work_area = test_work_area_alloc( "job_workflow_test" , true); + test_work_area_type * work_area = test_work_area_alloc( "job_workflow_test" ); signal(SIGSEGV , util_abort_signal); create_exjob( exjob_file , bin_path ); diff --git a/ThirdParty/Ert/devel/libplot/CMakeLists.txt b/ThirdParty/Ert/devel/libplot/CMakeLists.txt index b9ced7fd31..8c14de8b7e 100644 --- a/ThirdParty/Ert/devel/libplot/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libplot/CMakeLists.txt @@ -10,3 +10,8 @@ find_path( PLPLOT_HEADER plplot/plplot.h ${PLPLOT_INCLUDE_PATH} ) include_directories( ${PLPLOT_HEADER} ) add_subdirectory( src ) + +if (BUILD_TESTS) + add_subdirectory( tests ) +endif() + diff --git a/ThirdParty/Ert/devel/libplot/include/ert/plot/plot.h b/ThirdParty/Ert/devel/libplot/include/ert/plot/plot.h index 8673810954..997d11649a 100644 --- a/ThirdParty/Ert/devel/libplot/include/ert/plot/plot.h +++ b/ThirdParty/Ert/devel/libplot/include/ert/plot/plot.h @@ -57,7 +57,7 @@ void plot_set_labels(plot_type * item, const char *xlabel, const char *ylabel, c void plot_data(plot_type * item); void plot_free(plot_type * item); -void plot_update_range(plot_type * item, plot_range_type * ); +void plot_update_range(plot_type * item); void plot_set_window_size(plot_type * , int , int ); void plot_invert_y_axis(plot_type * ); @@ -77,10 +77,12 @@ void plot_set_range(plot_type * plot , double xmin , double xmax , doub void plot_set_label_color(plot_type * , plot_color_type ); void plot_set_box_color(plot_type * , plot_color_type ); void plot_set_label_fontsize(plot_type * , double ); - void plot_set_axis_fontsize(plot_type * plot , double axis_font_size_scale); +void plot_set_axis_fontsize(plot_type * plot , double axis_font_size_scale); const char * plot_set_default_timefmt(plot_type * plot , time_t t1 , time_t t2); void plot_set_timefmt(plot_type * plot , const char * timefmt); +void plot_add_text( plot_type * plot , double x , double y , double font_scale , const char * text); +UTIL_IS_INSTANCE_HEADER( plot ); /** * @} diff --git a/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_dataset.h b/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_dataset.h index bd9447141a..ed26ddfa19 100644 --- a/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_dataset.h +++ b/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_dataset.h @@ -95,8 +95,8 @@ int plot_dataset_step_next(plot_dataset_type * d); void plot_dataset_finished(plot_dataset_type * d, bool flag); bool plot_dataset_is_finished(plot_dataset_type * d); -void plot_dataset_update_range(plot_dataset_type * , bool * , plot_range_type * ); -void plot_dataset_update_range_histogram(plot_dataset_type * d, plot_range_type * range); +void plot_dataset_update_range(const plot_dataset_type * , plot_range_type * ); +void plot_dataset_update_range_histogram(const plot_dataset_type * d, plot_range_type * range); plot_dataset_type *plot_dataset_alloc( plot_data_type , const char * label , bool logx , bool logy); void plot_dataset_free__(void * d); diff --git a/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_driver.h b/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_driver.h index 4e73d999ec..9a54c93e17 100644 --- a/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_driver.h +++ b/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_driver.h @@ -23,7 +23,7 @@ #include #include - +#include typedef struct plot_dataset_struct plot_dataset_type; @@ -52,13 +52,14 @@ typedef void (set_log_ftype) (plot_driver_type * driver , bool logx , b typedef void (set_labels_ftype) (plot_driver_type * driver , const char *title , const char * xlabel , const char * ylabel, plot_color_type label_color , double label_font_size); typedef void (window_size_ftype) (plot_driver_type * driver , int width , int heigth); typedef void (close_driver_ftype) (plot_driver_type * driver ); -typedef void (set_axis_ftype) (plot_driver_type * driver , plot_range_type * range , const char * timefmt , plot_color_type box_color , double tick_font_size); +typedef void (set_axis_ftype) (plot_driver_type * driver , const plot_range_type * range , const char * timefmt , plot_color_type box_color , double tick_font_size); typedef void (plot_xy_ftype) (plot_driver_type * driver , const char * label , double_vector_type * x , double_vector_type * y , plot_style_type style , line_attribute_type line_attr , point_attribute_type point_attr); typedef void (plot_xy1y2_ftype) (plot_driver_type * driver , const char * label , double_vector_type * x , double_vector_type * y1 , double_vector_type * y2 , line_attribute_type line_attr ); typedef void (plot_x1x2y_ftype) (plot_driver_type * driver , const char * label , double_vector_type * x1 , double_vector_type * x2 , double_vector_type * y , line_attribute_type line_attr ); typedef void (plot_hist_ftype) (plot_driver_type * driver , const char * label , double_vector_type * x , line_attribute_type line_attr); +typedef void (plot_text_ftype) (plot_driver_type * driver , const plot_text_type * plot_text); struct plot_driver_struct { @@ -76,6 +77,7 @@ struct plot_driver_struct { plot_x1x2y_ftype * plot_x1x2y; plot_hist_ftype * plot_hist; set_log_ftype * set_log; + plot_text_ftype * text; }; @@ -109,6 +111,8 @@ void plot_driver_plot_yline( plot_driver_type * driver , const char * label , do void plot_driver_plot_xline( plot_driver_type * driver , const char * label , double x0 , double ymin , double ymax , line_attribute_type line_attr); +void plot_driver_text( plot_driver_type * driver , const plot_text_type * plot_text); + void plot_driver_plot_hist( plot_driver_type * driver, const char * label , double_vector_type * x , line_attribute_type line_attr); void plot_driver_set_axis( plot_driver_type * driver , plot_range_type * range , const char * timefmt , plot_color_type box_color , double tick_font_size); diff --git a/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_range.h b/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_range.h index 1d85238daa..53e88b4375 100644 --- a/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_range.h +++ b/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_range.h @@ -24,6 +24,11 @@ extern "C" { #include #include +#include + +#define PLOT_RANGE_DEFAULT_PADDING 0.025 +#define PLOT_RANGE_DEFAULT_MANUAL_LIMIT -9999 + typedef struct plot_range_struct plot_range_type; @@ -31,8 +36,6 @@ typedef struct plot_range_struct plot_range_type; plot_range_type * plot_range_alloc(); void plot_range_free(plot_range_type *); -void plot_range_fprintf(const plot_range_type * , FILE * ); - double plot_range_get_final_xmin(const plot_range_type * plot_range); double plot_range_get_final_xmax(const plot_range_type * plot_range); double plot_range_get_final_ymin(const plot_range_type * plot_range); @@ -47,27 +50,61 @@ double plot_range_safe_get_xmax(const plot_range_type * ); double plot_range_safe_get_ymax(const plot_range_type * ); double plot_range_safe_get_xmin(const plot_range_type * ); double plot_range_safe_get_ymin(const plot_range_type * ); - -void plot_range_set_xmax(plot_range_type * , double); -void plot_range_set_ymax(plot_range_type * , double); -void plot_range_set_xmin(plot_range_type * , double); -void plot_range_set_ymin(plot_range_type * , double); void plot_range_set_auto_xmax(plot_range_type * , double); void plot_range_set_auto_ymax(plot_range_type * , double); void plot_range_set_auto_xmin(plot_range_type * , double); void plot_range_set_auto_ymin(plot_range_type * , double); -void plot_range_set_top_padding(plot_range_type * , double ); -void plot_range_set_bottom_padding(plot_range_type * , double ); -void plot_range_set_left_padding(plot_range_type * , double ); -void plot_range_set_right_padding(plot_range_type * , double ); + void plot_range_set_top_padding(plot_range_type * , double ); + void plot_range_set_bottom_padding(plot_range_type * , double ); + void plot_range_set_left_padding(plot_range_type * , double ); + void plot_range_set_right_padding(plot_range_type * , double ); + + double plot_range_get_left_padding(const plot_range_type * plot_range ); + double plot_range_get_right_padding(const plot_range_type * plot_range ); + double plot_range_get_top_padding(const plot_range_type * plot_range ); + double plot_range_get_bottom_padding(const plot_range_type * plot_range ); + + + + void plot_range_set_invert_y_axis(plot_range_type * range , bool invert); + void plot_range_set_invert_x_axis(plot_range_type * range , bool invert); + bool plot_range_get_invert_y_axis(const plot_range_type * range); + bool plot_range_get_invert_x_axis(const plot_range_type * range); + + void plot_range_update_vector_x( plot_range_type * range , const double_vector_type * x ); + void plot_range_update_vector_y( plot_range_type * range , const double_vector_type * y ); + void plot_range_update_vector( plot_range_type * range , const double_vector_type * x , const double_vector_type * y); + + void plot_range_update_y( plot_range_type * range , double y); + void plot_range_update_x( plot_range_type * range , double x ); + void plot_range_update( plot_range_type * range , double x , double y); + + void plot_range_get_limits( const plot_range_type * range , double * x1 , double * x2 , double * y1 , double * y2 ); + + double plot_range_get_current_xmin( const plot_range_type * range ); + double plot_range_get_current_xmax( const plot_range_type * range ); + double plot_range_get_current_ymin( const plot_range_type * range ); + double plot_range_get_current_ymax( const plot_range_type * range ); + + + + double plot_range_get_manual_xmin( const plot_range_type * range ); + double plot_range_get_manual_xmax( const plot_range_type * range ); + double plot_range_get_manual_ymin( const plot_range_type * range ); + double plot_range_get_manual_ymax( const plot_range_type * range ); + + void plot_range_set_manual_xmin( plot_range_type * range , double value); + void plot_range_set_manual_xmax( plot_range_type * range , double value); + void plot_range_set_manual_ymin( plot_range_type * range , double value); + void plot_range_set_manual_ymax( plot_range_type * range , double value); -void plot_range_invert_y_axis(plot_range_type * , bool ); -void plot_range_invert_x_axis(plot_range_type * , bool ); + void plot_range_unset_manual_xmin( plot_range_type * range ); + void plot_range_unset_manual_xmax( plot_range_type * range ); + void plot_range_unset_manual_ymin( plot_range_type * range ); + void plot_range_unset_manual_ymax( plot_range_type * range ); - void plot_range_apply(plot_range_type * ); -void plot_range_set_range( plot_range_type * range , double xmin , double xmax , double ymin , double ymax); #ifdef __cplusplus } diff --git a/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_text.h b/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_text.h new file mode 100644 index 0000000000..a3746838f2 --- /dev/null +++ b/ThirdParty/Ert/devel/libplot/include/ert/plot/plot_text.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'plot_text.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + +#ifndef __PLOT_TEXT_H__ +#define __PLOT_TEXT_H__ +#ifdef __cplusplus +extern "c" { +#endif + +#include + +#include + + typedef struct plot_text_struct plot_text_type; + + + plot_text_type * plot_text_alloc( double xpos , double ypos , double font_scale , const char * text) ; + void plot_text_free( plot_text_type * plot_text ); + void plot_text_free__( void * arg ); + + double plot_text_get_x( const plot_text_type * plot_text ); + + double plot_text_get_y( const plot_text_type * plot_text ); + + double plot_text_get_font_scale( const plot_text_type * plot_text ); + + const char * plot_text_get_text( const plot_text_type * plot_text ); + void plot_text_update_range( const plot_text_type * plot_text , plot_range_type * range); + + UTIL_IS_INSTANCE_HEADER( plot_text ); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/ThirdParty/Ert/devel/libplot/include/ert/plot/plplot_driver.h b/ThirdParty/Ert/devel/libplot/include/ert/plot/plplot_driver.h index 458080fd42..9244a4f1d3 100644 --- a/ThirdParty/Ert/devel/libplot/include/ert/plot/plplot_driver.h +++ b/ThirdParty/Ert/devel/libplot/include/ert/plot/plplot_driver.h @@ -22,9 +22,13 @@ #ifdef __cplusplus extern "C" { #endif +#include + #include -plot_driver_type * plplot_driver_alloc(const void * init_arg); + void plplot_close_driver( plot_driver_type * driver ); + bool plplot_driver_check_init_arg( const void * init_arg ); + plot_driver_type * plplot_driver_alloc(const void * init_arg); #ifdef __cplusplus } diff --git a/ThirdParty/Ert/devel/libplot/src/CMakeLists.txt b/ThirdParty/Ert/devel/libplot/src/CMakeLists.txt index 993fe20327..e77b1136e2 100644 --- a/ThirdParty/Ert/devel/libplot/src/CMakeLists.txt +++ b/ThirdParty/Ert/devel/libplot/src/CMakeLists.txt @@ -1,5 +1,5 @@ -set( source_files plot.c plot_dataset.c plot_range.c plplot_driver.c plot_driver.c text_driver.c) -set( header_files plot.h plot_dataset.h plot_range.h plot_const.h plot_driver.h plplot_driver.h text_driver.h) +set( source_files plot.c plot_dataset.c plot_range.c plplot_driver.c plot_driver.c text_driver.c plot_text.c) +set( header_files plot.h plot_dataset.h plot_range.h plot_const.h plot_driver.h plplot_driver.h text_driver.h plot_text.h) add_library( plot ${LIBRARY_TYPE} ${source_files} ) diff --git a/ThirdParty/Ert/devel/libplot/src/plot.c b/ThirdParty/Ert/devel/libplot/src/plot.c index 66bed6d759..666d4693d1 100644 --- a/ThirdParty/Ert/devel/libplot/src/plot.c +++ b/ThirdParty/Ert/devel/libplot/src/plot.c @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -51,14 +52,16 @@ - +#define PLOT_TYPE_ID 7000091 struct plot_struct { + UTIL_TYPE_ID_DECLARATION; char * timefmt; /* The format string used to convert from time_t -> strtime on the x-axis; NULL if not used. */ vector_type * dataset; /* Vector of datasets to plot. */ hash_type * dataset_hash; /* Hash table of the datasets - indexed by label. */ bool is_histogram; /* If this is true it can only contain histogram datasets. */ + vector_type * text_list; char * xlabel; /* Label for the x-axis */ char * ylabel; /* Label for the y-axis */ @@ -78,6 +81,7 @@ struct plot_struct { plot_driver_type * driver; /* Plot driver - mainly list of function pointers to 'actually do it'. */ }; +UTIL_IS_INSTANCE_FUNCTION( plot , PLOT_TYPE_ID) @@ -153,6 +157,29 @@ static void plot_set_log( plot_type * plot , bool logx , bool logy) { plot->logy = logy; } +plot_driver_type * plot_alloc_driver( const char * __driver_type , const void * init_arg) { + + plot_driver_type * driver = NULL; + { + char * driver_type = util_alloc_string_copy( __driver_type ); + util_strupr( driver_type ); + + if (util_string_equal( driver_type , "PLPLOT")) { + if (plplot_driver_check_init_arg( init_arg )) + driver = plplot_driver_alloc(init_arg); + } else if (util_string_equal( driver_type , "TEXT")) + driver = text_driver_alloc(init_arg); + else + util_abort("%s: plot driver:%s not implemented ... \n",__func__ , __driver_type); + + free( driver_type ); + } + + if (driver) + plot_driver_assert( driver ); + return driver; +} + /** This function allocates the plot handle. The first argument is a @@ -164,48 +191,38 @@ static void plot_set_log( plot_type * plot , bool logx , bool logy) { plot_type * plot_alloc(const char * __driver_type , const void * init_arg , bool logx , bool logy) { - plot_type * plot = util_malloc(sizeof *plot ); - { - /* - Loading the driver: - */ - char * driver_type = util_alloc_string_copy( __driver_type ); - util_strupr( driver_type ); - - if (util_string_equal( driver_type , "PLPLOT")) - plot->driver = plplot_driver_alloc(init_arg); - else if (util_string_equal( driver_type , "TEXT")) - plot->driver = text_driver_alloc(init_arg); - else - util_abort("%s: plot driver:%s not implemented ... \n",__func__ , __driver_type); + plot_driver_type * driver = plot_alloc_driver( __driver_type , init_arg ); + if (driver) { + plot_type * plot = util_malloc(sizeof *plot ); + UTIL_TYPE_ID_INIT( plot , PLOT_TYPE_ID ); - plot_driver_assert( plot->driver ); - - free( driver_type ); - } - - /* Initializing plot data which is common to all drivers. */ - plot->is_histogram = false; - plot->dataset = vector_alloc_new(); - plot->dataset_hash = hash_alloc(); - plot->range = plot_range_alloc(); - plot->timefmt = NULL; - plot->xlabel = NULL; - plot->ylabel = NULL; - plot->title = NULL; - - /* - These functions only manipulate the internal plot_state - variables, and do not call the driver functions. - */ - plot_set_window_size(plot , PLOT_DEFAULT_WIDTH , PLOT_DEFAULT_HEIGHT); - plot_set_box_color(plot , PLOT_DEFAULT_BOX_COLOR); - plot_set_label_color(plot , PLOT_DEFAULT_LABEL_COLOR); - plot_set_label_fontsize(plot , 1.0); - plot_set_axis_fontsize(plot , 1.0); - plot_set_labels(plot , "" , "" , ""); /* Initializeing with empty labels. */ - plot_set_log( plot , logx , logy); /* Default - no log on the axis. */ - return plot; + plot->driver = driver; + + /* Initializing plot data which is common to all drivers. */ + plot->is_histogram = false; + plot->text_list = vector_alloc_new(); + plot->dataset = vector_alloc_new(); + plot->dataset_hash = hash_alloc(); + plot->range = plot_range_alloc(); + plot->timefmt = NULL; + plot->xlabel = NULL; + plot->ylabel = NULL; + plot->title = NULL; + + /* + These functions only manipulate the internal plot_state + variables, and do not call the driver functions. + */ + plot_set_window_size(plot , PLOT_DEFAULT_WIDTH , PLOT_DEFAULT_HEIGHT); + plot_set_box_color(plot , PLOT_DEFAULT_BOX_COLOR); + plot_set_label_color(plot , PLOT_DEFAULT_LABEL_COLOR); + plot_set_label_fontsize(plot , 1.0); + plot_set_axis_fontsize(plot , 1.0); + plot_set_labels(plot , "" , "" , ""); /* Initializeing with empty labels. */ + plot_set_log( plot , logx , logy); /* Default - no log on the axis. */ + return plot; + } else + return NULL; } @@ -260,6 +277,7 @@ static void plot_free_all_datasets(plot_type * plot) { void plot_free( plot_type * plot ) { plot_driver_free( plot->driver ); + vector_free( plot->text_list ); plot_free_all_datasets(plot); plot_range_free(plot->range); util_safe_free(plot->timefmt); @@ -277,7 +295,7 @@ void plot_free( plot_type * plot ) 1. Looping through all the datasets to find the minimum and maximum values of x and y, these are set in the plot_range struct. - + 2. The plot_range() methods are used to calculate final range xmin,xmax,ymin,ymax values based on the extremal values from point 1, padding values and invert_axis flags. @@ -292,10 +310,6 @@ void plot_free( plot_type * plot ) */ -static void plot_set_range__(plot_type * plot) { - plot_update_range(plot , plot->range); - plot_range_apply( plot->range ); -} @@ -308,14 +322,21 @@ void plot_data(plot_type * plot) int iplot; plot_driver_type * driver = plot->driver; - plot_set_range__(plot); - + plot_update_range(plot); plot_driver_set_window_size( driver , plot->width , plot->height ); plot_driver_set_labels( driver , plot->title , plot->xlabel , plot->ylabel , plot->label_color , plot->label_font_size); plot_driver_set_axis( driver , plot->range , plot->timefmt , plot->box_color , plot->axis_font_size ); for (iplot = 0; iplot < vector_get_size( plot->dataset ); iplot++) plot_dataset_draw(vector_iget(plot->dataset , iplot) , driver , plot->range); + + { + int itext; + for (itext = 0; itext < vector_get_size( plot->text_list ); itext++) { + const plot_text_type * plot_text = vector_iget_const( plot->text_list , itext ); + plot_driver_text( driver , plot_text ); + } + } } @@ -331,23 +352,26 @@ void plot_data(plot_type * plot) void plot_set_range(plot_type * plot , double xmin , double xmax , double ymin , double ymax) { - plot_range_set_range(plot->range , xmin , xmax , ymin , ymax); + plot_set_xmin( plot , xmin ); + plot_set_xmax( plot , xmax ); + plot_set_ymin( plot , ymin ); + plot_set_ymax( plot , ymax ); } void plot_set_xmin(plot_type * plot , double xmin) { - plot_range_set_xmin( plot->range , xmin ); + plot_range_set_manual_xmin( plot->range , xmin ); } void plot_set_xmax(plot_type * plot , double xmax) { - plot_range_set_xmax( plot->range , xmax ); + plot_range_set_manual_xmax( plot->range , xmax ); } void plot_set_ymin(plot_type * plot , double ymin) { - plot_range_set_ymin( plot->range , ymin ); + plot_range_set_manual_ymin( plot->range , ymin ); } void plot_set_ymax(plot_type * plot , double ymax) { - plot_range_set_ymax( plot->range , ymax ); + plot_range_set_manual_ymax( plot->range , ymax ); } @@ -378,11 +402,11 @@ void plot_set_padding(plot_type * plot , double padding) { /*****************************************************************/ void plot_invert_x_axis(plot_type * plot) { - plot_range_invert_x_axis(plot->range , true); + plot_range_set_invert_x_axis(plot->range , true); } void plot_invert_y_axis(plot_type * plot) { - plot_range_invert_y_axis(plot->range , true); + plot_range_set_invert_y_axis(plot->range , true); } /*****************************************************************/ @@ -427,26 +451,20 @@ void plot_set_labels(plot_type * plot, const char *xlabel, const char *ylabel, c -/** - * @brief Get extrema values - * @param plot your current plot - * @param x_max pointer to the new x maximum - * @param y_max pointer to the new y maximum - * @param x_min pointer to the new x minimum - * @param y_min pointer to the new y minimum - * - * Find the extrema values in the plot plot, checks all added datasets. - */ - -void plot_update_range(plot_type * plot, plot_range_type * range) { + +void plot_update_range(plot_type * plot) { if (plot->is_histogram) - plot_dataset_update_range_histogram( vector_iget(plot->dataset , 0) , range); + plot_dataset_update_range_histogram( vector_iget(plot->dataset , 0) , plot->range); else { - bool first_pass = true; int iplot; for (iplot = 0; iplot < vector_get_size( plot->dataset ); iplot++) - plot_dataset_update_range(vector_iget(plot->dataset , iplot) , &first_pass , range); + plot_dataset_update_range(vector_iget(plot->dataset , iplot) , plot->range); } } +void plot_add_text( plot_type * plot , double x , double y , double font_scale , const char * text) { + plot_text_type * text_node = plot_text_alloc(x , y , font_scale , text ); + vector_append_owned_ref( plot->text_list , text_node , plot_text_free__ ); + plot_text_update_range( text_node , plot->range ); +} diff --git a/ThirdParty/Ert/devel/libplot/src/plot_dataset.c b/ThirdParty/Ert/devel/libplot/src/plot_dataset.c index 528c6a7658..f9b3dd819a 100644 --- a/ThirdParty/Ert/devel/libplot/src/plot_dataset.c +++ b/ThirdParty/Ert/devel/libplot/src/plot_dataset.c @@ -411,10 +411,20 @@ void plot_dataset_draw(plot_dataset_type * d , plot_driver_type * driver, const plot_driver_plot_x1x2y( driver , d->label , d->x1 , d->x2 , d->y , d->line_attr); break; case(PLOT_YLINE): - plot_driver_plot_yline( driver , d->label , plot_range_get_xmin(range) , plot_range_get_xmax(range) , double_vector_iget( d->y , 0) , d->line_attr); + plot_driver_plot_yline( driver , + d->label , + plot_range_get_current_xmin(range) , + plot_range_get_current_xmax(range) , + double_vector_iget( d->y , 0) , + d->line_attr); break; case(PLOT_XLINE): - plot_driver_plot_xline( driver , d->label , double_vector_iget( d->x , 0) , plot_range_get_ymin(range) , plot_range_get_ymax(range) , d->line_attr); + plot_driver_plot_xline( driver , + d->label , + double_vector_iget( d->x , 0) , + plot_range_get_current_ymin(range) , + plot_range_get_current_ymax(range) , + d->line_attr); break; default: util_abort("%s: internal error ... \n",__func__); @@ -423,94 +433,27 @@ void plot_dataset_draw(plot_dataset_type * d , plot_driver_type * driver, const } -void plot_dataset_update_range_histogram(plot_dataset_type * d, plot_range_type * range) { - plot_range_set_auto_xmin(range , double_vector_get_min( d->x )); - plot_range_set_auto_xmax(range , double_vector_get_max( d->x )); - plot_range_set_auto_ymin(range , 0 ); - plot_range_set_auto_ymax(range , double_vector_size( d->x ) ); /* Pure heuristics. */ +void plot_dataset_update_range_histogram(const plot_dataset_type * d, plot_range_type * range) { + plot_range_update_vector_x( range , d->x ); + plot_range_update_y( range , 0 ); + plot_range_update_y( range , double_vector_size( d->x ) ); /* Pure heuristics. */ } -/** - * @brief Get extrema values from one dataset - * @param d your current dataset - * @param x_max pointer to max x-value - * @param y_max pointer to max y-value - * @param x_min pointer to the new x minimum - * @param y_min pointer to the new y minimum - * - * Find the extrema values in the plot item, checks all added dataset. - */ -void plot_dataset_update_range(plot_dataset_type * d, bool * first_pass , plot_range_type * range) { + +void plot_dataset_update_range(const plot_dataset_type * d, plot_range_type * range) { + const int size = plot_dataset_get_size( d ); if (size > 0) { - double tmp_x_max = plot_range_safe_get_xmax(range); - double tmp_y_max = plot_range_safe_get_ymax(range); - double tmp_x_min = plot_range_safe_get_xmin(range); - double tmp_y_min = plot_range_safe_get_ymin(range); - - int i; - double *x1 , *x2, *y1 , *y2; - - - x1 = NULL; - x2 = NULL; - y1 = NULL; - y2 = NULL; - - if (d->data_mask & PLOT_DATA_X) {x1 = double_vector_get_ptr(d->x); x2 = double_vector_get_ptr(d->x); } - if (d->data_mask & PLOT_DATA_X1) x1 = double_vector_get_ptr(d->x1); - if (d->data_mask & PLOT_DATA_X2) x2 = double_vector_get_ptr(d->x2); - - - if (d->data_mask & PLOT_DATA_Y) {y1 = double_vector_get_ptr(d->y) ; y2 = double_vector_get_ptr(d->y) ; } - if (d->data_mask & PLOT_DATA_Y1) y1 = double_vector_get_ptr(d->y1) ; - if (d->data_mask & PLOT_DATA_Y2) y2 = double_vector_get_ptr(d->y2) ; - - if (x1 != NULL) { - if (*first_pass) { - /* To ensure sensible initialisation */ - tmp_x_min = x1[0]; - tmp_x_max = x2[0]; - } - - for (i=0; i < size; i++) { - if (x1[i] < tmp_x_min) - tmp_x_min = x1[i]; - - if (x2[i] > tmp_x_max) - tmp_x_max = x2[i]; - } - } - - - if (y1 != NULL) { - if (*first_pass) { - tmp_y_min = y1[0]; - tmp_y_max = y2[0]; - } - - for (i=0; i < size; i++) { - if (y1[i] < tmp_y_min) - tmp_y_min = y1[i]; - - if (y2[i] > tmp_y_max) - tmp_y_max = y2[i]; - } - } - - /** - If the range value has been set manually these functions - just return without doing anything. - */ - plot_range_set_auto_xmin(range , tmp_x_min); - plot_range_set_auto_xmax(range , tmp_x_max); - plot_range_set_auto_ymin(range , tmp_y_min); - plot_range_set_auto_ymax(range , tmp_y_max); + if (d->data_mask & PLOT_DATA_X) plot_range_update_vector_x( range , d->x ); + if (d->data_mask & PLOT_DATA_X1) plot_range_update_vector_x( range , d->x1 ); + if (d->data_mask & PLOT_DATA_X2) plot_range_update_vector_x( range , d->x2 ); - *first_pass = false; + if (d->data_mask & PLOT_DATA_Y) plot_range_update_vector_y( range , d->y ); + if (d->data_mask & PLOT_DATA_Y1) plot_range_update_vector_y( range , d->y1 ); + if (d->data_mask & PLOT_DATA_Y2) plot_range_update_vector_y( range , d->y2 ); } } diff --git a/ThirdParty/Ert/devel/libplot/src/plot_driver.c b/ThirdParty/Ert/devel/libplot/src/plot_driver.c index 80cce36cc6..0bac2d3ee7 100644 --- a/ThirdParty/Ert/devel/libplot/src/plot_driver.c +++ b/ThirdParty/Ert/devel/libplot/src/plot_driver.c @@ -93,6 +93,7 @@ plot_driver_type * plot_driver_alloc_empty(const char * driver_name) { driver->set_window_size = NULL; driver->set_axis = NULL; + driver->text = NULL; driver->plot_xy = NULL; driver->plot_xy1y2 = NULL; driver->plot_x1x2y = NULL; @@ -176,6 +177,12 @@ void plot_driver_plot_x1x2y(plot_driver_type * driver , } +void plot_driver_text( plot_driver_type * driver , const plot_text_type * plot_text) { + if (driver->text) + driver->text( driver , plot_text); + else + fprintf(stderr,"** Sorry: this plot driver does not support the text() function\n"); +} diff --git a/ThirdParty/Ert/devel/libplot/src/plot_range.c b/ThirdParty/Ert/devel/libplot/src/plot_range.c index d1a5e385eb..0669278a9e 100644 --- a/ThirdParty/Ert/devel/libplot/src/plot_range.c +++ b/ThirdParty/Ert/devel/libplot/src/plot_range.c @@ -61,341 +61,292 @@ struct plot_range_struct { - double padding[4]; - double limits[4]; - double final[4]; - bool final_set[4]; - bool set[4]; bool invert_x_axis; bool invert_y_axis; - bool auto_range[4]; -}; - -/*****************************************************************/ -void plot_range_fprintf(const plot_range_type * range, FILE * stream) { - printf("x1: %g x2:%g y1:%g y2:%g \n",range->limits[XMIN] , range->limits[XMAX] , range->limits[YMIN] , range->limits[YMAX]); -} + double current_xmin; + double current_ymin; + double current_xmax; + double current_ymax; + double manual_xmin; + double manual_xmax; + double manual_ymin; + double manual_ymax; + + bool auto_xmin; + bool auto_xmax; + bool auto_ymin; + bool auto_ymax; + + double left_padding, right_padding, top_padding, bottom_padding; +}; /*****************************************************************/ -static void plot_range_set__(plot_range_type * plot_range , int index , double value) { - plot_range->limits[index] = value; - plot_range->set[index] = true; - plot_range->auto_range[index] = false; - plot_range->padding[index] = 0; /* If you are explicitly setting a limit - you get no padding. */ -} - - -void plot_range_set_ymax(plot_range_type * plot_range , double ymax) { - plot_range_set__(plot_range , YMAX , ymax); +void plot_range_set_invert_x_axis(plot_range_type * range, bool invert) { + range->invert_x_axis = invert; } -void plot_range_set_ymin(plot_range_type * plot_range , double ymin) { - plot_range_set__(plot_range , YMIN , ymin); +void plot_range_set_invert_y_axis(plot_range_type * range, bool invert) { + range->invert_y_axis = invert; } -void plot_range_set_xmax(plot_range_type * plot_range , double xmax) { - plot_range_set__(plot_range , XMAX , xmax); +bool plot_range_get_invert_x_axis(const plot_range_type * range) { + return range->invert_x_axis; } -void plot_range_set_xmin(plot_range_type * plot_range , double xmin) { - plot_range_set__(plot_range , XMIN , xmin); +bool plot_range_get_invert_y_axis(const plot_range_type * range) { + return range->invert_y_axis; } /*****************************************************************/ + /** - The set_auto functions can always be called, but if the range in - question has been set manually, the function just returns without - doing anything. + Allocates a plot_range instance, and initializes it to the + 'auto_range' mode. If you want to use another mode you must call + plot_range_set_mode() explicitly. */ -static void plot_range_set_auto__(plot_range_type * plot_range , int index , double value) { - if (plot_range->auto_range[index]) { - plot_range->limits[index] = value; - plot_range->set[index] = true; - } -} +plot_range_type * plot_range_alloc() { + plot_range_type * range = util_malloc(sizeof * range ); -void plot_range_set_auto_ymax(plot_range_type * plot_range , double ymax) { - plot_range_set_auto__(plot_range , YMAX , ymax); + range->left_padding = PLOT_RANGE_DEFAULT_PADDING; + range->right_padding = PLOT_RANGE_DEFAULT_PADDING; + range->top_padding = PLOT_RANGE_DEFAULT_PADDING; + range->bottom_padding = PLOT_RANGE_DEFAULT_PADDING; + + range->manual_xmin = PLOT_RANGE_DEFAULT_MANUAL_LIMIT; + range->manual_xmax = PLOT_RANGE_DEFAULT_MANUAL_LIMIT; + range->manual_ymin = PLOT_RANGE_DEFAULT_MANUAL_LIMIT; + range->manual_ymax = PLOT_RANGE_DEFAULT_MANUAL_LIMIT; + + range->current_xmin = DBL_MAX; + range->current_xmax = -DBL_MAX; + range->current_ymin = DBL_MAX; + range->current_ymax = -DBL_MAX; + + range->auto_xmin = true; + range->auto_xmax = true; + range->auto_ymin = true; + range->auto_ymax = true; + + range->invert_x_axis = false; + range->invert_y_axis = false; + return range; } -void plot_range_set_auto_ymin(plot_range_type * plot_range , double ymin) { - plot_range_set_auto__(plot_range , YMIN , ymin); -} -void plot_range_set_auto_xmax(plot_range_type * plot_range , double xmax) { - plot_range_set_auto__(plot_range , XMAX , xmax); -} -void plot_range_set_auto_xmin(plot_range_type * plot_range , double xmin) { - plot_range_set_auto__(plot_range , XMIN , xmin); +void plot_range_free(plot_range_type * plot_range) { + free(plot_range); } /*****************************************************************/ -/* - These functions will fail if the corresponding value has not - been set, either from an automatic set, or manually. -*/ -static double plot_range_get_final__(const plot_range_type * plot_range , int index) { - if (plot_range->final_set[index]) - return plot_range->final[index]; - else { - util_abort("%s: tried to get xmin - but that has not been set.\n",__func__); - return 0; - } +void plot_range_update_x( plot_range_type * range , double x ) { + range->current_xmin = util_double_min( range->current_xmin , x ); + range->current_xmax = util_double_max( range->current_xmax , x ); } -double plot_range_get_final_xmin(const plot_range_type * plot_range) { - return plot_range_get_final__(plot_range , XMIN); -} -double plot_range_get_final_xmax(const plot_range_type * plot_range) { - return plot_range_get_final__(plot_range , XMAX); +void plot_range_update_y( plot_range_type * range , double y ) { + range->current_ymin = util_double_min( range->current_ymin , y ); + range->current_ymax = util_double_max( range->current_ymax , y ); } -double plot_range_get_final_ymin(const plot_range_type * plot_range) { - return plot_range_get_final__(plot_range , YMIN); + +void plot_range_update( plot_range_type * range , double x , double y) { + plot_range_update_x( range , x ); + plot_range_update_y( range , y ); } -double plot_range_get_final_ymax(const plot_range_type * plot_range) { - return plot_range_get_final__(plot_range , YMAX); +void plot_range_update_vector_x( plot_range_type * range , const double_vector_type * x ) { + int i; + const double * x_data = double_vector_get_const_ptr( x ); + for (i=0; i < double_vector_size( x ); i++) + plot_range_update_x( range , x_data[i] ); } +void plot_range_update_vector_y( plot_range_type * range , const double_vector_type * y ) { + int i; + const double * y_data = double_vector_get_const_ptr( y ); + for (i=0; i < double_vector_size( y ); i++) + plot_range_update_y( range , y_data[i] ); +} -/*****************************************************************/ -/* - These functions will fail if the corresponding value has not - been set, either from an automatic set, or manually. -*/ -static double plot_range_get__(const plot_range_type * plot_range , int index) { - if (plot_range->set[index]) - return plot_range->limits[index]; - else { - util_abort("%s: tried to get xmin - but that has not been set.\n",__func__); - return 0; - } +void plot_range_update_vector( plot_range_type * range , const double_vector_type * x , const double_vector_type * y) { + plot_range_update_vector_x( range , x ); + plot_range_update_vector_y( range , y ); } -double plot_range_get_xmin(const plot_range_type * plot_range) { - return plot_range_get__(plot_range , XMIN); + +double plot_range_get_current_xmin( const plot_range_type * range ) { + return range->current_xmin; } -double plot_range_get_xmax(const plot_range_type * plot_range) { - return plot_range_get__(plot_range , XMAX); +double plot_range_get_current_xmax( const plot_range_type * range ) { + return range->current_xmax; } -double plot_range_get_ymin(const plot_range_type * plot_range) { - return plot_range_get__(plot_range , YMIN); +double plot_range_get_current_ymin( const plot_range_type * range ) { + return range->current_ymin; } -double plot_range_get_ymax(const plot_range_type * plot_range) { - return plot_range_get__(plot_range , YMAX); +double plot_range_get_current_ymax( const plot_range_type * range ) { + return range->current_ymax; } -/*****************************************************************/ -/* - The _safe_ functions will return the value of range->limits[] - irrespective of whether it has been set with a sensible value or - not. -*/ -static double plot_range_safe_get__(const plot_range_type * plot_range , int index) { - return plot_range->limits[index]; -} +/*****************************************************************/ -double plot_range_safe_get_xmin(const plot_range_type * plot_range) { - return plot_range_safe_get__(plot_range , XMIN); +void plot_range_set_left_padding(plot_range_type * plot_range , double value) { + plot_range->left_padding = value; } -double plot_range_safe_get_xmax(const plot_range_type * plot_range) { - return plot_range_safe_get__(plot_range , XMAX); +void plot_range_set_right_padding(plot_range_type * plot_range , double value) { + plot_range->right_padding = value; } -double plot_range_safe_get_ymin(const plot_range_type * plot_range) { - return plot_range_safe_get__(plot_range , YMIN); +void plot_range_set_top_padding(plot_range_type * plot_range , double value) { + plot_range->top_padding = value; } -double plot_range_safe_get_ymax(const plot_range_type * plot_range) { - return plot_range_safe_get__(plot_range , YMAX); +void plot_range_set_bottom_padding(plot_range_type * plot_range , double value) { + plot_range->bottom_padding = value; } -/*****************************************************************/ - -static void plot_range_set_padding__(plot_range_type * plot_range , int index , double value) { - plot_range->padding[index] = value; +double plot_range_get_left_padding(const plot_range_type * plot_range ) { + return plot_range->left_padding; } - -void plot_range_set_left_padding(plot_range_type * plot_range , double value) { - plot_range_set_padding__(plot_range , XMIN , value); +double plot_range_get_right_padding(const plot_range_type * plot_range ) { + return plot_range->right_padding; } -void plot_range_set_right_padding(plot_range_type * plot_range , double value) { - plot_range_set_padding__(plot_range , XMAX , value); +double plot_range_get_top_padding(const plot_range_type * plot_range ) { + return plot_range->top_padding; } -void plot_range_set_top_padding(plot_range_type * plot_range , double value) { - plot_range_set_padding__(plot_range , YMAX , value); +double plot_range_get_bottom_padding(const plot_range_type * plot_range ) { + return plot_range->bottom_padding; } -void plot_range_set_bottom_padding(plot_range_type * plot_range , double value) { - plot_range_set_padding__(plot_range , YMIN , value); -} /*****************************************************************/ -void plot_range_invert_x_axis(plot_range_type * range, bool invert) { - range->invert_x_axis = invert; +double plot_range_get_manual_xmin( const plot_range_type * range ) { + return range->manual_xmin; } -void plot_range_invert_y_axis(plot_range_type * range, bool invert) { - range->invert_y_axis = invert; +double plot_range_get_manual_xmax( const plot_range_type * range ) { + return range->manual_xmax; } +double plot_range_get_manual_ymin( const plot_range_type * range ) { + return range->manual_ymin; +} +double plot_range_get_manual_ymax( const plot_range_type * range ) { + return range->manual_ymax; +} -/*****************************************************************/ - +void plot_range_set_manual_xmin( plot_range_type * range , double value) { + range->manual_xmin = value; + range->auto_xmin = false; +} -/** - Allocates a plot_range instance, and initializes it to the - 'auto_range' mode. If you want to use another mode you must call - plot_range_set_mode() explicitly. -*/ +void plot_range_set_manual_xmax( plot_range_type * range , double value) { + range->manual_xmax = value; + range->auto_xmax = false; +} -plot_range_type * plot_range_alloc() { - plot_range_type * range = util_malloc(sizeof * range ); - int i; - - for (i=0; i < 4; i++) { - range->limits[i] = 0; - range->padding[i] = 0.025; /* Default add some padding */ - range->set[i] = false; - range->final_set[i] = false; - range->auto_range[i] = true; - } - - range->invert_x_axis = false; - range->invert_y_axis = false; - return range; +void plot_range_set_manual_ymin( plot_range_type * range , double value) { + range->manual_ymin = value; + range->auto_ymin = false; } +void plot_range_set_manual_ymax( plot_range_type * range , double value) { + range->manual_ymax = value; + range->auto_ymax = false; +} +void plot_range_unset_manual_xmin( plot_range_type * range ) { + range->manual_xmin = PLOT_RANGE_DEFAULT_MANUAL_LIMIT; + range->auto_xmin = true; +} -void plot_range_free(plot_range_type * plot_range) { - free(plot_range); +void plot_range_unset_manual_xmax( plot_range_type * range ) { + range->manual_xmax = PLOT_RANGE_DEFAULT_MANUAL_LIMIT; + range->auto_xmax = true; } +void plot_range_unset_manual_ymin( plot_range_type * range ) { + range->manual_ymin = PLOT_RANGE_DEFAULT_MANUAL_LIMIT; + range->auto_ymin = true; +} -void plot_range_set_range( plot_range_type * range , double xmin , double xmax , double ymin , double ymax) { - plot_range_set_xmin(range , xmin); - plot_range_set_xmax(range , xmax); - plot_range_set_ymin(range , ymin); - plot_range_set_ymax(range , ymax); +void plot_range_unset_manual_ymax( plot_range_type * range ) { + range->manual_ymax = PLOT_RANGE_DEFAULT_MANUAL_LIMIT; + range->auto_ymax = true; } -/** - This function return the final xmin,xmax,ymin and ymax - functions. To avvoid filling up plplot specific function calls, - this function does not call plwind(), which would have been - natural. - - From the calling scope: - { - double x1,x2,y1,y2; - plot_range_apply(range , &x1 , &x2 , &y1 , &y2); - plwind( x1,x2,y1,y2); - } -*/ +/*****************************************************************/ - -void plot_range_apply(plot_range_type * plot_range) { - double x1 = 0; - double x2 = 0; - double y1 = 0; - double y2 = 0; +void plot_range_get_limits( const plot_range_type * range , double * x1 , double * x2 , double * y1 , double * y2) { + double xmin = range->auto_xmin ? range->current_xmin : range->manual_xmin; + double xmax = range->auto_xmax ? range->current_xmax : range->manual_xmax; + double ymin = range->auto_ymin ? range->current_ymin : range->manual_ymin; + double ymax = range->auto_ymax ? range->current_ymax : range->manual_ymax; + + + + double width = fabs(xmax - xmin); + double height = fabs(ymax - ymin); + + if (width == 0) + width = 0.05 * xmax; + + if (height == 0) + height = 0.05 * ymax; + { - double xmin = plot_range_get__(plot_range , XMIN ); - double xmax = plot_range_get__(plot_range , XMAX ); - double ymin = plot_range_get__(plot_range , YMIN ); - double ymax = plot_range_get__(plot_range , YMAX ); - double width = fabs(xmax - xmin); - double height = fabs(ymax - ymin); - - - if (plot_range->invert_x_axis) { - x1 = xmax; - x2 = xmin; + double left_padding , right_padding; + if (range->invert_x_axis) { + left_padding = range->auto_xmax ? range->left_padding : 0; + right_padding = range->auto_xmin ? range->right_padding : 0; - if (plot_range->auto_range[XMAX]) x1 += width * plot_range->padding[XMAX]; - if (plot_range->auto_range[XMIN]) x2 -= width * plot_range->padding[XMIN]; + *x1 = xmax + width * left_padding; + *x2 = xmin - width * right_padding; } else { - x1 = xmin; - x2 = xmax; + left_padding = range->auto_xmin ? range->left_padding : 0; + right_padding = range->auto_xmax ? range->right_padding : 0; - if (plot_range->auto_range[XMIN]) x1 -= width * plot_range->padding[XMIN]; - if (plot_range->auto_range[XMAX]) x2 += width * plot_range->padding[XMAX]; + *x1 = xmin - width * left_padding; + *x2 = xmax + width * right_padding; } - - if (plot_range->invert_y_axis) { - y1 = ymax; - y2 = ymin; + } + + { + double top_padding , bottom_padding; + if (range->invert_y_axis) { + bottom_padding = range->auto_ymax ? range->bottom_padding : 0; + top_padding = range->auto_ymin ? range->top_padding : 0; - if (plot_range->auto_range[YMAX]) y1 += height * plot_range->padding[YMAX]; - if (plot_range->auto_range[YMIN]) y2 -= height * plot_range->padding[YMIN]; + *y1 = ymax + height * bottom_padding; + *y2 = ymin - height * top_padding; } else { - y1 = ymin; - y2 = ymax; - if (plot_range->auto_range[YMIN]) y1 -= height * plot_range->padding[YMIN]; - if (plot_range->auto_range[YMAX]) y2 += height * plot_range->padding[YMIN]; - } - } - - - /* Special case for only one point. */ - { - if (x1 == x2) { - if (x1 == 0) { - x1 = -0.50; - x2 = 0.50; - } else { - x1 -= 0.05 * abs(x1); - x2 += 0.05 * abs(x2); - } - } - - if (y1 == y2) { - if (y1 == 0.0) { - y1 = -0.50; - y2 = 0.50; - } else { - y1 -= 0.05 * abs(y1); - y2 += 0.05 * abs(y2); - } + bottom_padding = range->auto_ymin ? range->bottom_padding : 0; + top_padding = range->auto_ymax ? range->top_padding : 0; + + *y1 = ymin - height * bottom_padding; + *y2 = ymax + height * top_padding; } } - { - int i; - for (i=0; i < 4; i++) - plot_range->final_set[i] = true; - } - - plot_range->final[XMIN] = x1; - plot_range->final[XMAX] = x2; - plot_range->final[YMIN] = y1; - plot_range->final[YMAX] = y2; -} - - - - + } diff --git a/ThirdParty/Ert/devel/libplot/src/plot_text.c b/ThirdParty/Ert/devel/libplot/src/plot_text.c new file mode 100644 index 0000000000..614724d69a --- /dev/null +++ b/ThirdParty/Ert/devel/libplot/src/plot_text.c @@ -0,0 +1,91 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'plot_text.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + + +#include + +#include +#include + +#include + +#define PLOT_TEXT_TYPE_ID 660991 +struct plot_text_struct { + UTIL_TYPE_ID_DECLARATION; + double xpos; + double ypos; + double font_scale; + char * text; +}; + + +static UTIL_SAFE_CAST_FUNCTION(plot_text , PLOT_TEXT_TYPE_ID ) +UTIL_IS_INSTANCE_FUNCTION( plot_text , PLOT_TEXT_TYPE_ID) + +plot_text_type * plot_text_alloc( double xpos , double ypos , double font_scale , const char * text) { + if (text) { + plot_text_type * plot_text = util_malloc( sizeof * plot_text ); + + UTIL_TYPE_ID_INIT( plot_text , PLOT_TEXT_TYPE_ID ); + plot_text->xpos = xpos; + plot_text->ypos = ypos; + plot_text->font_scale = font_scale; + plot_text->text = util_alloc_string_copy( text ); + + return plot_text; + } else + return NULL; +} + + + +void plot_text_free( plot_text_type * plot_text ) { + free( plot_text->text ); + free( plot_text ); +} + + + +void plot_text_free__( void * arg) { + plot_text_type * plot_text = plot_text_safe_cast( arg ); + plot_text_free( plot_text ); +} + + + + +double plot_text_get_x( const plot_text_type * plot_text ) { + return plot_text->xpos; +} + +double plot_text_get_y( const plot_text_type * plot_text ) { + return plot_text->ypos; +} + +double plot_text_get_font_scale( const plot_text_type * plot_text ) { + return plot_text->font_scale; +} + +const char * plot_text_get_text( const plot_text_type * plot_text ) { + return plot_text->text; +} + + +void plot_text_update_range( const plot_text_type * plot_text , plot_range_type * range) { + plot_range_update( range , plot_text_get_x( plot_text ), plot_text_get_y( plot_text )); +} diff --git a/ThirdParty/Ert/devel/libplot/src/plplot_driver.c b/ThirdParty/Ert/devel/libplot/src/plplot_driver.c index 3b581f7381..d37a8b5771 100644 --- a/ThirdParty/Ert/devel/libplot/src/plplot_driver.c +++ b/ThirdParty/Ert/devel/libplot/src/plplot_driver.c @@ -21,14 +21,16 @@ #include #include +#include + #include #include +#include -#include - +#include #include #include - +#include typedef struct { @@ -68,6 +70,8 @@ static void plplot_state_set_log( plplot_state_type * state , bool logx , bool l } + + static plplot_state_type * plplot_state_alloc( const void * init_arg ) { plplot_state_type * state = util_malloc( sizeof * state ); state->stream = 0; @@ -113,7 +117,7 @@ static void plplot_state_close( plplot_state_type * state ) { -static void plplot_close_driver( plot_driver_type * driver ) { +void plplot_close_driver( plot_driver_type * driver ) { plplot_state_close( driver->state ); } @@ -170,14 +174,12 @@ static void plplot_set_labels( plot_driver_type * driver , const char * title , -static void plplot_set_axis(plot_driver_type * driver , plot_range_type * range , const char * timefmt , plot_color_type box_color , double tick_font_size) { +static void plplot_set_axis(plot_driver_type * driver , const plot_range_type * range , const char * timefmt , plot_color_type box_color , double tick_font_size) { plplot_state_type * state = driver->state; { - double xmin = plot_range_get_final_xmin( range ); - double xmax = plot_range_get_final_xmax( range ); - double ymin = plot_range_get_final_ymin( range ); - double ymax = plot_range_get_final_ymax( range ); - plplot_state_type * state = driver->state; + double xmin , xmax , ymin , ymax; + plot_range_get_limits( range , &xmin , &xmax , &ymin , &ymax); + if (state->logx) { xmin = log( xmin ); xmax = log( xmax ); @@ -354,6 +356,35 @@ void plplot_plot_hist( plot_driver_type * driver, const char * label , double_ve +void plplot_text( plot_driver_type * driver , const plot_text_type * plot_text) { + double just = 0.0; // Left justified + plschr( 0.0 , plot_text_get_font_scale( plot_text ) ); + plcol0( BLACK ); + + plptex( plot_text_get_x( plot_text ) , + plot_text_get_y( plot_text ) , + 1 , 0 , just , + plot_text_get_text( plot_text )); + + plschr( 0.0 , 1.0 ); +} + + +bool plplot_driver_check_init_arg( const void * init_arg ) { + if (arg_pack_is_instance( init_arg )) { + const arg_pack_type * arg_pack = arg_pack_safe_cast_const( init_arg ); + if (arg_pack_size( arg_pack ) == 2) { + if ((arg_pack_iget_ctype( arg_pack , 0 ) == CTYPE_VOID_POINTER) && + (arg_pack_iget_ctype( arg_pack , 1 ) == CTYPE_VOID_POINTER)) + return true; + else + return false; + } else + return false; + } else + return false; +} + /** This function allocates a plplot based plot driver. The init_arg @@ -374,19 +405,22 @@ void plplot_plot_hist( plot_driver_type * driver, const char * label , double_ve */ plot_driver_type * plplot_driver_alloc(const void * init_arg) { - plot_driver_type * driver = plot_driver_alloc_empty("PLPLOT"); - driver->state = plplot_state_alloc( init_arg ); - - driver->close_driver = plplot_close_driver; - driver->set_window_size = plplot_set_window_size; - driver->set_labels = plplot_set_labels; - driver->set_axis = plplot_set_axis; - - driver->plot_xy = plplot_plot_xy; - driver->plot_xy1y2 = plplot_plot_xy1y2; - driver->plot_x1x2y = plplot_plot_x1x2y; - driver->plot_hist = plplot_plot_hist; - driver->set_log = plplot_set_log; - - return driver; + if (plplot_driver_check_init_arg( init_arg )) { + plot_driver_type * driver = plot_driver_alloc_empty("PLPLOT"); + driver->state = plplot_state_alloc( init_arg ); + + driver->close_driver = plplot_close_driver; + driver->set_window_size = plplot_set_window_size; + driver->set_labels = plplot_set_labels; + driver->set_axis = plplot_set_axis; + + driver->plot_xy = plplot_plot_xy; + driver->plot_xy1y2 = plplot_plot_xy1y2; + driver->plot_x1x2y = plplot_plot_x1x2y; + driver->plot_hist = plplot_plot_hist; + driver->set_log = plplot_set_log; + driver->text = plplot_text; + return driver; + } else + return NULL; } diff --git a/ThirdParty/Ert/devel/libplot/src/summary_plot_live.c b/ThirdParty/Ert/devel/libplot/src/summary_plot_live.c index 1e848f5245..3ed8427930 100644 --- a/ThirdParty/Ert/devel/libplot/src/summary_plot_live.c +++ b/ThirdParty/Ert/devel/libplot/src/summary_plot_live.c @@ -434,7 +434,7 @@ config_type *summary_plot_init_config(const char *config_file) /* Change Path to your enkf config dir */ char *path; util_alloc_file_components(config_file, &path, NULL, NULL); - chdir(path); + util_chdir(path); util_safe_free(path); } return config; diff --git a/ThirdParty/Ert/devel/libplot/tests/CMakeLists.txt b/ThirdParty/Ert/devel/libplot/tests/CMakeLists.txt new file mode 100644 index 0000000000..798c14aa7b --- /dev/null +++ b/ThirdParty/Ert/devel/libplot/tests/CMakeLists.txt @@ -0,0 +1,11 @@ +add_executable( plot_text plot_text.c ) +target_link_libraries( plot_text plot test_util) +add_test( plot_text ${EXECUTABLE_OUTPUT_PATH}/plot_text ) + +add_executable( plot_plplot plot_plplot.c ) +target_link_libraries( plot_plplot plot test_util) +add_test( plot_plplot ${EXECUTABLE_OUTPUT_PATH}/plot_plplot ) + +add_executable( plot_range plot_range.c ) +target_link_libraries( plot_range plot test_util) +add_test( plot_range ${EXECUTABLE_OUTPUT_PATH}/plot_range ) diff --git a/ThirdParty/Ert/devel/libplot/tests/plot_plplot.c b/ThirdParty/Ert/devel/libplot/tests/plot_plplot.c new file mode 100644 index 0000000000..2804c7daa0 --- /dev/null +++ b/ThirdParty/Ert/devel/libplot/tests/plot_plplot.c @@ -0,0 +1,94 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'plot_plplot.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + + +#include + +#include +#include + +#include +#include + + + +void test_create_PLPLOT_driver() { + arg_pack_type * arg = arg_pack_alloc(); + arg_pack_append_ptr( arg , "FILE.png" ); + arg_pack_append_ptr( arg , "png"); + { + plot_driver_type * plplot_driver = plplot_driver_alloc( arg ); + + plplot_close_driver( plplot_driver ); + } + arg_pack_free( arg ); +} + + +void test_create_PLPLOT_driver_invalid_arg() { + + test_assert_NULL( plplot_driver_alloc( NULL )); + test_assert_NULL( plplot_driver_alloc( "Invalid" )); + + { + arg_pack_type * arg = arg_pack_alloc(); + test_assert_NULL( plplot_driver_alloc( arg )); + + arg_pack_append_int( arg , 1 ); + arg_pack_append_int( arg , 1 ); + test_assert_NULL( plplot_driver_alloc( arg )); + arg_pack_free( arg ); + } +} + + + + + +void test_create_PLPLOT_invalid_arg( ) { + plot_type * plot = plot_alloc("PLPLOT" , NULL , false , false); + + test_assert_NULL( plot ); +} + + +void test_create_PLPLOT( ) { + plot_type * plot; + arg_pack_type * arg = arg_pack_alloc(); + arg_pack_append_ptr( arg , "FILE.png" ); + arg_pack_append_ptr( arg , "png"); + + plot = plot_alloc("PLPLOT" , arg , false , false); + + test_assert_true( plot_is_instance( plot )); + plot_free( plot ); + arg_pack_free( arg ); +} + + + +int main(int argc , char ** argv) { + + test_create_PLPLOT_driver(); + test_create_PLPLOT_driver_invalid_arg(); + + test_create_PLPLOT(); + test_create_PLPLOT_invalid_arg(); + + exit(0); +} diff --git a/ThirdParty/Ert/devel/libplot/tests/plot_range.c b/ThirdParty/Ert/devel/libplot/tests/plot_range.c new file mode 100644 index 0000000000..a97fac5080 --- /dev/null +++ b/ThirdParty/Ert/devel/libplot/tests/plot_range.c @@ -0,0 +1,315 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'plot_range.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + + +#include +#include + +#include +#include + +#include + +void test_create_range() { + plot_range_type * range = plot_range_alloc(); + test_assert_not_NULL( range ); + plot_range_free( range ); +} + + +void test_default() { + plot_range_type * range = plot_range_alloc(); + + test_assert_double_equal( PLOT_RANGE_DEFAULT_PADDING , plot_range_get_left_padding( range )); + test_assert_double_equal( PLOT_RANGE_DEFAULT_PADDING , plot_range_get_right_padding( range )); + test_assert_double_equal( PLOT_RANGE_DEFAULT_PADDING , plot_range_get_top_padding( range )); + test_assert_double_equal( PLOT_RANGE_DEFAULT_PADDING , plot_range_get_bottom_padding( range )); + + test_assert_double_equal( PLOT_RANGE_DEFAULT_MANUAL_LIMIT , plot_range_get_manual_xmin( range )); + test_assert_double_equal( PLOT_RANGE_DEFAULT_MANUAL_LIMIT , plot_range_get_manual_xmax( range )); + test_assert_double_equal( PLOT_RANGE_DEFAULT_MANUAL_LIMIT , plot_range_get_manual_ymin( range )); + test_assert_double_equal( PLOT_RANGE_DEFAULT_MANUAL_LIMIT , plot_range_get_manual_ymax( range )); + + test_assert_false( plot_range_get_invert_x_axis( range )); + test_assert_false( plot_range_get_invert_y_axis( range )); + plot_range_set_invert_x_axis( range , true ); + plot_range_set_invert_y_axis( range , true ); + test_assert_true( plot_range_get_invert_x_axis( range )); + test_assert_true( plot_range_get_invert_y_axis( range )); + + plot_range_free( range ); +} + + +void test_empty_range() { + plot_range_type * range = plot_range_alloc(); + + { + double x = 10; + double y = 78; + + plot_range_update( range , x , y ); + test_assert_double_equal( plot_range_get_current_xmin( range ) , x ); + test_assert_double_equal( plot_range_get_current_xmax( range ) , x ); + test_assert_double_equal( plot_range_get_current_ymin( range ) , y ); + test_assert_double_equal( plot_range_get_current_ymax( range ) , y ); + } + plot_range_free( range ); +} + + +void test_empty_range_xy() { + plot_range_type * range = plot_range_alloc(); + + { + double x = 10; + double y = 78; + + plot_range_update_x( range , x ); + plot_range_update_y( range , y ); + + test_assert_double_equal( plot_range_get_current_xmin( range ) , x ); + test_assert_double_equal( plot_range_get_current_xmax( range ) , x ); + test_assert_double_equal( plot_range_get_current_ymin( range ) , y ); + test_assert_double_equal( plot_range_get_current_ymax( range ) , y ); + } + plot_range_free( range ); +} + + +void test_update_vector() { + plot_range_type * range = plot_range_alloc(); + double_vector_type * xl = double_vector_alloc(0,0); + double_vector_type * yl = double_vector_alloc(0,0); + const int N = 100; + int i; + + for (i=0; i < N; i++) { + double x = 2*3.14159265 * i / (N - 1); + + double_vector_append( xl , sin(x)); + double_vector_append( yl , cos(x)); + } + plot_range_update_vector( range , xl , yl ); + + test_assert_double_equal( plot_range_get_current_xmin( range ) , -1 ); + test_assert_double_equal( plot_range_get_current_xmax( range ) , 1 ); + test_assert_double_equal( plot_range_get_current_ymin( range ) , -1 ); + test_assert_double_equal( plot_range_get_current_ymax( range ) , 1 ); + + for (i=0; i < N; i++) { + double x = 2*3.14159265 * i / (N - 1); + + double_vector_append( xl , 2*sin(x)); + double_vector_append( yl , 2*cos(x)); + } + plot_range_update_vector_x( range , xl ); + plot_range_update_vector_y( range , yl ); + + test_assert_double_equal( plot_range_get_current_xmin( range ) , -2 ); + test_assert_double_equal( plot_range_get_current_xmax( range ) , 2 ); + test_assert_double_equal( plot_range_get_current_ymin( range ) , -2 ); + test_assert_double_equal( plot_range_get_current_ymax( range ) , 2 ); + + plot_range_free( range ); + double_vector_free( xl ); + double_vector_free( yl ); +} + + +void test_update_range() { + plot_range_type * range = plot_range_alloc(); + + double xmin = -1; + double xmax = 1; + double ymin = -1; + double ymax = 1; + + plot_range_update( range , 0 , 0 ); + plot_range_update( range , 0.5 , 0.5 ); + plot_range_update( range , 1.0 , 0.5 ); + plot_range_update( range , 0.0 , -1.0 ); + plot_range_update( range , -0.5 , -1.0 ); + plot_range_update( range , -1.0 , 1.0 ); + + test_assert_double_equal( xmin , plot_range_get_current_xmin( range ) ); + test_assert_double_equal( xmax , plot_range_get_current_xmax( range ) ); + test_assert_double_equal( ymin , plot_range_get_current_ymin( range ) ); + test_assert_double_equal( ymax , plot_range_get_current_ymax( range ) ); + + plot_range_free( range ); +} + + + +void test_limits_default() { + plot_range_type * range = plot_range_alloc(); + double xmin = -1; + double xmax = 1; + double ymin = -2; + double ymax = 2; + + + plot_range_update( range , 0 , 0 ); + plot_range_update( range , 0.5 , 0.5 ); + plot_range_update( range , xmax , 0.5 ); + plot_range_update( range , 0.0 , ymin ); + plot_range_update( range , -0.5 , -1.0 ); + plot_range_update( range , xmin , ymax ); + + plot_range_set_invert_x_axis( range , false ); + plot_range_set_invert_y_axis( range , false ); + { + double x1 , x2 , y1 , y2; + double w = fabs(xmax - xmin); + double h = fabs(ymax - ymin); + + plot_range_get_limits( range , &x1 , &x2 , &y1 , &y2 ); + test_assert_double_equal( xmin - w*0.025 , x1 ); + test_assert_double_equal( xmax + w*0.025 , x2 ); + test_assert_double_equal( ymin - h*0.025 , y1 ); + test_assert_double_equal( ymax + h*0.025 , y2 ); + } + plot_range_free( range ); +} + + +void test_limits_manual() { + plot_range_type * range = plot_range_alloc(); + double xmin = -1; + double xmax = 1; + double ymin = -2; + double ymax = 2; + + + plot_range_update( range , 0 , 0 ); + plot_range_update( range , 0.5 , 0.5 ); + plot_range_update( range , xmax , 0.5 ); + plot_range_update( range , 0.0 , ymin ); + plot_range_update( range , -0.5 , -1.0 ); + plot_range_update( range , xmin , ymax ); + + plot_range_set_manual_xmax( range , 2*xmax ); + plot_range_set_manual_ymin( range , 2*ymin ); + + + { + double x1 , x2 , y1 , y2; + double w = fabs(2*xmax - xmin); + double h = fabs(ymax - 2*ymin); + + plot_range_get_limits( range , &x1 , &x2 , &y1 , &y2 ); + + test_assert_double_equal( xmin - w*0.025 , x1 ); + test_assert_double_equal( 2*xmax , x2 ); + test_assert_double_equal( 2*ymin , y1 ); + test_assert_double_equal( ymax + h*0.025 , y2 ); + } + plot_range_free( range ); +} + + +void test_limits_inverted() { + plot_range_type * range = plot_range_alloc(); + double xmin = 0; + double xmax = 100; + double ymin = 0; + double ymax = 1000; + + + plot_range_update( range , xmin , ymin ); + plot_range_update( range , xmax , ymin ); + plot_range_update( range , xmin , ymax ); + plot_range_update( range , xmax , ymax ); + + plot_range_set_left_padding( range , 0.50 ); + plot_range_set_right_padding( range , 0.10 ); + plot_range_set_top_padding( range , 0.50 ); + plot_range_set_bottom_padding( range , 0.10 ); + + plot_range_set_invert_x_axis( range , true ); + plot_range_set_invert_y_axis( range , true ); + { + double x1 , x2 , y1 , y2; + + plot_range_get_limits( range , &x1 , &x2 , &y1 , &y2 ); + + test_assert_double_equal(150 , x1 ); + test_assert_double_equal(-10 , x2 ); + + test_assert_double_equal(1100 , y1 ); + test_assert_double_equal(-500 , y2 ); + } + plot_range_free( range ); +} + + + + + + +void test_set_manual1() { + plot_range_type * range = plot_range_alloc(); + double xmin = -1; + double xmax = 1; + double ymin = -2; + double ymax = 2; + + + plot_range_set_manual_xmin( range , xmin ); + test_assert_double_equal( xmin , plot_range_get_manual_xmin( range )); + plot_range_unset_manual_xmin( range ); + test_assert_double_equal( PLOT_RANGE_DEFAULT_MANUAL_LIMIT , plot_range_get_manual_xmin( range )); + + + plot_range_set_manual_xmax( range , xmax ); + test_assert_double_equal( xmax , plot_range_get_manual_xmax( range )); + plot_range_unset_manual_xmax( range ); + test_assert_double_equal( PLOT_RANGE_DEFAULT_MANUAL_LIMIT , plot_range_get_manual_xmax( range )); + + + plot_range_set_manual_ymin( range , ymin ); + test_assert_double_equal( ymin , plot_range_get_manual_ymin( range )); + plot_range_unset_manual_ymin( range ); + test_assert_double_equal( PLOT_RANGE_DEFAULT_MANUAL_LIMIT , plot_range_get_manual_ymin( range )); + + + plot_range_set_manual_ymax( range , ymax ); + test_assert_double_equal( ymax , plot_range_get_manual_ymax( range )); + plot_range_unset_manual_ymax( range ); + test_assert_double_equal( PLOT_RANGE_DEFAULT_MANUAL_LIMIT , plot_range_get_manual_ymax( range )); + + plot_range_free( range ); +} + + + +int main(int argc , char ** argv) { + + test_create_range(); + test_default(); + test_empty_range( ); + test_update_range(); + test_set_manual1( ); + + test_limits_default( ); + test_limits_manual( ); + test_limits_inverted( ); + + exit(0); +} diff --git a/ThirdParty/Ert/devel/libplot/tests/plot_text.c b/ThirdParty/Ert/devel/libplot/tests/plot_text.c new file mode 100644 index 0000000000..e7c0fc4365 --- /dev/null +++ b/ThirdParty/Ert/devel/libplot/tests/plot_text.c @@ -0,0 +1,80 @@ +/* + Copyright (C) 2013 Statoil ASA, Norway. + + The file 'plot_text.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ERT is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License at + for more details. +*/ + + +#include + +#include + +#include +#include + +void test_create_normal( ) { + double xpos = 0.0; + double ypos = 1.0; + double font_scale = 0.07; + + const char * text = "Bjarne"; + plot_text_type * plot_text = plot_text_alloc( xpos , ypos , font_scale , text ); + + test_assert_true( plot_text_is_instance( plot_text )); + test_assert_string_equal( text , plot_text_get_text( plot_text )); + test_assert_double_equal( xpos , plot_text_get_x( plot_text )); + test_assert_double_equal( ypos , plot_text_get_y( plot_text )); + test_assert_double_equal( font_scale , plot_text_get_font_scale( plot_text )); + + plot_text_free( plot_text ); +} + + +void test_create_NULL_content( ) { + plot_text_type * plot_text = plot_text_alloc( 1.0 , 1.0 , 1.0 , NULL ); + + test_assert_NULL( plot_text ); +} + + +void test_update_range() { + double xpos = 1.56; + double ypos = 1.0; + double font_scale = 0.07; + + const char * text = "Bjarne"; + plot_text_type * plot_text = plot_text_alloc( xpos , ypos , font_scale , text ); + plot_range_type * plot_range = plot_range_alloc(); + + plot_text_update_range( plot_text , plot_range ); + + test_assert_double_equal( xpos , plot_range_get_current_xmin( plot_range )); + test_assert_double_equal( xpos , plot_range_get_current_xmax( plot_range )); + test_assert_double_equal( ypos , plot_range_get_current_ymin( plot_range )); + test_assert_double_equal( ypos , plot_range_get_current_ymax( plot_range )); +} + + + + + +int main(int argc , char ** argv) { + + test_create_normal( ); + test_create_NULL_content( ); + test_update_range( ); + + exit(0); +} diff --git a/ThirdParty/Ert/devel/python/python/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/CMakeLists.txt index 4e27dd7af2..5f83b699c2 100644 --- a/ThirdParty/Ert/devel/python/python/CMakeLists.txt +++ b/ThirdParty/Ert/devel/python/python/CMakeLists.txt @@ -1,3 +1,13 @@ +include(cmake/find_python_module.cmake) +if (ERT_BUILD_GUI) + FIND_PACKAGE(PythonInterp 2.6 REQUIRED) + find_python_module(PyQt4 REQUIRED) +else() + FIND_PACKAGE(PythonInterp 2.6 REQUIRED) +endif() + add_subdirectory( ert ) -add_subdirectory( ert_gui ) +if (ERT_BUILD_GUI) + add_subdirectory( ert_gui ) +endif() diff --git a/ThirdParty/Ert/devel/python/python/cmake/find_python_module.cmake b/ThirdParty/Ert/devel/python/python/cmake/find_python_module.cmake new file mode 100644 index 0000000000..a0218650b3 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/cmake/find_python_module.cmake @@ -0,0 +1,27 @@ +# Found from: github user ivansafrin +# +# Find if a Python module is installed +# Found at http://www.cmake.org/pipermail/cmake/2011-January/041666.html +# To use do: find_python_module(PyQt4 REQUIRED) +function(find_python_module module) + string(TOUPPER ${module} module_upper) + if(NOT PY_${module_upper}) + if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED") + set(${module}_FIND_REQUIRED TRUE) + endif() + # A module's location is usually a directory, but for binary modules + # it's a .so file. + execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" + "import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))" + RESULT_VARIABLE _${module}_status + OUTPUT_VARIABLE _${module}_location + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(NOT _${module}_status) + set(PY_${module_upper} ${_${module}_location} CACHE STRING + "Location of Python module ${module}") + endif() + endif(NOT PY_${module_upper}) + find_package_handle_standard_args(PY_${module} DEFAULT_MSG PY_${module_upper}) +endfunction(find_python_module) diff --git a/ThirdParty/Ert/devel/python/python/ert/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert/CMakeLists.txt index 48c01a8417..4c85af0b1c 100644 --- a/ThirdParty/Ert/devel/python/python/ert/CMakeLists.txt +++ b/ThirdParty/Ert/devel/python/python/ert/CMakeLists.txt @@ -10,4 +10,5 @@ add_subdirectory( rms ) add_subdirectory( sched ) add_subdirectory( util ) add_subdirectory( well ) -add_subdirectory( ert ) +add_subdirectory( test_run ) +add_subdirectory( analysis ) diff --git a/ThirdParty/Ert/devel/python/python/ert/__init__.py b/ThirdParty/Ert/devel/python/python/ert/__init__.py index c0ee8c64e8..78d1e14454 100644 --- a/ThirdParty/Ert/devel/python/python/ert/__init__.py +++ b/ThirdParty/Ert/devel/python/python/ert/__init__.py @@ -59,8 +59,10 @@ """ import os.path import cwrap.clib +import sys +import warnings - +required_version_hex = 0x02060000 ert_lib_path = os.getenv("ERT_LIBRARY_PATH") if ert_lib_path: @@ -75,3 +77,7 @@ ert_lib_path = None cwrap.clib.ert_lib_path = ert_lib_path + +if sys.hexversion < required_version_hex: + raise Exception("ERT Python requires at least version 2.6 of Python") + diff --git a/ThirdParty/Ert/devel/python/python/ert/analysis/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert/analysis/CMakeLists.txt new file mode 100644 index 0000000000..1e7fe0c874 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/analysis/CMakeLists.txt @@ -0,0 +1,6 @@ +add_subdirectory( enums ) + +SET(PYTHON_SOURCES + __init__.py ) + +add_python_package("Python ert.analysis" ${PYTHON_INSTALL_PREFIX}/ert/analysis "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/__init__.py b/ThirdParty/Ert/devel/python/python/ert/analysis/__init__.py similarity index 78% rename from ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/__init__.py rename to ThirdParty/Ert/devel/python/python/ert/analysis/__init__.py index 79c95cf38a..a3a4c00514 100644 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/__init__.py +++ b/ThirdParty/Ert/devel/python/python/ert/analysis/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2011 Statoil ASA, Norway. +# Copyright (C) 2013 Statoil ASA, Norway. # # The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool. # @@ -15,3 +15,8 @@ # for more details. +import ert.cwrap.clib as clib +ANALYSIS_LIB = clib.ert_load("libanalysis.so") + +from .enums import AnalysisModuleOptionsEnum + diff --git a/ThirdParty/Ert/devel/python/python/ert/analysis/enums/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert/analysis/enums/CMakeLists.txt new file mode 100644 index 0000000000..d49c23bd1f --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/analysis/enums/CMakeLists.txt @@ -0,0 +1,5 @@ +SET(PYTHON_SOURCES + __init__.py + analysis_module_options_enum.py ) + +add_python_package("Python ert.analysis.enums" ${PYTHON_INSTALL_PREFIX}/ert/analysis/enums "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/devel/python/python/ert/analysis/enums/__init__.py b/ThirdParty/Ert/devel/python/python/ert/analysis/enums/__init__.py new file mode 100644 index 0000000000..973d842dd3 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/analysis/enums/__init__.py @@ -0,0 +1 @@ +from .analysis_module_options_enum import AnalysisModuleOptionsEnum diff --git a/ThirdParty/Ert/devel/python/python/ert/analysis/enums/analysis_module_options_enum.py b/ThirdParty/Ert/devel/python/python/ert/analysis/enums/analysis_module_options_enum.py new file mode 100644 index 0000000000..ee4b9bc6b7 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/analysis/enums/analysis_module_options_enum.py @@ -0,0 +1,31 @@ +# Copyright (C) 2013 Statoil ASA, Norway. +# +# The file 'analysis_module_options_enum.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +from ert.cwrap import BaseCEnum +from ert.analysis import ANALYSIS_LIB + + +class AnalysisModuleOptionsEnum(BaseCEnum): + ANALYSIS_NEED_ED = None + ANALYSIS_USE_A = None + ANALYSIS_UPDATE_A = None + ANALYSIS_SCALE_DATA = None + ANALYSIS_ITERABLE = None + +AnalysisModuleOptionsEnum.populateEnum(ANALYSIS_LIB , "analysis_module_flag_enum_iget") +AnalysisModuleOptionsEnum.registerEnum(ANALYSIS_LIB , "analysis_module_options_enum") + + + diff --git a/ThirdParty/Ert/devel/python/python/ert/cwrap/basecclass.py b/ThirdParty/Ert/devel/python/python/ert/cwrap/basecclass.py index 25ad1d7ecc..5c3661fb23 100644 --- a/ThirdParty/Ert/devel/python/python/ert/cwrap/basecclass.py +++ b/ThirdParty/Ert/devel/python/python/ert/cwrap/basecclass.py @@ -6,16 +6,20 @@ class BaseCClass(object): namespaces = {} def __init__(self, c_pointer, parent=None, is_reference=False): - self._c_pointer = None - self._parent = None - self._is_reference = False - if not c_pointer > 0: raise ValueError("Must have a valid pointer value!") - self._c_pointer = c_pointer - self._parent = parent - self._is_reference = is_reference + self.__c_pointer = c_pointer + self.__parent = parent + self.__is_reference = is_reference + + def __new__(cls, *more, **kwargs): + obj = super(BaseCClass, cls).__new__(cls, *more, **kwargs) + obj.__c_pointer = None + obj.__parent = None + obj.__is_reference = False + + return obj @classmethod @@ -27,13 +31,13 @@ def cNamespace(cls): @classmethod def from_param(cls, c_class_object): - if not isinstance(c_class_object, BaseCClass): - raise ValueError("c_class_object must be an BaseCClass instance!") + if c_class_object is not None and not isinstance(c_class_object, BaseCClass): + raise ValueError("c_class_object must be a BaseCClass instance!") - if c_class_object is None or not hasattr(c_class_object, "_c_pointer"): + if c_class_object is None: return ctypes.c_void_p() else: - return ctypes.c_void_p(c_class_object._c_pointer) + return ctypes.c_void_p(c_class_object.__c_pointer) @classmethod def createPythonObject(cls, c_pointer): @@ -51,9 +55,14 @@ def createCReference(cls, c_pointer, parent=None): return new_obj return None + def convertToCReference(self, parent): + self.__is_reference = True + self.__parent = parent + + def setParent(self, parent=None): - if self._is_reference: - self._parent = parent + if self.__is_reference: + self.__parent = parent else: raise UserWarning("Can only set parent on reference types!") @@ -61,18 +70,24 @@ def setParent(self, parent=None): def isReference(self): """ @rtype: bool """ - return self._is_reference + return self.__is_reference def parent(self): - return self._parent + return self.__parent + + def __eq__(self, other): + if isinstance(other, BaseCClass): + return self.__c_pointer == other.__c_pointer + + super(BaseCClass, self).__eq__(other) def free(self): raise NotImplementedError("A CClass requires a free method implementation!") def __del__(self): if self.free is not None: - if hasattr(self, "_is_reference") and not self._is_reference: + if not self.__is_reference: # Important to check the c_pointer; in the case of failed object creation # we can have a Python object with c_pointer == None. - if self._c_pointer > 0: + if self.__c_pointer > 0: self.free() \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert/cwrap/basecenum.py b/ThirdParty/Ert/devel/python/python/ert/cwrap/basecenum.py index 4a62274df3..2274c5a105 100644 --- a/ThirdParty/Ert/devel/python/python/ert/cwrap/basecenum.py +++ b/ThirdParty/Ert/devel/python/python/ert/cwrap/basecenum.py @@ -82,6 +82,12 @@ def __and__(self, other): value = self.value & other.value return self.__resolveOrCreateEnum(value) + def __int__(self): + return self.value + + def __contains__(self, item): + return self & item == item + @classmethod def __createEnum(cls, value): enum = cls.__new__(cls) @@ -115,7 +121,7 @@ def populateEnum(cls, library, enum_provider_function): try: func = getattr(library, enum_provider_function) except AttributeError: - raise ValueError("Could not find enum description function:%s - can not load enum:%s." % (enum_provider_function, cls.__name__)) + raise ValueError("Could not find enum description function: %s - can not load enum: %s." % (enum_provider_function, cls.__name__)) func.restype = ctypes.c_char_p func.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_int)] diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert/enkf/CMakeLists.txt index 6b1c01ce7e..b5b7712a26 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/CMakeLists.txt +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/CMakeLists.txt @@ -1,12 +1,9 @@ -add_subdirectory( data ) -add_subdirectory( util ) - set(PYTHON_SOURCES __init__.py analysis_config.py + analysis_iter_config.py block_obs.py ecl_config.py - enkf_enum.py enkf_fs.py enkf_main.py enkf_obs.py @@ -20,6 +17,9 @@ set(PYTHON_SOURCES site_config.py ) -add_python_package("Python ert.enkf" ${PYTHON_INSTALL_PREFIX}/ert/enkf "${PYTHON_SOURCES}" True) - +add_python_package("Python ert.enkf" ${PYTHON_INSTALL_PREFIX}/ert/enkf "${PYTHON_SOURCES}" True) +add_subdirectory(data) +add_subdirectory(enums) +add_subdirectory(observations) +add_subdirectory(util) diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/__init__.py b/ThirdParty/Ert/devel/python/python/ert/enkf/__init__.py index 058d16293b..3e3250058c 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/__init__.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/__init__.py @@ -17,17 +17,21 @@ import ert.cwrap.clib as clib -clib.ert_load("libanalysis.so") +import ert.analysis ENKF_LIB = clib.ert_load("libenkf.so") -from ert.enkf.util import ObsVector, TimeMap +from .enums import EnkfStateType, EnkfVarType, EnkfRunEnum, LoadFailTypeEnum, EnkfObservationImplementationType -from .enkf_enum import EnkfStateEnum, EnkfRunEnum +from .util import TimeMap +from .enkf_fs import EnkfFs + +from .observations import SummaryObservation, ObsVector +from .analysis_iter_config import AnalysisIterConfig from .analysis_config import AnalysisConfig from .block_obs import BlockObs from .ecl_config import EclConfig -from .enkf_fs import EnkfFs + from .enkf_obs import EnkfObs from .enkf_state import EnKFState from .ens_config import EnsConfig @@ -37,6 +41,7 @@ from .model_config import ModelConfig from .plot_config import PlotConfig from .site_config import SiteConfig +from .enkf_main import EnKFMain -from ert.enkf.data import EnkfConfigNode, EnkfNode, GenDataConfig, GenKwConfig, FieldConfig, Field +from .data import EnkfConfigNode, EnkfNode, GenDataConfig, GenKwConfig, FieldConfig, Field diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/analysis_config.py b/ThirdParty/Ert/devel/python/python/ert/enkf/analysis_config.py index e56e0fc5e2..65931a2cfd 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/analysis_config.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/analysis_config.py @@ -15,11 +15,13 @@ # for more details. from ert.cwrap import BaseCClass, CWrapper from ert.enkf import ENKF_LIB - +from ert.enkf import AnalysisIterConfig class AnalysisConfig(BaseCClass): def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") + c_ptr = AnalysisConfig.cNamespace().alloc() + super(AnalysisConfig , self).__init__(c_ptr) + def get_rerun(self): return AnalysisConfig.cNamespace().get_rerun(self) @@ -51,8 +53,36 @@ def get_merge_observations(self): def set_merge_observations(self, merge_observations): return AnalysisConfig.cNamespace().set_merge_observations(self, merge_observations) + def get_iter_config(self): + """ @rtype: AnalysisIterConfig """ + return AnalysisConfig.cNamespace().get_iter_config(self).setParent(self) + + def get_min_realisations(self): + """ @rtype: int """ + return AnalysisConfig.cNamespace().get_min_realisations( self ) + + def set_min_realisations(self , min_realisations): + AnalysisConfig.cNamespace().set_min_realisations( self , min_realisations ) + + def get_stop_long_running(self): + """ @rtype: bool """ + return AnalysisConfig.cNamespace().get_stop_long_running( self ) + + def set_stop_long_running(self, stop_long_running): + AnalysisConfig.cNamespace().set_stop_long_running(self, stop_long_running) + + def get_max_runtime(self): + """ @rtype: int """ + return AnalysisConfig.cNamespace().get_max_runtime( self ) + + def set_max_runtime(self, max_runtime): + AnalysisConfig.cNamespace().set_max_runtime( self, max_runtime ) + def free(self): AnalysisConfig.cNamespace().free(self) + + def activeModuleName(self): + return AnalysisConfig.cNamespace().get_active_module_name(self) ################################################################## @@ -61,7 +91,7 @@ def free(self): cwrapper.registerType("analysis_config_obj", AnalysisConfig.createPythonObject) cwrapper.registerType("analysis_config_ref", AnalysisConfig.createCReference) - +AnalysisConfig.cNamespace().alloc = cwrapper.prototype("c_void_p analysis_config_alloc()") AnalysisConfig.cNamespace().free = cwrapper.prototype("void analysis_config_free( analysis_config )") AnalysisConfig.cNamespace().get_rerun = cwrapper.prototype("int analysis_config_get_rerun( analysis_config )") AnalysisConfig.cNamespace().set_rerun = cwrapper.prototype("void analysis_config_set_rerun( analysis_config, bool)") @@ -73,4 +103,11 @@ def free(self): AnalysisConfig.cNamespace().set_alpha = cwrapper.prototype("void analysis_config_set_alpha(analysis_config, double)") AnalysisConfig.cNamespace().get_merge_observations = cwrapper.prototype("bool analysis_config_get_merge_observations(analysis_config)") AnalysisConfig.cNamespace().set_merge_observations = cwrapper.prototype("void analysis_config_set_merge_observations(analysis_config, bool)") - +AnalysisConfig.cNamespace().get_iter_config = cwrapper.prototype("analysis_iter_config_ref analysis_config_get_iter_config(analysis_config)") +AnalysisConfig.cNamespace().get_min_realisations = cwrapper.prototype("int analysis_config_get_min_realisations(analysis_config)") +AnalysisConfig.cNamespace().set_min_realisations = cwrapper.prototype("void analysis_config_set_min_realisations(analysis_config, int)") +AnalysisConfig.cNamespace().get_max_runtime = cwrapper.prototype("int analysis_config_get_max_runtime(analysis_config)") +AnalysisConfig.cNamespace().set_max_runtime = cwrapper.prototype("void analysis_config_set_max_runtime(analysis_config, int)") +AnalysisConfig.cNamespace().get_stop_long_running = cwrapper.prototype("bool analysis_config_get_stop_long_running(analysis_config)") +AnalysisConfig.cNamespace().set_stop_long_running = cwrapper.prototype("void analysis_config_set_stop_long_running(analysis_config, bool)") +AnalysisConfig.cNamespace().get_active_module_name = cwrapper.prototype("char* analysis_config_get_active_module_name(analysis_config)") diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/analysis_iter_config.py b/ThirdParty/Ert/devel/python/python/ert/enkf/analysis_iter_config.py new file mode 100644 index 0000000000..266d9ba1c7 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/analysis_iter_config.py @@ -0,0 +1,56 @@ +# Copyright (C) 2013 Statoil ASA, Norway. +# +# The file 'analysis_iter_config.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +from ert.cwrap import BaseCClass, CWrapper +from ert.enkf import ENKF_LIB + + +class AnalysisIterConfig(BaseCClass): + def __init__(self): + raise NotImplementedError("Class can not be instantiated directly!") + + def getNumIterations(self): + return AnalysisIterConfig.cNamespace().get_num_iterations(self) + + def setNumIterations(self, num_iterations): + AnalysisIterConfig.cNamespace().set_num_iterations(self, num_iterations) + + def getCaseFormat(self): + return AnalysisIterConfig.cNamespace().getCaseFormat(self) + + def setCaseFormat(self, case_fmt): + AnalysisIterConfig.cNamespace().setCaseFormat(self, case_fmt) + + def getRunpathFormat(self): + return AnalysisIterConfig.cNamespace().get_case_fmt(self) + + def setRunpathFormat(self, case_fmt): + AnalysisIterConfig.cNamespace().set_case_fmt(self, case_fmt) + + ################################################################## + +cwrapper = CWrapper(ENKF_LIB) +cwrapper.registerType("analysis_iter_config", AnalysisIterConfig) +cwrapper.registerType("analysis_iter_config_obj", AnalysisIterConfig.createPythonObject) +cwrapper.registerType("analysis_iter_config_ref", AnalysisIterConfig.createCReference) + + +AnalysisIterConfig.cNamespace().free = cwrapper.prototype("void analysis_iter_config_free( analysis_iter_config )") +AnalysisIterConfig.cNamespace().set_num_iterations = cwrapper.prototype("void analysis_iter_config_set_num_iterations(analysis_iter_config, int)") +AnalysisIterConfig.cNamespace().get_num_iterations = cwrapper.prototype("int analysis_iter_config_get_num_iterations(analysis_iter_config)") +AnalysisIterConfig.cNamespace().set_case_fmt = cwrapper.prototype("void analysis_iter_config_set_case_fmt( analysis_iter_config , char* )") +AnalysisIterConfig.cNamespace().get_case_fmt = cwrapper.prototype("char* analysis_iter_config_get_case_fmt( analysis_iter_config)") +AnalysisIterConfig.cNamespace().set_runpath_fmt = cwrapper.prototype("void analysis_iter_config_set_runpath_fmt( analysis_iter_config , char*)"); +AnalysisIterConfig.cNamespace().get_runpath_fmt = cwrapper.prototype("char* analysis_iter_config_get_runpath_fmt( analysis_iter_config)") diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/data/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert/enkf/data/CMakeLists.txt index 781e9765cf..cc360b1674 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/data/CMakeLists.txt +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/data/CMakeLists.txt @@ -2,11 +2,12 @@ set(PYTHON_SOURCES __init__.py enkf_config_node.py enkf_node.py - gen_data_config.py - gen_kw_config.py field.py field_config.py + gen_data_config.py + gen_kw_config.py summary_config.py ) -add_python_package("Python ert.enkf.data" ${PYTHON_INSTALL_PREFIX}/ert/enkf/data "${PYTHON_SOURCES}" True) \ No newline at end of file +add_python_package("Python ert.enkf.data" ${PYTHON_INSTALL_PREFIX}/ert/enkf/data "${PYTHON_SOURCES}" True) + diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/data/__init__.py b/ThirdParty/Ert/devel/python/python/ert/enkf/data/__init__.py index f65a6bba21..045e7a3c29 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/data/__init__.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/data/__init__.py @@ -1,10 +1,8 @@ -import ert.enkf - from .gen_data_config import GenDataConfig from .gen_kw_config import GenKwConfig from .field_config import FieldConfig from .summary_config import SummaryConfig -from .enkf_node import EnkfNode +from .enkf_node import EnkfNode from .enkf_config_node import EnkfConfigNode -from .field import Field +from .field import Field \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/data/enkf_config_node.py b/ThirdParty/Ert/devel/python/python/ert/enkf/data/enkf_config_node.py index 597ccf15bf..a31c7063f1 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/data/enkf_config_node.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/data/enkf_config_node.py @@ -16,6 +16,7 @@ from ert.cwrap import BaseCClass, CWrapper from ert.enkf import ENKF_LIB from ert.enkf.data import FieldConfig, GenDataConfig, GenKwConfig, EnkfNode, SummaryConfig +from ert.enkf.enums.load_fail_type_enum import LoadFailTypeEnum class EnkfConfigNode(BaseCClass): @@ -60,6 +61,21 @@ def alloc_node(self): def get_init_file_fmt(self): return EnkfConfigNode.cNamespace().get_init_file_fmt(self) + def getObservationKeys(self): + """ @rtype: """ + return EnkfConfigNode.cNamespace().get_obs_keys(self).setParent(self) + + @classmethod + def createSummaryConfigNode(cls, key, load_fail_type): + """ + @type key: str + @type load_fail_type: LoadFailTypeEnum + @rtype: EnkfConfigNode + """ + + assert isinstance(load_fail_type, LoadFailTypeEnum) + return EnkfConfigNode.cNamespace().alloc_summary_node(key, load_fail_type) + def free(self): EnkfConfigNode.cNamespace().free(self) @@ -93,3 +109,5 @@ def getModelConfig(self): EnkfConfigNode.cNamespace().get_enkf_infile = cwrapper.prototype("char* enkf_config_node_get_enkf_infile(enkf_config_node)") EnkfConfigNode.cNamespace().get_init_file_fmt = cwrapper.prototype("char* enkf_config_node_get_init_file_fmt(enkf_config_node)") EnkfConfigNode.cNamespace().get_var_type = cwrapper.prototype("c_void_p enkf_config_node_get_var_type(enkf_config_node)") #todo: fix return type as enum +EnkfConfigNode.cNamespace().get_obs_keys = cwrapper.prototype("stringlist_ref enkf_config_node_get_obs_keys(enkf_config_node)") +EnkfConfigNode.cNamespace().alloc_summary_node = cwrapper.prototype("enkf_config_node_obj enkf_config_node_alloc_summary(char*, load_fail_type)") diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/data/enkf_node.py b/ThirdParty/Ert/devel/python/python/ert/enkf/data/enkf_node.py index ded77f78b0..60a18e7b0d 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/data/enkf_node.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/data/enkf_node.py @@ -32,11 +32,16 @@ def user_get_vector( self, fs, key, iens, state, vector): return EnkfNode.cNamespace().user_get_vector(self, fs, key, iens, state, vector) def value_ptr(self): - EnkfNode.cNamespace().value_ptr(self) + return EnkfNode.cNamespace().value_ptr(self) def vector_storage(self): return EnkfNode.cNamespace().vector_storage(self) + def getConfig(self): + """ @rtype: EnkfConfigNode """ + #todo: fix this!!!! wrong return type in prototype! + return EnkfNode.cNamespace().get_config(self).setParent(self) + def free(self): EnkfNode.cNamespace().free(self) @@ -54,5 +59,8 @@ def free(self): EnkfNode.cNamespace().alloc = cwrapper.prototype("c_void_p enkf_node_alloc( enkf_node)") EnkfNode.cNamespace().user_get = cwrapper.prototype("bool enkf_node_user_get_no_id(enkf_node , enkf_fs , char* , int, int , c_uint, double*)") EnkfNode.cNamespace().user_get_vector = cwrapper.prototype("bool enkf_node_user_get_vector( enkf_node , enkf_fs , char*, int, c_uint, double_vector)") -EnkfNode.cNamespace().value_ptr = cwrapper.prototype("void enkf_node_value_ptr(enkf_node)") +EnkfNode.cNamespace().value_ptr = cwrapper.prototype("c_void_p enkf_node_value_ptr(enkf_node)") EnkfNode.cNamespace().vector_storage = cwrapper.prototype("bool enkf_node_vector_storage(enkf_node)") + +#todo fix this +EnkfNode.cNamespace().get_config = cwrapper.prototype("c_void_p enkf_node_get_config(enkf_node)") diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_enum.py b/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_enum.py deleted file mode 100644 index a8737d2874..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_enum.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'enkf_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - -from ert.cwrap.cenum import create_enum -from ert.enkf import ENKF_LIB - -EnkfStateEnum = create_enum(ENKF_LIB, "enkf_state_enum_iget", "enkf_state_enum") -EnkfRunEnum = create_enum(ENKF_LIB, "enkf_run_enum_iget", "enkf_run_enum") - - diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_fs.py b/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_fs.py index e84f041def..6e97194bda 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_fs.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_fs.py @@ -40,6 +40,10 @@ def fread_vector(self, key, type, member, value): def get_time_map(self): return EnkfFs.cNamespace().get_time_map(self).setParent(self) + def getCaseName(self): + """ @rtype: str """ + return EnkfFs.cNamespace().get_case_name(self) + @classmethod def exists(cls, path): return cls.cNamespace().exists(path) @@ -61,3 +65,4 @@ def free(self): EnkfFs.cNamespace().fread_vector = cwrapper.prototype("void enkf_fs_fread_vector(enkf_fs, buffer, char*, c_uint, int, c_uint)") EnkfFs.cNamespace().get_time_map = cwrapper.prototype("time_map_ref enkf_fs_get_time_map(enkf_fs)") EnkfFs.cNamespace().exists = cwrapper.prototype("bool enkf_fs_exists(char*)") +EnkfFs.cNamespace().get_case_name = cwrapper.prototype("char* enkf_fs_get_case_name(enkf_fs)") diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_main.py b/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_main.py index 0c9e42aaf1..f2eeaf113b 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_main.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_main.py @@ -14,10 +14,11 @@ # See the GNU General Public License at # for more details. from ert.cwrap import BaseCClass, CWrapper +from ert.enkf.enums.enkf_state_type_enum import EnkfStateType -from ert.util import Log -from ert.enkf import AnalysisConfig, EclConfig, EnkfObs, EnKFState, ErtTemplates, LocalConfig, ModelConfig, EnsConfig, PlotConfig, SiteConfig, ENKF_LIB -from ert.util import SubstitutionList +from ert.util import Log, BoolVector +from ert.enkf import AnalysisConfig, EclConfig, EnkfObs, EnKFState, ErtTemplates, LocalConfig, ModelConfig, EnsConfig, PlotConfig, SiteConfig, ENKF_LIB, EnkfFs +from ert.util import SubstitutionList, StringList class EnKFMain(BaseCClass): @@ -26,16 +27,38 @@ def __init__(self, model_config, site_config, strict=True): super(EnKFMain, self).__init__(c_ptr) + def getFileSystem(self): + """ @rtype: EnkfFs """ + return EnKFMain.cNamespace().get_fs(self).setParent(self) + + def getCaseList(self): + """ @rtype: StringList """ + return EnKFMain.cNamespace().alloc_caselist(self) + + # def getCurrentFileSystem(self): + # """ @rtype: str """ + # return EnKFMain.cNamespace().get_current_fs(self) + + def userSelectFileSystem(self, input_case): + EnKFMain.cNamespace().user_select_fs(self, input_case) + + + + def set_eclbase(self, eclbase): EnKFMain.cNamespace().set_eclbase(self, eclbase) def free(self): EnKFMain.cNamespace().free(self) - def ens_size( self ): - return EnKFMain.cNamespace().ens_size(self) + def getEnsembleSize( self ): + """ @rtype: int """ + return EnKFMain.cNamespace().get_ensemble_size(self) - def ensemble_config(self): + def resizeEnsemble(self, value): + EnKFMain.cNamespace().resize_ensemble(self, value) + + def ensembleConfig(self): """ @rtype: EnsConfig """ return EnKFMain.cNamespace().get_ens_config(self).setParent(self) @@ -43,7 +66,7 @@ def analysis_config(self): """ @rtype: AnalysisConfig """ return EnKFMain.cNamespace().get_analysis_config(self).setParent(self) - def model_config(self): + def getModelConfig(self): """ @rtype: ModelConfig """ return EnKFMain.cNamespace().get_model_config(self).setParent(self) @@ -55,7 +78,7 @@ def local_config(self): """ @rtype: LocalConfig """ return EnKFMain.cNamespace().get_local_config(self).setParent(self) - def site_config(self): + def siteConfig(self): """ @rtype: SiteConfig """ return EnKFMain.cNamespace().get_site_config(self).setParent(self) @@ -91,13 +114,13 @@ def addDataKW(self, key, value): EnKFMain.cNamespace().add_data_kw(self, key, value) - def resize_ensemble(self, value): - EnKFMain.cNamespace().resize_ensemble(self, value) + def del_node(self, key): EnKFMain.cNamespace().del_node(self, key) - def get_obs(self): + def getObservations(self): + """ @rtype: EnkfObs """ return EnKFMain.cNamespace().get_obs(self).setParent(self) def load_obs(self, obs_config_file): @@ -130,18 +153,18 @@ def get_site_config_file(self): site_conf_file = EnKFMain.cNamespace().get_site_config_file(self) return site_conf_file - def initialize_from_scratch(self, parameter_list, iens1, iens2, force_init=True): + def initializeFromScratch(self, parameter_list, iens1, iens2, force_init=True): EnKFMain.cNamespace().initialize_from_scratch(self, parameter_list, iens1, iens2, force_init) - def get_fs(self): - """ @rtype: EnkfFs """ - return EnKFMain.cNamespace().get_fs(self).setParent(self) - def get_history_length(self): + + def getHistoryLength(self): return EnKFMain.cNamespace().get_history_length(self) - def initialize_from_existing__(self, source_case, source_report_step, source_state, member_mask, ranking_key, + def initializeFromExistingCase(self, source_case, source_report_step, source_state, member_mask, ranking_key, node_list): + assert isinstance(source_state, EnkfStateType) + EnKFMain.cNamespace().initialize_from_existing__(self, source_case, source_report_step, source_state, member_mask, ranking_key, node_list) @@ -152,8 +175,9 @@ def copy_ensemble(self, source_case, source_report_step, source_state, target_ca target_state, member_mask, ranking_key, node_list) - def iget_state(self, ens_memb): - return EnKFMain.cNamespace().iget_state(self, ens_memb).setParent(self) + def getMemberRunningState(self, ensemble_member): + """ @rtype: EnKFState """ + return EnKFMain.cNamespace().iget_state(self, ensemble_member).setParent(self) def get_observations(self, user_key, obs_count, obs_x, obs_y, obs_std): EnKFMain.cNamespace().get_observations(self, user_key, obs_count, obs_x, obs_y, obs_std) @@ -161,8 +185,13 @@ def get_observations(self, user_key, obs_count, obs_x, obs_y, obs_std): def get_observation_count(self, user_key): return EnKFMain.cNamespace().get_observation_count(self, user_key) - def is_initialized(self): - return EnKFMain.cNamespace().is_initialized(self) + def isInitialized(self): + """ @rtype: bool """ + return EnKFMain.cNamespace().is_initialized(self, None) # what is the bool_vector mask??? + + def runEnsembleExperiment(self, member_list, total_member_count): + member_mask = BoolVector.createFromList(total_member_count, member_list) + EnKFMain.cNamespace().run_exp(self, member_mask, True, 0, 0, EnkfStateType.ANALYZED, True) def run(self, boolPtr, init_step_parameter, simFrom, state, mode): #{"ENKF_ASSIMILATION" : 1, "ENSEMBLE_EXPERIMENT" : 2, "ENSEMBLE_PREDICTION" : 3, "INIT_ONLY" : 4, "SMOOTHER" : 5} @@ -178,27 +207,21 @@ def run(self, boolPtr, init_step_parameter, simFrom, state, mode): if mode == 5: EnKFMain.cNamespace().run_smoother(self, "AUTOSMOOTHER", True) - def alloc_caselist(self): - return EnKFMain.cNamespace().alloc_caselist(self).setParent(self) - def get_current_fs(self): - """ @rtype: EnkfFs """ - return EnKFMain.cNamespace().get_current_fs(self) - def user_select_fs(self, input_case): - EnKFMain.cNamespace().user_select_fs(self, input_case) + def get_alt_fs(self, fs, read_only, create): """ @rtype: EnkfFs """ return EnKFMain.cNamespace().get_alt_fs(self, fs, read_only, create).setParent(self) - def createNewConfig(config_file, storage_path, case_name, dbase_type, num_realizations): - EnKFMain.cNamespace().create_new_config(config_file, storage_path, case_name, dbase_type, num_realizations) + def createNewConfig(self, storage_path, case_name, dbase_type, num_realizations): + EnKFMain.cNamespace().create_new_config(self, storage_path, case_name, dbase_type, num_realizations) def fprintf_config(self): EnKFMain.cNamespace().fprintf_config(self) - def select_fs(self, path): + def selectFileSystem(self, path): EnKFMain.cNamespace().select_fs(self, path) def fs_exists(self, case): @@ -208,6 +231,18 @@ def saveConfig(self): #EnKFMain.cNamespace().fprintf_config(self) pass + def runIteratedEnsembleSmoother(self, last_report_step): + #warn: Remember to select correct analysis module RML + EnKFMain.cNamespace().run_iterated_ensemble_smoother(self, last_report_step) + + def runOneMoreIteration(self, last_report_step): + #warn: need some way of validating that the case has run + EnKFMain.cNamespace().run_one_more_iteration(self, last_report_step) + + + def isCaseInitialized(self, case): + return EnKFMain.cNamespace().is_case_initialized(self, case, None) + ################################################################## cwrapper = CWrapper(ENKF_LIB) @@ -217,7 +252,7 @@ def saveConfig(self): EnKFMain.cNamespace().bootstrap = cwrapper.prototype("c_void_p enkf_main_bootstrap(char*, char*, bool, bool)") EnKFMain.cNamespace().free = cwrapper.prototype("void enkf_main_free(enkf_main)") -EnKFMain.cNamespace().ens_size = cwrapper.prototype("int enkf_main_get_ensemble_size( enkf_main )") +EnKFMain.cNamespace().get_ensemble_size = cwrapper.prototype("int enkf_main_get_ensemble_size( enkf_main )") EnKFMain.cNamespace().get_ens_config = cwrapper.prototype("ens_config_ref enkf_main_get_ensemble_config( enkf_main )") EnKFMain.cNamespace().get_model_config = cwrapper.prototype("model_config_ref enkf_main_get_model_config( enkf_main )") EnKFMain.cNamespace().get_local_config = cwrapper.prototype("local_config_ref enkf_main_get_local_config( enkf_main )") @@ -248,25 +283,27 @@ def saveConfig(self): EnKFMain.cNamespace().get_site_config_file = cwrapper.prototype("char* enkf_main_get_site_config_file(enkf_main)") EnKFMain.cNamespace().initialize_from_scratch = cwrapper.prototype("void enkf_main_initialize_from_scratch(enkf_main, stringlist, int, int, bool)") EnKFMain.cNamespace().get_history_length = cwrapper.prototype("int enkf_main_get_history_length(enkf_main)") -EnKFMain.cNamespace().initialize_from_existing__ = cwrapper.prototype("void enkf_main_initialize_from_existing__(enkf_main, char*, int, int, bool_vector, char*, stringlist)") +EnKFMain.cNamespace().initialize_from_existing__ = cwrapper.prototype("void enkf_main_initialize_from_existing__(enkf_main, char*, int, enkf_state_type_enum, bool_vector, char*, stringlist)") EnKFMain.cNamespace().copy_ensemble = cwrapper.prototype("void enkf_main_copy_ensemble(enkf_main, char*, int, int, char*, int, int, bool_vector, char*, stringlist)") EnKFMain.cNamespace().get_observations = cwrapper.prototype("void enkf_main_get_observations(enkf_main, char*, int, long*, double*, double*)") EnKFMain.cNamespace().get_observation_count = cwrapper.prototype("int enkf_main_get_observation_count(enkf_main, char*)") -EnKFMain.cNamespace().is_initialized = cwrapper.prototype("bool enkf_main_is_initialized(enkf_main)") +EnKFMain.cNamespace().is_initialized = cwrapper.prototype("bool enkf_main_is_initialized(enkf_main, bool_vector)") +EnKFMain.cNamespace().is_case_initialized = cwrapper.prototype("bool enkf_main_case_is_initialized(enkf_main, char*, bool_vector)") EnKFMain.cNamespace().iget_state = cwrapper.prototype("enkf_state_ref enkf_main_iget_state(enkf_main, int)") EnKFMain.cNamespace().get_logh = cwrapper.prototype("log_ref enkf_main_get_logh( enkf_main )") -EnKFMain.cNamespace().run_exp = cwrapper.prototype("void enkf_main_run_exp( enkf_main, bool_vector, bool, int, int, int, bool)") +EnKFMain.cNamespace().run_exp = cwrapper.prototype("void enkf_main_run_exp( enkf_main, bool_vector, bool, int, int, enkf_state_type_enum, bool)") EnKFMain.cNamespace().run_assimilation = cwrapper.prototype("void enkf_main_run_assimilation( enkf_main, bool_vector, int, int, int)") EnKFMain.cNamespace().run_smoother = cwrapper.prototype("void enkf_main_run_smoother(enkf_main, char*, bool)") -EnKFMain.cNamespace().alloc_caselist = cwrapper.prototype("stringlist_ref enkf_main_alloc_caselist(enkf_main)") +EnKFMain.cNamespace().alloc_caselist = cwrapper.prototype("stringlist_obj enkf_main_alloc_caselist(enkf_main)") EnKFMain.cNamespace().fprintf_config = cwrapper.prototype("void enkf_main_fprintf_config(enkf_main)") EnKFMain.cNamespace().create_new_config = cwrapper.prototype("void enkf_main_create_new_config(char* , char*, char* , char* , int)") EnKFMain.cNamespace().get_fs = cwrapper.prototype("enkf_fs_ref enkf_main_get_fs(enkf_main)") EnKFMain.cNamespace().get_alt_fs = cwrapper.prototype("enkf_fs_ref enkf_main_get_alt_fs(enkf_main , char* , bool , bool)") EnKFMain.cNamespace().user_select_fs = cwrapper.prototype("void enkf_main_user_select_fs(enkf_main , char*)") -EnKFMain.cNamespace().get_current_fs = cwrapper.prototype("char* enkf_main_get_current_fs(enkf_main)") +# EnKFMain.cNamespace().get_current_fs = cwrapper.prototype("char* enkf_main_get_current_fs(enkf_main)") EnKFMain.cNamespace().select_fs = cwrapper.prototype("void enkf_main_select_fs(enkf_main, char*)") EnKFMain.cNamespace().fs_exists = cwrapper.prototype("bool enkf_main_fs_exists(enkf_main, char*)") + diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_obs.py b/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_obs.py index 53799c30fa..76098d448d 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_obs.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_obs.py @@ -17,7 +17,7 @@ from ert.enkf import ENKF_LIB from ert.util import StringList -from ert.enkf.util import ObsVector +from ert.enkf.observations import ObsVector class EnkfObs(BaseCClass): @@ -29,17 +29,33 @@ def get_config_file(self): """ @rtype: Str """ return EnkfObs.cNamespace().get_config_file(self) - def alloc_typed_keylist(self, type): - """ @rtype: StringList """ - return EnkfObs.cNamespace().alloc_typed_keylist(self, type).setParent(self) + def getTypedKeylist(self, observation_implementation_type): + """ + @type observation_implementation_type: EnkfObservationImplementationType + @rtype: StringList + """ + return EnkfObs.cNamespace().alloc_typed_keylist(self, observation_implementation_type) - def has_key(self, key): + def hasKey(self, key): """ @rtype: bool """ return EnkfObs.cNamespace().has_key(self, key) - def get_vector(self, key): + def getObservationsVector(self, key): """ @rtype: ObsVector """ - return EnkfObs.cNamespace().get_vector(self,key).setParent(self) + assert isinstance(key, str) + return EnkfObs.cNamespace().get_vector(self, key).setParent(self) + + def getObservationTime(self, index): + """ @rtype: ctime """ + return EnkfObs.cNamespace().iget_obs_time(self, index) + + def addObservationVector(self, observation_key, observation_vector): + assert isinstance(observation_key, str) + assert isinstance(observation_vector, ObsVector) + + observation_vector.convertToCReference(self) + + EnkfObs.cNamespace().add_obs_vector(self, observation_key, observation_vector) def free(self): EnkfObs.cNamespace().free(self) @@ -50,12 +66,10 @@ def free(self): cwrapper.registerType("enkf_obs_obj", EnkfObs.createPythonObject) cwrapper.registerType("enkf_obs_ref", EnkfObs.createCReference) -# 3. Installing the c-functions used to manipulate ecl_kw instances. -# These functions are used when implementing the EclKW class, not -# used outside this scope. - EnkfObs.cNamespace().free = cwrapper.prototype("void enkf_obs_free( enkf_obs )") EnkfObs.cNamespace().get_config_file = cwrapper.prototype("char* enkf_obs_get_config_file( enkf_obs )") -EnkfObs.cNamespace().alloc_typed_keylist = cwrapper.prototype("stringlist_ref enkf_obs_alloc_typed_keylist(enkf_obs, int)") +EnkfObs.cNamespace().alloc_typed_keylist = cwrapper.prototype("stringlist_obj enkf_obs_alloc_typed_keylist(enkf_obs, enkf_obs_impl_type)") EnkfObs.cNamespace().has_key = cwrapper.prototype("bool enkf_obs_has_key(enkf_obs, char*)") EnkfObs.cNamespace().get_vector = cwrapper.prototype("obs_vector_ref enkf_obs_get_vector(enkf_obs, char*)") +EnkfObs.cNamespace().iget_obs_time = cwrapper.prototype("time_t enkf_obs_iget_obs_time(enkf_obs, int)") +EnkfObs.cNamespace().add_obs_vector = cwrapper.prototype("void enkf_obs_add_obs_vector(enkf_obs, char*, obs_vector)") diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_state.py b/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_state.py index aff4a60e1b..0e01ef0aad 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_state.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/enkf_state.py @@ -15,6 +15,7 @@ # for more details. from ert.cwrap import BaseCClass, CWrapper from ert.enkf import ENKF_LIB +from ert.job_queue import JobStatusType class EnKFState(BaseCClass): @@ -27,7 +28,8 @@ def kill_simulation(self): def resubmit_simulation(self, sim_number): EnKFState.cNamespace().resubmit_simulation(self, sim_number) - def get_run_status(self): + def getRunStatus(self): + """ @rtype: JobStatusType """ return EnKFState.cNamespace().get_run_status(self) def get_start_time(self): @@ -47,6 +49,6 @@ def free(self): EnKFState.cNamespace().free = cwrapper.prototype("void enkf_state_free( enkf_state )") EnKFState.cNamespace().kill_simulation = cwrapper.prototype("void enkf_state_kill_simulation(enkf_state)") EnKFState.cNamespace().resubmit_simulation = cwrapper.prototype("void enkf_state_resubmit_simulation(enkf_state, int)") -EnKFState.cNamespace().get_run_status = cwrapper.prototype("int enkf_state_get_run_status(enkf_state)") +EnKFState.cNamespace().get_run_status = cwrapper.prototype("job_status_type_enum enkf_state_get_run_status(enkf_state)") EnKFState.cNamespace().get_start_time = cwrapper.prototype("int enkf_state_get_start_time(enkf_state)") EnKFState.cNamespace().get_submit_time = cwrapper.prototype("int enkf_state_get_submit_time(enkf_state)") diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/ens_config.py b/ThirdParty/Ert/devel/python/python/ert/enkf/ens_config.py index 4c1c214881..eaab8f984f 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/ens_config.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/ens_config.py @@ -16,6 +16,7 @@ from ert.cwrap import BaseCClass, CWrapper from ert.enkf import ENKF_LIB from ert.enkf.data import EnkfConfigNode +from ert.enkf.enums import EnkfVarType from ert.util import StringList @@ -51,8 +52,9 @@ def add_field(self, key, eclipse_grid): """ @rtype: EnkfConfigNode """ return EnsConfig.cNamespace().add_field(self, key, eclipse_grid).setParent(self) - def alloc_keylist_from_var_type(self, var_mask): + def getKeylistFromVarType(self, var_mask): """ @rtype: StringList """ + assert isinstance(var_mask, EnkfVarType) return EnsConfig.cNamespace().alloc_keylist_from_var_type(self, var_mask).setParent(self) def free(self): @@ -72,4 +74,4 @@ def free(self): EnsConfig.cNamespace().add_gen_kw = cwrapper.prototype("enkf_config_node_ref ensemble_config_add_gen_kw( ens_config, char*)") EnsConfig.cNamespace().add_gen_data = cwrapper.prototype("enkf_config_node_ref ensemble_config_add_gen_data( ens_config, char*)") EnsConfig.cNamespace().add_field = cwrapper.prototype("enkf_config_node_ref ensemble_config_add_field( ens_config, char*, ecl_grid)") -EnsConfig.cNamespace().alloc_keylist_from_var_type = cwrapper.prototype("stringlist_ref ensemble_config_alloc_keylist_from_var_type(ens_config, int)") +EnsConfig.cNamespace().alloc_keylist_from_var_type = cwrapper.prototype("stringlist_ref ensemble_config_alloc_keylist_from_var_type(ens_config, enkf_var_type_enum)") diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/enums/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/CMakeLists.txt new file mode 100644 index 0000000000..ae861e5e1b --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/CMakeLists.txt @@ -0,0 +1,11 @@ +set(PYTHON_SOURCES + __init__.py + enkf_obs_impl_type_enum.py + enkf_run_enum.py + enkf_state_type_enum.py + enkf_var_type_enum.py + load_fail_type_enum.py +) + +add_python_package("Python ert.enkf.enums" ${PYTHON_INSTALL_PREFIX}/ert/enkf/enums "${PYTHON_SOURCES}" True) + diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/enums/__init__.py b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/__init__.py new file mode 100644 index 0000000000..0d229d777e --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/__init__.py @@ -0,0 +1,139 @@ +from .load_fail_type_enum import LoadFailTypeEnum +from .enkf_var_type_enum import EnkfVarType +from .enkf_state_type_enum import EnkfStateType +from .enkf_run_enum import EnkfRunEnum +from .enkf_obs_impl_type_enum import EnkfObservationImplementationType + + + + +# #------------------------------------------------------------------- +# # enum implementations +# #------------------------------------------------------------------- +# +# +# +# class enkf_impl_type(enum): +# """Defined in enkf_types.h""" +# #INVALID = 0 +# #IMPL_TYPE_OFFSET = 100 +# #STATIC = 100 +# FIELD = None +# GEN_KW = None +# SUMMARY = None +# GEN_DATA = None +# #MAX_IMPL_TYPE = 113 #! not good to have several with same value, resolveValue fails!!! +# +# enkf_impl_type.FIELD = enkf_impl_type("Field", 104) +# enkf_impl_type.GEN_KW = enkf_impl_type("Keyword", 107) +# enkf_impl_type.SUMMARY = enkf_impl_type("Summary", 110) +# enkf_impl_type.GEN_DATA = enkf_impl_type("Data", 113) +# +# + +# +# +# +# +# class gen_data_file_format(enum): +# #defined in gen_data_config.h +# GEN_DATA_UNDEFINED = None +# ASCII = None +# ASCII_TEMPLATE = None +# BINARY_DOUBLE = None +# BINARY_FLOAT = None +# +# INPUT_TYPES = None +# OUTPUT_TYPES = None +# +# gen_data_file_format.GEN_DATA_UNDEFINED = gen_data_file_format("", 0) +# gen_data_file_format.ASCII = gen_data_file_format("ASCII", 1) +# gen_data_file_format.ASCII_TEMPLATE = gen_data_file_format("ASCII_TEMPLATE", 2) +# gen_data_file_format.BINARY_DOUBLE = gen_data_file_format("BINARY_DOUBLE", 3) +# gen_data_file_format.BINARY_FLOAT = gen_data_file_format("BINARY_FLOAT", 4) +# +# gen_data_file_format.INPUT_TYPES = [gen_data_file_format.GEN_DATA_UNDEFINED, +# gen_data_file_format.ASCII, +# gen_data_file_format.BINARY_FLOAT, +# gen_data_file_format.BINARY_DOUBLE] +# +# gen_data_file_format.OUTPUT_TYPES = [gen_data_file_format.GEN_DATA_UNDEFINED, +# gen_data_file_format.ASCII, +# gen_data_file_format.ASCII_TEMPLATE, +# gen_data_file_format.BINARY_FLOAT, +# gen_data_file_format.BINARY_DOUBLE] +# +# +# class field_type(enum): +# ECLIPSE_RESTART = None +# ECLIPSE_PARAMETER = None +# GENERAL = None +# +# field_type.ECLIPSE_RESTART = field_type("Dynamic", 1) +# field_type.ECLIPSE_PARAMETER = field_type("Parameter", 2) +# field_type.GENERAL = field_type("General", 3) +# +# +# class truncation_type(enum): +# TRUNCATE_NONE = None +# TRUNCATE_MIN = None +# TRUNCATE_MAX = None +# +# @staticmethod +# def resolveTruncationType(minimum, maximum): +# if minimum == "" and maximum == "": +# return truncation_type.TRUNCATE_NONE +# elif not minimum == "" and not maximum == "": +# return truncation_type.TRUNCATE_MIN + truncation_type.TRUNCATE_MAX +# elif not minimum == "": +# return truncation_type.TRUNCATE_MIN +# elif not maximum == "": +# return truncation_type.TRUNCATE_MAX +# else: +# raise AssertionError("This should not happen! o_O") +# +# +# truncation_type.TRUNCATE_NONE = truncation_type("TRUNCATE_NONE", 0) +# truncation_type.TRUNCATE_MIN = truncation_type("TRUNCATE_MIN", 1) +# truncation_type.TRUNCATE_MAX = truncation_type("TRUNCATE_MAX", 2) +# +# #print enum._enums +# +# class keep_runpath_type(enum): +# DEFAULT_KEEP = None +# EXPLICIT_DELETE = None +# EXPLICIT_KEEP = None +# +# keep_runpath_type.DEFAULT_KEEP = keep_runpath_type("DEFAULT_KEEP", 0) +# keep_runpath_type.EXPLICIT_DELETE = keep_runpath_type("EXPLICIT_DELETE", 1) +# keep_runpath_type.EXPLICIT_KEEP = keep_runpath_type("EXPLICIT_KEEP", 2) +# +# class run_mode_type(enum): +# ENKF_ASSIMILATION = None +# ENSEMBLE_EXPERIMENT = None +# SMOOTHER_UPDATE = None +# INIT_ONLY = None +# +# run_mode_type.ENKF_ASSIMILATION = run_mode_type( "ENKF_ASSIMILATION", 1) +# run_mode_type.ENKF_EXPERIMENT = run_mode_type( "ENKF_EXPERIMENT", 2) +# run_mode_type.SMOOTHER_UPDATE = run_mode_type( "SMOOTHER_UPDATE", 4) +# run_mode_type.INIT_ONLY = run_mode_type( "INIT_ONLY", 8) +# +# class history_source_type(enum): +# SCHEDULE = None +# REFCASE_SIMULATED = None +# REFCASE_HISTORY = None +# +# history_source_type.SCHEDULE = history_source_type("SCHEDULE", 0) +# history_source_type.REFCASE_SIMULATED = history_source_type("REFCASE_SIMULATED", 1) +# history_source_type.REFCASE_HISTORY = history_source_type("REFCASE_HISTORY", 2) +# +# +# class obs_impl_type(enum): +# GEN_OBS = None +# SUMMARY_OBS = None +# FIELD_OBS = None +# +# obs_impl_type.GEN_OBS = obs_impl_type("GEN_OBS", 1) +# obs_impl_type.SUMMARY_OBS = obs_impl_type("SUMMARY_OBS", 2) +# obs_impl_type.FIELD_OBS = obs_impl_type("FIELD_OBS", 3) diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/enums/enkf_obs_impl_type_enum.py b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/enkf_obs_impl_type_enum.py new file mode 100644 index 0000000000..a85da198d4 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/enkf_obs_impl_type_enum.py @@ -0,0 +1,32 @@ +# Copyright (C) 2013 Statoil ASA, Norway. +# +# The file 'enkf_obs_impl_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +from ert.cwrap import BaseCEnum +from ert.enkf import ENKF_LIB + + +class EnkfObservationImplementationType(BaseCEnum): + GEN_OBS = None + SUMMARY_OBS = None + BLOCK_OBS = None + +EnkfObservationImplementationType.addEnum("GEN_OBS", 1) +EnkfObservationImplementationType.addEnum("SUMMARY_OBS", 2) +EnkfObservationImplementationType.addEnum("BLOCK_OBS", 3) + +EnkfObservationImplementationType.registerEnum(ENKF_LIB, "enkf_obs_impl_type") + + + diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/enums/enkf_run_enum.py b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/enkf_run_enum.py new file mode 100644 index 0000000000..264f4c4389 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/enkf_run_enum.py @@ -0,0 +1,29 @@ +# Copyright (C) 2013 Statoil ASA, Norway. +# +# The file 'content_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +from ert.cwrap import BaseCEnum +from ert.enkf import ENKF_LIB + + +class EnkfRunEnum(BaseCEnum): + ENKF_ASSIMILATION = None + ENSEMBLE_EXPERIMENT = None + + +EnkfRunEnum.populateEnum(ENKF_LIB, "enkf_run_enum_iget") +EnkfRunEnum.registerEnum(ENKF_LIB, "enkf_run_enum") + + + diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/enums/enkf_state_type_enum.py b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/enkf_state_type_enum.py new file mode 100644 index 0000000000..2323c5d3de --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/enkf_state_type_enum.py @@ -0,0 +1,39 @@ +# Copyright (C) 2013 Statoil ASA, Norway. +# +# The file 'content_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +from ert.cwrap import BaseCEnum +from ert.enkf import ENKF_LIB + + +class EnkfStateType(BaseCEnum): + UNDEFINED = None + FORECAST = None + ANALYZED = None + BOTH = None + + INITIALIZATION_TYPES = None + + +# EnkfStateType.addEnum("UNDEFINED", 0) +# EnkfStateType.addEnum("FORECAST", 2) +# EnkfStateType.addEnum("ANALYZED", 4) +# EnkfStateType.addEnum("BOTH", 6) +EnkfStateType.populateEnum(ENKF_LIB, "enkf_state_enum_iget") +EnkfStateType.registerEnum(ENKF_LIB, "enkf_state_type_enum") + +EnkfStateType.INITIALIZATION_TYPES = [EnkfStateType.ANALYZED, EnkfStateType.FORECAST] + + + diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/enums/enkf_var_type_enum.py b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/enkf_var_type_enum.py new file mode 100644 index 0000000000..c6f624ecf0 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/enkf_var_type_enum.py @@ -0,0 +1,38 @@ +# Copyright (C) 2013 Statoil ASA, Norway. +# +# The file 'content_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +from ert.cwrap import BaseCEnum +from ert.enkf import ENKF_LIB + + +class EnkfVarType(BaseCEnum): + INVALID_VAR = None + PARAMETER = None + DYNAMIC_STATE = None + DYNAMIC_RESULT = None + STATIC_STATE = None + INDEX_STATE = None + + +EnkfVarType.addEnum("INVALID_VAR", 0) +EnkfVarType.addEnum("PARAMETER", 1) +EnkfVarType.addEnum("DYNAMIC_STATE", 2) +EnkfVarType.addEnum("DYNAMIC_RESULT", 4) +EnkfVarType.addEnum("STATIC_STATE", 8) +EnkfVarType.addEnum("INDEX_STATE", 16) +EnkfVarType.registerEnum(ENKF_LIB, "enkf_var_type_enum") + + + diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/enums/load_fail_type_enum.py b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/load_fail_type_enum.py new file mode 100644 index 0000000000..d5c0037ac0 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/enums/load_fail_type_enum.py @@ -0,0 +1,32 @@ +# Copyright (C) 2013 Statoil ASA, Norway. +# +# The file 'content_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +from ert.cwrap import BaseCEnum +from ert.enkf import ENKF_LIB + + +class LoadFailTypeEnum(BaseCEnum): + LOAD_FAIL_SILENT = None + LOAD_FAIL_WARN = None + LOAD_FAIL_EXIT = None + + +LoadFailTypeEnum.addEnum("LOAD_FAIL_SILENT", 0) +LoadFailTypeEnum.addEnum("LOAD_FAIL_WARN", 2) +LoadFailTypeEnum.addEnum("LOAD_FAIL_EXIT", 4) +LoadFailTypeEnum.registerEnum(ENKF_LIB, "load_fail_type") + + + diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/model_config.py b/ThirdParty/Ert/devel/python/python/ert/enkf/model_config.py index e08f3dfd04..cd745c8ff1 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/model_config.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/model_config.py @@ -66,14 +66,17 @@ def get_case_table_file(self): """ @rtype: str """ return ModelConfig.cNamespace().get_case_table_file(self) - def get_runpath_as_char(self): + def getRunpathAsString(self): """ @rtype: str """ return ModelConfig.cNamespace().get_runpath_as_char(self) - def select_runpath(self, path_key): + def selectRunpath(self, path_key): """ @rtype: bool """ return ModelConfig.cNamespace().select_runpath(self, path_key) + def setRunpath(self, path_format): + ModelConfig.cNamespace().set_runpath(self, path_format) + def free(self): ModelConfig.cNamespace().free(self) @@ -85,9 +88,6 @@ def free(self): cwrapper.registerType("model_config_ref", ModelConfig.createCReference) -################################################################## -################################################################## - ModelConfig.cNamespace().free = cwrapper.prototype("void model_config_free( model_config )") ModelConfig.cNamespace().get_enkf_sched_file = cwrapper.prototype("char* model_config_get_enkf_sched_file( model_config )") ModelConfig.cNamespace().set_enkf_sched_file = cwrapper.prototype("void model_config_set_enkf_sched_file( model_config, char*)") @@ -97,6 +97,7 @@ def free(self): ModelConfig.cNamespace().get_case_table_file = cwrapper.prototype("char* model_config_get_case_table_file(model_config)") ModelConfig.cNamespace().get_runpath_as_char = cwrapper.prototype("char* model_config_get_runpath_as_char(model_config)") ModelConfig.cNamespace().select_runpath = cwrapper.prototype("bool model_config_select_runpath(model_config, char*)") +ModelConfig.cNamespace().set_runpath = cwrapper.prototype("void model_config_set_runpath(model_config, char*)") ModelConfig.cNamespace().get_history = cwrapper.prototype("history_ref model_config_get_history(model_config)") ModelConfig.cNamespace().get_history_source = cwrapper.prototype("history_source_enum model_config_get_history_source(model_config)") diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/observations/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert/enkf/observations/CMakeLists.txt new file mode 100644 index 0000000000..3552acdbfb --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/observations/CMakeLists.txt @@ -0,0 +1,8 @@ +set(PYTHON_SOURCES + __init__.py + obs_vector.py + summary_observation.py +) + +add_python_package("Python ert.enkf.observations" ${PYTHON_INSTALL_PREFIX}/ert/enkf/observations "${PYTHON_SOURCES}" True) + diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/observations/__init__.py b/ThirdParty/Ert/devel/python/python/ert/enkf/observations/__init__.py new file mode 100644 index 0000000000..045ac7f225 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/observations/__init__.py @@ -0,0 +1,2 @@ +from .summary_observation import SummaryObservation +from .obs_vector import ObsVector \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/observations/obs_vector.py b/ThirdParty/Ert/devel/python/python/ert/enkf/observations/obs_vector.py new file mode 100644 index 0000000000..0ce4598fd9 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/observations/obs_vector.py @@ -0,0 +1,85 @@ +# Copyright (C) 2012 Statoil ASA, Norway. +# +# The file 'obs_vector.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +from ert.cwrap import BaseCClass, CWrapper +from ert.enkf import ENKF_LIB +from ert.enkf.data import EnkfConfigNode +from ert.enkf.enums import EnkfObservationImplementationType +from ert.enkf.observations.summary_observation import SummaryObservation + + + +class ObsVector(BaseCClass): + def __init__(self, observation_type, observation_key, config_node, num_reports): + """ + @type observation_type: EnkfObservationImplementationType + @type observation_key: str + @type config_node: EnkfConfigNode + @type num_reports: int + """ + assert isinstance(observation_type, EnkfObservationImplementationType) + assert isinstance(observation_key, str) + assert isinstance(config_node, EnkfConfigNode) + assert isinstance(num_reports, int) + pointer = ObsVector.cNamespace().alloc(observation_type, observation_key, config_node, num_reports) + super(ObsVector, self).__init__(pointer) + + def get_state_kw(self): + """ @rtype: str """ + return ObsVector.cNamespace().get_state_kw(self) + + def getNode(self, index): + pointer = ObsVector.cNamespace().iget_node(self, index) + + node_type = self.getImplementationType() + if node_type == EnkfObservationImplementationType.SUMMARY_OBS: + return SummaryObservation.createCReference(pointer, self) + else: + raise AssertionError("Node type '%s' currently not supported!" % node_type) + + def getActiveCount(self): + """ @rtype: int """ + return ObsVector.cNamespace().get_num_active(self) + + def isActive(self, index): + """ @rtype: bool """ + return ObsVector.cNamespace().iget_active(self, index) + + def getImplementationType(self): + """ @rtype: EnkfObservationImplementationType """ + return ObsVector.cNamespace().get_impl_type(self) + + def installNode(self, index, node): + assert isinstance(node, SummaryObservation) + node.convertToCReference(self) + ObsVector.cNamespace().install_node(self, index, node.from_param(node)) + + def free(self): + ObsVector.cNamespace().free(self) + + +cwrapper = CWrapper(ENKF_LIB) +cwrapper.registerType("obs_vector", ObsVector) +cwrapper.registerType("obs_vector_obj", ObsVector.createPythonObject) +cwrapper.registerType("obs_vector_ref", ObsVector.createCReference) + +ObsVector.cNamespace().alloc = cwrapper.prototype("c_void_p obs_vector_alloc(enkf_obs_impl_type, char*, enkf_config_node, int)") +ObsVector.cNamespace().free = cwrapper.prototype("void obs_vector_free( obs_vector )") +ObsVector.cNamespace().get_state_kw = cwrapper.prototype("char* obs_vector_get_state_kw( obs_vector )") +ObsVector.cNamespace().iget_node = cwrapper.prototype("c_void_p obs_vector_iget_node( obs_vector, int)") +ObsVector.cNamespace().get_num_active = cwrapper.prototype("int obs_vector_get_num_active( obs_vector )") +ObsVector.cNamespace().iget_active = cwrapper.prototype("bool obs_vector_iget_active( obs_vector, int)") +ObsVector.cNamespace().get_impl_type = cwrapper.prototype("enkf_obs_impl_type obs_vector_get_impl_type( obs_vector)") +ObsVector.cNamespace().install_node = cwrapper.prototype("void obs_vector_install_node(obs_vector, int, c_void_p)") diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/observations/summary_observation.py b/ThirdParty/Ert/devel/python/python/ert/enkf/observations/summary_observation.py new file mode 100644 index 0000000000..fe4be1c165 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/observations/summary_observation.py @@ -0,0 +1,62 @@ +# Copyright (C) 2012 Statoil ASA, Norway. +# +# The file 'summary_observation.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. + +from ert.cwrap import BaseCClass, CWrapper +from ert.enkf import ENKF_LIB + + +class SummaryObservation(BaseCClass): + def __init__(self, summary_key, observation_key, value, std, auto_corrf_name=None, auto_corrf_param=0.0): + assert isinstance(summary_key, str) + assert isinstance(observation_key, str) + assert isinstance(value, float) + assert isinstance(std, float) + + if auto_corrf_name is not None: + assert isinstance(auto_corrf_name, str) + + assert isinstance(auto_corrf_param, float) + pointer = SummaryObservation.cNamespace().alloc(summary_key, observation_key, value, std, auto_corrf_name, auto_corrf_param) + super(SummaryObservation, self).__init__(pointer) + + def getValue(self): + """ @rtype: float """ + return SummaryObservation.cNamespace().get_value(self) + + def getStandardDeviation(self): + """ @rtype: float """ + return SummaryObservation.cNamespace().get_std(self) + + def getSummaryKey(self): + """ @rtype: str """ + return SummaryObservation.cNamespace().get_summary_key(self) + + def free(self): + SummaryObservation.cNamespace().free(self) + + + + +cwrapper = CWrapper(ENKF_LIB) +cwrapper.registerType("summary_obs", SummaryObservation) +cwrapper.registerType("summary_obs_obj", SummaryObservation.createPythonObject) +cwrapper.registerType("summary_obs_ref", SummaryObservation.createCReference) + +SummaryObservation.cNamespace().alloc = cwrapper.prototype("c_void_p summary_obs_alloc(char*, char*, double, double, char*, double)") +SummaryObservation.cNamespace().free = cwrapper.prototype("void summary_obs_free(summary_obs)") +SummaryObservation.cNamespace().get_value = cwrapper.prototype("double summary_obs_get_value(summary_obs)") +SummaryObservation.cNamespace().get_std = cwrapper.prototype("double summary_obs_get_std(summary_obs)") +SummaryObservation.cNamespace().get_summary_key = cwrapper.prototype("char* summary_obs_get_summary_key(summary_obs)") \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/site_config.py b/ThirdParty/Ert/devel/python/python/ert/enkf/site_config.py index 75d4f9c430..ecb98e6e5f 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/site_config.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/site_config.py @@ -24,56 +24,56 @@ class SiteConfig(BaseCClass): def __init__(self): raise NotImplementedError("Class can not be instantiated directly!") - def get_queue_name(self): + def getQueueName(self): """ @rtype: str """ return SiteConfig.cNamespace().get_queue_name( self ) - def set_job_queue(self, queue): + def setJobQueue(self, queue): SiteConfig.cNamespace().set_job_queue( self , queue) - def get_lsf_queue(self): + def getLsfQueue(self): """ @rtype: str """ return SiteConfig.cNamespace().get_lsf_queue( self ) - def set_lsf_queue(self, queue): + def setLsfQueue(self, queue): SiteConfig.cNamespace().set_lsf_queue( self , queue) - def get_max_running_lsf(self): + def getMaxRunningLsf(self): """ @rtype: int """ return SiteConfig.cNamespace().get_max_running_lsf( self ) - def set_max_running_lsf(self, max_running): + def setMaxRunningLsf(self, max_running): SiteConfig.cNamespace().set_max_running_lsf( self , max_running) - def get_lsf_request(self): + def getLsfRequest(self): """ @rtype: str """ return SiteConfig.cNamespace().get_lsf_request( self ) - def set_lsf_request(self, lsf_request): + def setLsfRequest(self, lsf_request): SiteConfig.cNamespace().set_lsf_request( self , lsf_request) - def clear_rsh_host_list(self): + def clearRshHostList(self): SiteConfig.cNamespace().clear_rsh_host_list( self ) - def get_rsh_command(self): + def getRshCommand(self): """ @rtype: str """ return SiteConfig.cNamespace().get_rsh_command( self ) def set_rsh_command(self, rsh_command): SiteConfig.cNamespace().set_rsh_command( self , rsh_command) - def get_max_running_rsh(self): + def getMaxRunningRsh(self): """ @rtype: int """ return SiteConfig.cNamespace().get_max_running_rsh( self ) - def set_max_running_rsh(self, max_running): + def setMaxRunningRsh(self, max_running): SiteConfig.cNamespace().set_max_running_rsh( self , max_running) - def get_max_running_local(self): + def getMaxRunningLocal(self): """ @rtype: int """ return SiteConfig.cNamespace().get_max_running_local( self ) - def set_max_running_local(self, max_running): + def setMaxRunningLocal(self, max_running): SiteConfig.cNamespace().set_max_running_local( self , max_running) def get_job_script(self): @@ -125,20 +125,20 @@ def get_license_root_path(self): def set_license_root_pathmax_submit(self, path): SiteConfig.cNamespace().set_license_root_path( self , path) - def queue_is_running(self): + def isQueueRunning(self): """ @rtype: bool """ return SiteConfig.cNamespace().queue_is_running( self ) - def get_job_queue(self): + def getJobQueue(self): """ @rtype: JobQueue """ return SiteConfig.cNamespace().get_job_queue(self).setParent(self) - def get_rsh_host_list(self): + def getRshHostList(self): """ @rtype: IntegerHash """ host_list = SiteConfig.cNamespace().get_rsh_host_list(self) return host_list - def add_rsh_host(self, host, max_running): + def addRshHost(self, host, max_running): SiteConfig.cNamespace().add_rsh_host(self, host, max_running) def free(self): diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/util/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert/enkf/util/CMakeLists.txt index 4992d84034..30d806a254 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/util/CMakeLists.txt +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/util/CMakeLists.txt @@ -1,8 +1,7 @@ set(PYTHON_SOURCES __init__.py - obs_vector.py time_map.py ) -add_python_package("Python ert.enkf.util" ${PYTHON_INSTALL_PREFIX}/ert/enkf/util "${PYTHON_SOURCES}" True) +add_python_package("Python ert.enkf.util" ${PYTHON_INSTALL_PREFIX}/ert/enkf/util "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/util/__init__.py b/ThirdParty/Ert/devel/python/python/ert/enkf/util/__init__.py index cd49c677c2..c3ce9ffc8a 100644 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/util/__init__.py +++ b/ThirdParty/Ert/devel/python/python/ert/enkf/util/__init__.py @@ -1,4 +1 @@ -import ert.enkf - -from .obs_vector import ObsVector from .time_map import TimeMap \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert/enkf/util/obs_vector.py b/ThirdParty/Ert/devel/python/python/ert/enkf/util/obs_vector.py deleted file mode 100644 index 8d1b28cb66..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert/enkf/util/obs_vector.py +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'obs_vector.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. -from ert.cwrap import BaseCClass, CWrapper -from ert.enkf import ENKF_LIB - - -class ObsVector(BaseCClass): - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def get_state_kw(self): - """ @rtype: str """ - return ObsVector.cNamespace().get_state_kw(self) - - def iget_node(self, index): - ObsVector.cNamespace().iget_node(self, index) #warn: should return something! - - def get_num_active(self): - """ @rtype: int """ - return ObsVector.cNamespace().get_num_active(self) - - def iget_active(self, index): - """ @rtype: bool """ - return ObsVector.cNamespace().iget_active(self, index) - - def free(self): - ObsVector.cNamespace().free(self) - - -cwrapper = CWrapper(ENKF_LIB) -cwrapper.registerType("obs_vector", ObsVector) -cwrapper.registerType("obs_vector_obj", ObsVector.createPythonObject) -cwrapper.registerType("obs_vector_ref", ObsVector.createCReference) - -# 3. Installing the c-functions used to manipulate ecl_kw instances. -# These functions are used when implementing the EclKW class, not -# used outside this scope. - -ObsVector.cNamespace().free = cwrapper.prototype("void obs_vector_free( obs_vector )") -ObsVector.cNamespace().get_state_kw = cwrapper.prototype("char* obs_vector_get_state_kw( obs_vector )") -ObsVector.cNamespace().iget_node = cwrapper.prototype("c_void_p obs_vector_iget_node( obs_vector, int)") -ObsVector.cNamespace().get_num_active = cwrapper.prototype("int obs_vector_get_num_active( obs_vector )") -ObsVector.cNamespace().iget_active = cwrapper.prototype("bool obs_vector_iget_active( obs_vector, int)") diff --git a/ThirdParty/Ert/devel/python/python/ert/ert/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert/ert/CMakeLists.txt deleted file mode 100644 index 615ca11b3c..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert/ert/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - enums.py - erttypes.py - ertwrapper.py - c_enums.py -) - -add_python_package( "Python ert.ert" ${PYTHON_INSTALL_PREFIX}/ert/ert "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/devel/python/python/ert/ert/c_enums.py b/ThirdParty/Ert/devel/python/python/ert/ert/c_enums.py deleted file mode 100644 index 1b760d2306..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert/ert/c_enums.py +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'c_enums.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. -from ctypes import * - -class EnumerationType(type(c_uint)): - def __new__(metacls, name, bases, dict): - if not "_members_" in dict: - _members_ = {} - for key,value in dict.items(): - if not key.startswith("_"): - _members_[key] = value - dict["_members_"] = _members_ - cls = type(c_uint).__new__(metacls, name, bases, dict) - for key,value in cls._members_.items(): - globals()[key] = value - return cls - - def __contains__(self, value): - return value in self._members_.values() - - def __repr__(self): - return "" % self.__name__ - -class Enumeration(c_uint): - __metaclass__ = EnumerationType - _members_ = {} - def __init__(self, value): - for k,v in self._members_.items(): - if v == value: - self.name = k - break - else: - raise ValueError("No enumeration member with value %r" % value) - c_uint.__init__(self, value) - - - @classmethod - def from_param(cls, param): - if isinstance(param, Enumeration): - if param.__class__ != cls: - raise ValueError("Cannot mix enumeration members") - else: - return param - else: - return cls(param) - - def __repr__(self): - return "" % (self.name, self.value, self.__class__) -#------------------------------------------------------------------- -# enum implementations -#------------------------------------------------------------------- - -class state_enum(Enumeration): - UNDEFINED = 0 - SERIALIZED = 1 - FORECAST = 2 - ANALYZED = 4 - BOTH = 6 - -class var_type(Enumeration): - INVALID_VAR = 0 - PARAMETER = 1 - DYNAMIC_STATE = 2 - DYNAMIC_RESULT = 4 - STATIC_STATE = 8 - INDEX_STATE = 16 diff --git a/ThirdParty/Ert/devel/python/python/ert/ert/enums.py b/ThirdParty/Ert/devel/python/python/ert/ert/enums.py deleted file mode 100644 index fb957139d8..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert/ert/enums.py +++ /dev/null @@ -1,323 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'enums.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - - -class enumtype(type): - def __call__(cls, *args, **kwargs): - newtype = super(enumtype, cls).__call__(*args, **kwargs) - newtype.__getitem__ = classmethod(enumtype.__getitem__) - return newtype - - def __getitem__(cls, item): - """All enums can be accessed with the subscript operator, using the name or value as key""" - v = cls.resolveValue(item) - if v is None: - return cls.resolveName(item) - else: - return v - -# if isinstance(item, long) or isinstance(item, int): -# return cls.resolveValue(item) -# else: -# return cls.resolveName(item) - -class enum: - """ - A base class for enums. - All enums support the subscript operator as a class method. The value or the name can be used as key/index. - The subscript operator uses the resolveName and resolveValue functions as basis. - """ - __metaclass__ = enumtype - - _enums = {} #This contains all sub classed enums! {class : [list of enums], ...} - def __init__(self, name, value): - self.name = name - self.__value = value - - if not enum._enums.has_key(self.__class__): - enum._enums[self.__class__] = [] - - enum._enums[self.__class__].append(self) - - def value(self): - return self.__value - - @classmethod - def values(cls): - """Returns a list of the created enums for a class.""" - return enum._enums[cls] - - @classmethod - def resolveName(cls, name): - """Finds an enum based on name. Ignores the case of the name. Returns None if not found.""" - for e in enum._enums[cls]: - if e.name.lower() == name.lower(): - return e - return None - - @classmethod - def resolveValue(cls, value): - """ - Returns the enum with the specified value. - If several enums have the same value the first will be returned - """ - for e in enum._enums[cls]: - if e.__value == value: - return e - return None - - def __add__(self, other): - """Two enums can be added together returning the sum of the value fields as a new enum or an existing one.""" - if isinstance(other, self.__class__): - sum = self.__value + other.__value - existing_enum = self.__class__.resolveValue(sum) - if not existing_enum is None: - return existing_enum - else: - return self.__class__(self.name + " + " + other.name, sum) - else: - raise NotImplemented - - - def __and__(self, other): - """Bitwise and of two enums or an enum and a long or int. Returns the and'ed value.""" - if isinstance(other, self.__class__): - return self.__value & other.__value - elif isinstance(other, long) or isinstance(other, int): - return self.__value & other - else: - raise NotImplemented - - def __rand__(self, other): - return self.__and__(other) - - def __str__(self): - return self.name - - def __ne__(self, other): - return not self == other - - def __eq__(self, other): - if other is None: - return False - - if isinstance(other, long) or isinstance(other, int): - return self.__value == other - else: - return self.__value == other.__value - - def __hash__(self): - return hash("%s : %i" % (self.name, self.__value)) - - -#------------------------------------------------------------------- -# enum implementations -#------------------------------------------------------------------- - -class ert_state_enum(enum): - """Defined in enkf_types.h""" - FORECAST=None - ANALYZED=None - BOTH=None - - INITIALIZATION_STATES = None - -#ert_state_enum.UNDEFINED = ert_state_enum("Undefined", 0) -#ert_state_enum.SERIALIZED = ert_state_enum("Serialized", 1) -ert_state_enum.FORECAST = ert_state_enum("Forecast", 2) -ert_state_enum.ANALYZED = ert_state_enum("Analyzed", 4) -ert_state_enum.BOTH = ert_state_enum("Both", 6) - -ert_state_enum.INITIALIZATION_STATES = [ert_state_enum.ANALYZED, ert_state_enum.FORECAST] - - -class enkf_impl_type(enum): - """Defined in enkf_types.h""" - #INVALID = 0 - #IMPL_TYPE_OFFSET = 100 - #STATIC = 100 - FIELD = None - GEN_KW = None - SUMMARY = None - GEN_DATA = None - #MAX_IMPL_TYPE = 113 #! not good to have several with same value, resolveValue fails!!! - -enkf_impl_type.FIELD = enkf_impl_type("Field", 104) -enkf_impl_type.GEN_KW = enkf_impl_type("Keyword", 107) -enkf_impl_type.SUMMARY = enkf_impl_type("Summary", 110) -enkf_impl_type.GEN_DATA = enkf_impl_type("Data", 113) - -class enkf_var_type(enum): - #INVALID_VAR = None #, /* */ - PARAMETER = None #, /* A parameter which is updated with enkf: PORO , MULTFLT , ..*/ - DYNAMIC_STATE = None #, /* Dynamic data which are needed for a restart - i.e. pressure and saturations. */ - DYNAMIC_RESULT = None #, /* Dynamic results which are NOT needed for a restart - i.e. well rates. */ - #STATIC_STATE = None #, /* Keywords like XCON++ from eclipse restart files - which are just dragged along */ - #INDEX_STATE = None - -#enkf_var_type.INVALID_VAR -enkf_var_type.PARAMETER = enkf_var_type("Parameter", 1) -enkf_var_type.DYNAMIC_STATE = enkf_var_type("DynamicState", 2) -enkf_var_type.DYNAMIC_RESULT = enkf_var_type("DynamicResult", 4) -#enkf_var_type.STATIC_STATE -#enkf_var_type.INDEX_STATE - - -class ert_job_status_type(enum): - """These "enum" values are all copies from the header file "basic_queue_driver.h".""" - # Observe that the status strings are available from the function: libjob_queue.job_queue_status_name( status_code ) - NOT_ACTIVE = None - LOADING = None - WAITING = None - SUBMITTED = None - PENDING = None - RUNNING = None - DONE = None - EXIT = None - RUN_OK = None - RUN_FAIL = None - ALL_OK = None - ALL_FAIL = None - USER_KILLED = None - USER_EXIT = None - SUCCESS = None - RUNNING_CALLBACK = None - FAILED = None - -ert_job_status_type.NOT_ACTIVE = ert_job_status_type("JOB_QUEUE_NOT_ACTIVE", 1) -ert_job_status_type.LOADING = ert_job_status_type("JOB_QUEUE_LOADING", 2) -ert_job_status_type.WAITING = ert_job_status_type("JOB_QUEUE_WAITING", 4) -ert_job_status_type.SUBMITTED = ert_job_status_type("JOB_QUEUE_SUBMITTED", 8) -ert_job_status_type.PENDING = ert_job_status_type("JOB_QUEUE_PENDING", 16) -ert_job_status_type.RUNNING = ert_job_status_type("JOB_QUEUE_RUNNING", 32) -ert_job_status_type.DONE = ert_job_status_type("JOB_QUEUE_DONE", 64) -ert_job_status_type.EXIT = ert_job_status_type("JOB_QUEUE_EXIT", 128) -ert_job_status_type.RUN_OK = ert_job_status_type("JOB_QUEUE_RUN_OK", 256) -ert_job_status_type.RUN_FAIL = ert_job_status_type("JOB_QUEUE_RUN_FAIL", 512) -ert_job_status_type.ALL_OK = ert_job_status_type("JOB_QUEUE_ALL_OK", 1024) -ert_job_status_type.ALL_FAIL = ert_job_status_type("JOB_QUEUE_ALL_FAIL", 2048) -ert_job_status_type.USER_KILLED = ert_job_status_type("JOB_QUEUE_USER_KILLED", 4096) -ert_job_status_type.USER_EXIT = ert_job_status_type("JOB_QUEUE_USER_EXIT", 8192) -ert_job_status_type.SUCCESS = ert_job_status_type("JOB_QUEUE_SUCCESS", 16384) -ert_job_status_type.RUNNING_CALLBACK = ert_job_status_type("JOB_QUEUE_RUNNING_CALLBACK", 32768) -ert_job_status_type.JOB_QUEUE_FAILED = ert_job_status_type("JOB_QUEUE_FAILED", 65536) - - - - -class gen_data_file_format(enum): - #defined in gen_data_config.h - GEN_DATA_UNDEFINED = None - ASCII = None - ASCII_TEMPLATE = None - BINARY_DOUBLE = None - BINARY_FLOAT = None - - INPUT_TYPES = None - OUTPUT_TYPES = None - -gen_data_file_format.GEN_DATA_UNDEFINED = gen_data_file_format("", 0) -gen_data_file_format.ASCII = gen_data_file_format("ASCII", 1) -gen_data_file_format.ASCII_TEMPLATE = gen_data_file_format("ASCII_TEMPLATE", 2) -gen_data_file_format.BINARY_DOUBLE = gen_data_file_format("BINARY_DOUBLE", 3) -gen_data_file_format.BINARY_FLOAT = gen_data_file_format("BINARY_FLOAT", 4) - -gen_data_file_format.INPUT_TYPES = [gen_data_file_format.GEN_DATA_UNDEFINED, - gen_data_file_format.ASCII, - gen_data_file_format.BINARY_FLOAT, - gen_data_file_format.BINARY_DOUBLE] - -gen_data_file_format.OUTPUT_TYPES = [gen_data_file_format.GEN_DATA_UNDEFINED, - gen_data_file_format.ASCII, - gen_data_file_format.ASCII_TEMPLATE, - gen_data_file_format.BINARY_FLOAT, - gen_data_file_format.BINARY_DOUBLE] - - -class field_type(enum): - ECLIPSE_RESTART = None - ECLIPSE_PARAMETER = None - GENERAL = None - -field_type.ECLIPSE_RESTART = field_type("Dynamic", 1) -field_type.ECLIPSE_PARAMETER = field_type("Parameter", 2) -field_type.GENERAL = field_type("General", 3) - - -class truncation_type(enum): - TRUNCATE_NONE = None - TRUNCATE_MIN = None - TRUNCATE_MAX = None - - @staticmethod - def resolveTruncationType(minimum, maximum): - if minimum == "" and maximum == "": - return truncation_type.TRUNCATE_NONE - elif not minimum == "" and not maximum == "": - return truncation_type.TRUNCATE_MIN + truncation_type.TRUNCATE_MAX - elif not minimum == "": - return truncation_type.TRUNCATE_MIN - elif not maximum == "": - return truncation_type.TRUNCATE_MAX - else: - raise AssertionError("This should not happen! o_O") - - -truncation_type.TRUNCATE_NONE = truncation_type("TRUNCATE_NONE", 0) -truncation_type.TRUNCATE_MIN = truncation_type("TRUNCATE_MIN", 1) -truncation_type.TRUNCATE_MAX = truncation_type("TRUNCATE_MAX", 2) - -#print enum._enums - -class keep_runpath_type(enum): - DEFAULT_KEEP = None - EXPLICIT_DELETE = None - EXPLICIT_KEEP = None - -keep_runpath_type.DEFAULT_KEEP = keep_runpath_type("DEFAULT_KEEP", 0) -keep_runpath_type.EXPLICIT_DELETE = keep_runpath_type("EXPLICIT_DELETE", 1) -keep_runpath_type.EXPLICIT_KEEP = keep_runpath_type("EXPLICIT_KEEP", 2) - -class run_mode_type(enum): - ENKF_ASSIMILATION = None - ENSEMBLE_EXPERIMENT = None - SMOOTHER_UPDATE = None - INIT_ONLY = None - -run_mode_type.ENKF_ASSIMILATION = run_mode_type( "ENKF_ASSIMILATION", 1) -run_mode_type.ENKF_EXPERIMENT = run_mode_type( "ENKF_EXPERIMENT", 2) -run_mode_type.SMOOTHER_UPDATE = run_mode_type( "SMOOTHER_UPDATE", 4) -run_mode_type.INIT_ONLY = run_mode_type( "INIT_ONLY", 8) - -class history_source_type(enum): - SCHEDULE = None - REFCASE_SIMULATED = None - REFCASE_HISTORY = None - -history_source_type.SCHEDULE = history_source_type("SCHEDULE", 0) -history_source_type.REFCASE_SIMULATED = history_source_type("REFCASE_SIMULATED", 1) -history_source_type.REFCASE_HISTORY = history_source_type("REFCASE_HISTORY", 2) - - -class obs_impl_type(enum): - GEN_OBS = None - SUMMARY_OBS = None - FIELD_OBS = None - -obs_impl_type.GEN_OBS = obs_impl_type("GEN_OBS", 1) -obs_impl_type.SUMMARY_OBS = obs_impl_type("SUMMARY_OBS", 2) -obs_impl_type.FIELD_OBS = obs_impl_type("FIELD_OBS", 3) diff --git a/ThirdParty/Ert/devel/python/python/ert/ert/erttypes.py b/ThirdParty/Ert/devel/python/python/ert/ert/erttypes.py deleted file mode 100644 index 456f5a291e..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert/ert/erttypes.py +++ /dev/null @@ -1,145 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'erttypes.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -import datetime -import time -import ctypes -#from ert.util.tvector import DoubleVector - - -class time_t(ctypes.c_long): - """A convenience class for working with time_t objects.""" -# def __init__(self , c_ptr , parent = None): -# if parent: -# self.init_cref( c_ptr , parent) -# else: -# self.init_cobj( c_ptr , cfunc.free ) - - - def time(self): - """Return this time_t as a time.localtime() object""" - return time.localtime(self.value) - - def datetime(self): - """Return this time_t as a datetime.date([year, month, day])""" - return datetime.date(*self.time()[0:3]) - - def __str__(self): - return "%d %s" % (self.value, str(self.datetime())) - - def __ge__(self, other): - return self.value >= other.value - - def __lt__(self, other): - return not self >= other - - -class VectorIterator: - """A simple iterator""" - def __init__(self, data, size): - self.index = 0 - self.data = data - self.size = size - - def next(self): - if self.index == self.size: - raise StopIteration - result = self.data[self.index] - self.index += 1 - return result - - -class time_vector(ctypes.c_long): - """Represents a vector of time_t objects""" - initialized = False - lib = None - - def __getitem__(self, item): - """Indexing support""" - return self.__class__.lib.time_t_vector_iget(self, item) - - def __iter__(self): - """Iterator support""" - return VectorIterator(self, self.size()) - - def __del__(self): - """Garbage collection""" - self._free() - - def size(self): - """The size of this vector""" - return self.__class__.lib.time_t_vector_size(self) - - def _free(self): - self.__class__.lib.time_t_vector_free(self) - - def getPointer(self): - """Returns the internal pointer for this instance.""" - return self.__class__.lib.time_t_vector_get_ptr(self) - - @classmethod - def initialize(cls, ert): - if not cls.initialized: - cls.lib = ert.util - ert.registerType("time_vector", time_vector) - ert.prototype("int time_t_vector_size(time_vector)", lib=ert.util) - ert.prototype("time_t time_t_vector_iget(time_vector, int)", lib=ert.util) - ert.prototype("long time_t_vector_get_ptr(time_vector)", lib=ert.util) - ert.prototype("void time_t_vector_free(time_vector)", lib=ert.util) - - cls.initialized = True - - -class double_vector(ctypes.c_long): - """Represents a vector of double objects""" - initialized = False - lib = None - - def __getitem__(self, item): - """Indexing support""" - return self.__class__.lib.double_vector_iget(self, item) - - def __iter__(self): - """Iterator support""" - return VectorIterator(self, self.size()) - - def __del__(self): - """Garbage collection""" - self._free() - - def size(self): - """The size of this vector""" - return self.__class__.lib.double_vector_size(self) - - def _free(self): - self.__class__.lib.double_vector_free(self) - - def getPointer(self): - """Returns the internal pointer for this instance.""" - return self.__class__.lib.double_vector_get_ptr(self) - - @classmethod - def initialize(cls, ert): - if not cls.initialized: - cls.lib = ert.util - ert.registerType("double_vector", double_vector) - ert.prototype("int double_vector_size(double_vector)", lib=ert.util) - ert.prototype("double double_vector_iget(double_vector, int)", lib=ert.util) - ert.prototype("long double_vector_get_ptr(double_vector)", lib=ert.util) - ert.prototype("void double_vector_free(double_vector)", lib=ert.util) - - cls.initialized = True diff --git a/ThirdParty/Ert/devel/python/python/ert/ert/ertwrapper.py b/ThirdParty/Ert/devel/python/python/ert/ert/ertwrapper.py deleted file mode 100644 index 39f4929748..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert/ert/ertwrapper.py +++ /dev/null @@ -1,247 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'ertwrapper.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. -from _ctypes import RTLD_GLOBAL - -import atexit -from ctypes import CDLL -import ctypes -import re -import sys -import os -from ert.ecl import ECL_LIB -from ert.enkf import libenkf -from ert.job_queue import JOB_QUEUE_LIB -from ert.util import UTIL_LIB -import erttypes -import ert.enkf.enkf_main as enkf - -def RH_version(): - RH = open('/etc/redhat-release' , 'r').read().split()[6] - return float( RH ) - - - -class ErtWrapper: - """Wraps the functionality of ERT using ctypes""" - - def __init__( self ): - self.__loadLibraries( ) - - self.pattern = re.compile("(?P[a-zA-Z][a-zA-Z0-9_*]*) +(?P[a-zA-Z]\w*) *[(](?P[a-zA-Z0-9_*, ]*)[)]") - self.__registerDefaultTypes() - - - def bootstrap(self, enkf_config , site_config , strict = True): - self.main = enkf.EnKFMain.bootstrap( enkf_config, site_config, strict ) - print "\nBootstrap complete!" - - self.initializeTypes() - - atexit.register(self.cleanup) - - - def __loadLibrary(self, name): - lib = "%s.so" % name - try: - lib_handle = CDLL( lib, RTLD_GLOBAL ) - return lib_handle - except: - raise AssertionError("Can not find library: %s" % (name)) - - - - def __loadLibraries(self ): - """Load libraries that are required by ERT and ERT itself""" - CDLL("libnsl.so" , RTLD_GLOBAL) - - LSF_HOME = os.getenv("LSF_HOME") - if LSF_HOME: - CDLL("%s/lib/liblsf.so" % LSF_HOME , RTLD_GLOBAL) - CDLL("%s/lib/libbat.so" % LSF_HOME , RTLD_GLOBAL) - else: - sys.exit("Need a value for environment variable LSF_HOME") - - self.util = UTIL_LIB - self.ecl = ECL_LIB - self.job_queue = JOB_QUEUE_LIB - self.enkf = libenkf.lib - self.enkf.enkf_main_install_SIGNALS() - - - def __registerDefaultTypes(self): - """Registers the default available types for prototyping.""" - self.registered_types = {} - self.registerType("void", None) - self.registerType("int", ctypes.c_int) - self.registerType("int*", ctypes.POINTER(ctypes.c_int)) - self.registerType("bool", ctypes.c_int) - self.registerType("bool*", ctypes.POINTER(ctypes.c_int)) - self.registerType("long", ctypes.c_long) - self.registerType("long*", ctypes.POINTER(ctypes.c_long)) - self.registerType("char", ctypes.c_char) - self.registerType("char*", ctypes.c_char_p) - self.registerType("float", ctypes.c_float) - self.registerType("float*", ctypes.POINTER(ctypes.c_float)) - self.registerType("double", ctypes.c_double) - self.registerType("double*", ctypes.POINTER(ctypes.c_double)) - - def registerType(self, type, value): - """Register a type against a legal ctypes type""" - self.registered_types[type] = value - - def __parseType(self, type): - """Convert a prototype definition type from string to a ctypes legal type.""" - type = type.strip() - - if self.registered_types.has_key(type): - return self.registered_types[type] - else: - return getattr(ctypes, type) - - def prototype(self, prototype, lib=None): - """ - Defines the return type and arguments for a C-function - - prototype expects a string formatted like this: - - #type functionName(type, ... ,type)# - - where type is a type available to ctypes - Some type are automatically converted: - int -> c_int - long -> c_long - char -> c_char_p - bool -> c_int - void -> None - double -> c_double - float -> c_float - - There are also pointer versions of these: - long* -> POINTER(c_long) - bool* -> POINTER(c_int) - double* -> POINTER(c_double) - char* -> c_char_p - ... - - if lib is None lib defaults to the enkf library - """ - if lib is None: - lib = self.enkf - - match = re.match(self.pattern, prototype) - if not match: - sys.stderr.write("Illegal prototype definition: %s\n" % (prototype)) - return None - else: - restype = match.groupdict()["return"] - functioname = match.groupdict()["function"] - arguments = match.groupdict()["arguments"].split(",") - - func = getattr(lib , functioname) - func.restype = self.__parseType(restype) - - if len(arguments) == 1 and arguments[0].strip() == "": - func.argtypes = [] - else: - argtypes = [self.__parseType(arg) for arg in arguments] - if len(argtypes) == 1 and argtypes[0] is None: - argtypes = [] - func.argtypes = argtypes - - #print func, func.restype, func.argtyp - return func - - def initializeTypes(self): - self.prototype("long hash_iter_alloc(long)", lib=self.util) - self.prototype("char* hash_iter_get_next_key(long)", lib=self.util) - self.prototype("char* hash_get(long, char*)", lib=self.util) - self.prototype("int hash_get_int(long, char*)", lib=self.util) - self.prototype("void hash_iter_free(long)", lib=self.util) - self.prototype("bool hash_iter_is_complete(long)", lib=self.util) - - self.prototype("int subst_list_get_size(long)", lib=self.util) - self.prototype("char* subst_list_iget_key(long, int)", lib=self.util) - self.prototype("char* subst_list_iget_value(long, int)", lib=self.util) - - self.prototype("void enkf_main_fprintf_config(long)") - self.prototype("void enkf_main_create_new_config(long , char*, char* , char* , int)") - - - self.registerType("time_t", erttypes.time_t) - erttypes.time_vector.initialize(self) - erttypes.double_vector.initialize(self) - - - def getHash(self, hashpointer, intValue = False, return_type="char*"): - """Retrieves a hash as a list of 2 element lists""" - if hashpointer == 0: - return [] - - hash_iterator = self.util.hash_iter_alloc(hashpointer) - self.prototype("%s hash_get(long)" % (return_type), lib = self.util) - - result = [] - while not self.util.hash_iter_is_complete(hash_iterator): - key = self.util.hash_iter_get_next_key(hash_iterator) - - if not intValue: - value = self.util.hash_get(hashpointer, key) - else: - value = self.util.hash_get_int(hashpointer, key) - #print "%s -> %d" % (key , value) - - result.append([key, str(value)]) - - self.util.hash_iter_free(hash_iterator) - #print result - return result - - def getSubstitutionList(self, substlistpointer): - """Retrieves a substitution list as a list of 2 element lists""" - size = self.util.subst_list_get_size(substlistpointer) - - result = [] - for index in range(size): - key = self.util.subst_list_iget_key(substlistpointer, index) - value = self.util.subst_list_iget_value(substlistpointer, index) - result.append([key, value]) - - return result - - def __getErtPointer(self, function): - """Returns a pointer from ERT as a c_long (64-bit support)""" - func = getattr( self.enkf, function ) - func.restype = ctypes.c_long # Should be c_size_t - if that exists. - return func( self.main ) - - - def cleanup(self): - """Called at atexit to clean up before shutdown""" - print "Calling enkf_main_free()" - self.main.__del__ - - def nonify(self, s): - """Convert an empty string to None.""" - return s or None - - def save(self): - """Save the state of ert to a configuration file.""" - self.main.fprintf_config - - - - - diff --git a/ThirdParty/Ert/devel/python/python/ert/job_queue/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert/job_queue/CMakeLists.txt index 77386d8609..5d7c9c1f3b 100644 --- a/ThirdParty/Ert/devel/python/python/ert/job_queue/CMakeLists.txt +++ b/ThirdParty/Ert/devel/python/python/ert/job_queue/CMakeLists.txt @@ -1,11 +1,13 @@ set(PYTHON_SOURCES __init__.py driver.py - job.py - queue.py ext_job.py ext_joblist.py forward_model.py + job.py + job_status_type_enum.py + queue.py ) -add_python_package("Python ert.job_queue" ${PYTHON_INSTALL_PREFIX}/ert/job_queue "${PYTHON_SOURCES}" True) +add_python_package("Python ert.job_queue" ${PYTHON_INSTALL_PREFIX}/ert/job_queue "${PYTHON_SOURCES}" True) + diff --git a/ThirdParty/Ert/devel/python/python/ert/job_queue/__init__.py b/ThirdParty/Ert/devel/python/python/ert/job_queue/__init__.py index 97e06ca9e9..493a9c78d2 100644 --- a/ThirdParty/Ert/devel/python/python/ert/job_queue/__init__.py +++ b/ThirdParty/Ert/devel/python/python/ert/job_queue/__init__.py @@ -78,4 +78,5 @@ def setenv( var, value): from .driver import QueueDriverEnum, Driver, LSFDriver, RSHDriver, LocalDriver from .ext_job import ExtJob from .ext_joblist import ExtJoblist -from .forward_model import ForwardModel \ No newline at end of file +from .forward_model import ForwardModel +from .job_status_type_enum import JobStatusType \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert/job_queue/job_status_type_enum.py b/ThirdParty/Ert/devel/python/python/ert/job_queue/job_status_type_enum.py new file mode 100644 index 0000000000..a3b16dc628 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/job_queue/job_status_type_enum.py @@ -0,0 +1,39 @@ +# Copyright (C) 2013 Statoil ASA, Norway. +# +# The file 'job_status_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +from ert.cwrap import BaseCEnum +from ert.job_queue import JOB_QUEUE_LIB + + +class JobStatusType(BaseCEnum): + JOB_QUEUE_NOT_ACTIVE = None # This value is used in external query routines - for jobs which are (currently) not active. */ + JOB_QUEUE_WAITING = None # A node which is waiting in the internal queue. + JOB_QUEUE_SUBMITTED = None # Internal status: It has has been submitted - the next status update will (should) place it as pending or running. + JOB_QUEUE_PENDING = None # A node which is pending - a status returned by the external system. I.e LSF + JOB_QUEUE_RUNNING = None # The job is running + JOB_QUEUE_DONE = None # The job is done - but we have not yet checked if the target file is produced */ + JOB_QUEUE_EXIT = None # The job has exited - check attempts to determine if we retry or go to complete_fail */ + JOB_QUEUE_USER_KILLED = None # The job has been killed by the user - can restart. */ + JOB_QUEUE_USER_EXIT = None # The whole job_queue has been exited by the user - the job can NOT be restarted. */ + JOB_QUEUE_SUCCESS = None + JOB_QUEUE_RUNNING_CALLBACK = None + JOB_QUEUE_FAILED = None + +JobStatusType.populateEnum(JOB_QUEUE_LIB, "queue_driver_status_enum_iget") +JobStatusType.registerEnum(JOB_QUEUE_LIB, "job_status_type_enum") + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert/job_queue/queue.py b/ThirdParty/Ert/devel/python/python/ert/job_queue/queue.py index b0bd7e4d1a..949d2ee06f 100644 --- a/ThirdParty/Ert/devel/python/python/ert/job_queue/queue.py +++ b/ThirdParty/Ert/devel/python/python/ert/job_queue/queue.py @@ -171,11 +171,14 @@ def submit( self, cmd, run_path, job_name, argv, num_cpu=1): done_callback = None callback_arg = None retry_callback = None + exit_callback = None + queue_index = JobQueue.cNamespace().add_job_mt(self, cmd, done_callback, retry_callback, + exit_callback, callback_arg, num_cpu, run_path, @@ -252,7 +255,7 @@ def get_max_running( self ): def set_max_running( self, max_running ): self.driver.set_max_running(max_running) - def user_exit(self): + def killAllJobs(self): JobQueue.cNamespace().user_exit(self) def set_pause_on(self): @@ -277,8 +280,8 @@ def free(self): JobQueue.cNamespace().set_max_running = cwrapper.prototype("void job_queue_set_max_running( job_queue , int)") JobQueue.cNamespace().get_max_running = cwrapper.prototype("int job_queue_get_max_running( job_queue )") JobQueue.cNamespace().set_driver = cwrapper.prototype("void job_queue_set_driver( job_queue , c_void_p )") -JobQueue.cNamespace().add_job_mt = cwrapper.prototype("int job_queue_add_job_mt( job_queue , char* , c_void_p , c_void_p , c_void_p , int , char* , char* , int , char**)") -JobQueue.cNamespace().add_job_st = cwrapper.prototype("int job_queue_add_job_st( job_queue , char* , c_void_p , c_void_p , c_void_p , int , char* , char* , int , char**)") +JobQueue.cNamespace().add_job_mt = cwrapper.prototype("int job_queue_add_job_mt( job_queue , char* , c_void_p , c_void_p , c_void_p , c_void_p , int , char* , char* , int , char**)") +JobQueue.cNamespace().add_job_st = cwrapper.prototype("int job_queue_add_job_st( job_queue , char* , c_void_p , c_void_p , c_void_p , c_void_p , int , char* , char* , int , char**)") JobQueue.cNamespace().start_queue = cwrapper.prototype("void job_queue_run_jobs( job_queue , int , bool)") JobQueue.cNamespace().run_jobs = cwrapper.prototype("void job_queue_run_jobs_threaded(job_queue , int , bool)") diff --git a/ThirdParty/Ert/devel/python/python/ert/test_run/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert/test_run/CMakeLists.txt new file mode 100644 index 0000000000..dc9b4b3976 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/test_run/CMakeLists.txt @@ -0,0 +1,8 @@ +SET(PYTHON_SOURCES + __init__.py + test_run.py + ) + +add_python_package("Python ert.test_run" ${PYTHON_INSTALL_PREFIX}/ert/test_run "${PYTHON_SOURCES}" True) + + diff --git a/ThirdParty/Ert/devel/python/python/ert/test_run/__init__.py b/ThirdParty/Ert/devel/python/python/ert/test_run/__init__.py new file mode 100644 index 0000000000..df85fe2bb2 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/test_run/__init__.py @@ -0,0 +1,2 @@ +from .test_run import TestRun +from .test_run import path_exists diff --git a/ThirdParty/Ert/devel/python/python/ert/test_run/test_run.py b/ThirdParty/Ert/devel/python/python/ert/test_run/test_run.py new file mode 100644 index 0000000000..079fc88d86 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert/test_run/test_run.py @@ -0,0 +1,151 @@ +# Copyright (C) 2013 Statoil ASA, Norway. +# +# The file 'test_run.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, teither version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +import random +import os.path +import subprocess +from ert.util import TestAreaContext + + +def path_exists( path ): + if os.path.exists( path ): + return (True , "Path:%s exists" % path) + else: + return (False , "ERROR: Path:%s does not exist" % path) + + +class TestRun(object): + default_ert_cmd = "ert" + default_path_prefix = None + + def __init__(self , config_file , name = None): + if os.path.exists( config_file ) and os.path.isfile( config_file ): + self.__ert_cmd = TestRun.default_ert_cmd + self.path_prefix = TestRun.default_path_prefix + self.config_file = config_file + + self.check_list = [] + self.args = [] + self.workflows = [] + if name: + self.name = name + else: + self.name = config_file.replace("/" , ".") + while True: + if self.name[0] == ".": + self.name = self.name[1:] + else: + break + self.name += "/%08d" % random.randint(0,100000000) + else: + raise IOError("No such config file: %s" % config_file) + + + def get_config_file(self): + return self.__config_file + + def set_config_file(self , input_config_file): + self.__config_file = os.path.basename( input_config_file ) + self.abs_config_file = os.path.abspath( input_config_file ) + + config_file = property( get_config_file , set_config_file ) + + #----------------------------------------------------------------- + + def set_path_prefix(self , path_prefix): + self.__path_prefix = path_prefix + + def get_path_prefix(self): + return self.__path_prefix + + path_prefix = property( get_path_prefix , set_path_prefix ) + + #----------------------------------------------------------------- + + def get_ert_cmd(self): + return self.__ert_cmd + + def set_ert_cmd(self , cmd): + self.__ert_cmd = cmd + + ert_cmd = property( get_ert_cmd , set_ert_cmd) + + #----------------------------------------------------------------- + + def get_args(self): + return self.args + + + def add_arg(self , arg): + self.args.append(arg) + + #----------------------------------------------------------------- + + def get_workflows(self): + return self.workflows + + + def add_workflow(self , workflow): + self.workflows.append( workflow ) + + #----------------------------------------------------------------- + + def add_check( self , check_func , arg): + if callable(check_func): + self.check_list.append( (check_func , arg) ) + else: + raise Exception("The checker:%s is not callable" % check_func ) + + #----------------------------------------------------------------- + + def __run(self , work_area ): + argList = [ self.ert_cmd ] + for arg in self.args: + argList.append( arg ) + + argList.append( self.config_file ) + for wf in self.workflows: + argList.append( wf ) + + status = subprocess.call( argList ) + if status == 0: + return (True , "ert has run successfully") + else: + return (False , "ERROR:: ert exited with status code:%s" % status) + + + def run(self): + if len(self.workflows): + with TestAreaContext(self.name , prefix = self.path_prefix , store_area = True) as work_area: + test_cwd = work_area.get_cwd() + work_area.copy_parent_content( self.abs_config_file ) + status = self.__run( work_area ) + global_status = status[0] + + status_list = [ status ] + if status[0]: + for (check_func , arg) in self.check_list: + status = check_func( arg ) + status_list.append( status ) + if not status[0]: + global_status = False + + if not global_status: + work_area.set_store( True ) + + return (global_status , test_cwd , status_list) + else: + raise Exception("Must have added workflows before invoking start()") + diff --git a/ThirdParty/Ert/devel/python/python/ert/util/__init__.py b/ThirdParty/Ert/devel/python/python/ert/util/__init__.py index 469a1d645b..ca4a9b8c8e 100644 --- a/ThirdParty/Ert/devel/python/python/ert/util/__init__.py +++ b/ThirdParty/Ert/devel/python/python/ert/util/__init__.py @@ -65,4 +65,5 @@ from .ctime import ctime from .hash import Hash, StringHash, DoubleHash, IntegerHash from .latex import LaTeX -from .substitution_list import SubstitutionList \ No newline at end of file +from .substitution_list import SubstitutionList +from .test_area import TestArea , TestAreaContext diff --git a/ThirdParty/Ert/devel/python/python/ert/util/hash.py b/ThirdParty/Ert/devel/python/python/ert/util/hash.py index 6242324e86..7fedcd14ec 100644 --- a/ThirdParty/Ert/devel/python/python/ert/util/hash.py +++ b/ThirdParty/Ert/devel/python/python/ert/util/hash.py @@ -58,6 +58,9 @@ def keys(self): def free(self): Hash.cNamespace().free(self) + def __str__(self): + return str(["%s: %s" % (key, self[key]) for key in self.keys()]) + class StringHash(Hash): def __init__(self): diff --git a/ThirdParty/Ert/devel/python/python/ert/util/stringlist.py b/ThirdParty/Ert/devel/python/python/ert/util/stringlist.py index 6501527e47..2eb8e167e9 100644 --- a/ThirdParty/Ert/devel/python/python/ert/util/stringlist.py +++ b/ThirdParty/Ert/devel/python/python/ert/util/stringlist.py @@ -58,7 +58,7 @@ def __init__( self, initial=None): ownership of the underlying object. """ - c_ptr = StringList.cNamespace().stringlist_alloc() + c_ptr = StringList.cNamespace().alloc() super(StringList, self).__init__(c_ptr) if initial: @@ -79,7 +79,7 @@ def __setitem__(self, index, value): if index < 0 or index >= length: raise IndexError if isinstance(value, StringType): - StringList.cNamespace().stringlist_iset(self, index, value) + StringList.cNamespace().iset(self, index, value) else: raise TypeError("Item:%s not string type" % value) @@ -98,7 +98,7 @@ def __getitem__(self, index): if index < 0 or index >= length: raise IndexError else: - return StringList.cNamespace().stringlist_iget(self, index) + return StringList.cNamespace().iget(self, index) else: raise TypeError("Index should be integer type") @@ -124,7 +124,7 @@ def __len__(self): """ The length of the list - used to support builtin len(). """ - return StringList.cNamespace().stringlist_get_size(self) + return StringList.cNamespace().get_size(self) def __str__(self): @@ -159,7 +159,7 @@ def append(self, s): Appends a new string @s to list. """ if isinstance(s, StringType): - StringList.cNamespace().stringlist_append(self, s) + StringList.cNamespace().append(self, s) else: sys.exit("Type mismatch") @@ -202,6 +202,11 @@ def sort(self, cmp_flag=0): """ StringList.cNamespace().sort(self, cmp_flag) + def index(self, value): + """ @rtype: int """ + assert isinstance(value, str) + return StringList.cNamespace().find_first(self, value) + def free(self): StringList.cNamespace().free(self) @@ -211,14 +216,15 @@ def free(self): CWrapper.registerType("stringlist_ref", StringList.createCReference) cwrapper = CWrapper(UTIL_LIB) -StringList.cNamespace().stringlist_alloc = cwrapper.prototype("c_void_p stringlist_alloc_new( )") +StringList.cNamespace().alloc = cwrapper.prototype("c_void_p stringlist_alloc_new( )") StringList.cNamespace().free = cwrapper.prototype("void stringlist_free( stringlist )") -StringList.cNamespace().stringlist_append = cwrapper.prototype("void stringlist_append_copy( stringlist , char* )") -StringList.cNamespace().stringlist_iget = cwrapper.prototype("char* stringlist_iget( stringlist , int )") -StringList.cNamespace().stringlist_iget_copy = cwrapper.prototype("char* stringlist_iget_copy(stringlist, int)") -StringList.cNamespace().stringlist_iset = cwrapper.prototype("void stringlist_iset_copy( stringlist , int , char* )") -StringList.cNamespace().stringlist_get_size = cwrapper.prototype("int stringlist_get_size( stringlist )") +StringList.cNamespace().append = cwrapper.prototype("void stringlist_append_copy( stringlist , char* )") +StringList.cNamespace().iget = cwrapper.prototype("char* stringlist_iget( stringlist , int )") +StringList.cNamespace().iget_copy = cwrapper.prototype("char* stringlist_iget_copy(stringlist, int)") +StringList.cNamespace().iset = cwrapper.prototype("void stringlist_iset_copy( stringlist , int , char* )") +StringList.cNamespace().get_size = cwrapper.prototype("int stringlist_get_size( stringlist )") StringList.cNamespace().contains = cwrapper.prototype("bool stringlist_contains(stringlist , char*)") StringList.cNamespace().sort = cwrapper.prototype("void stringlist_python_sort( stringlist , int)") StringList.cNamespace().pop = cwrapper.safe_prototype("char* stringlist_pop( stringlist )") StringList.cNamespace().last = cwrapper.safe_prototype("char* stringlist_get_last( stringlist )") +StringList.cNamespace().find_first = cwrapper.safe_prototype("int stringlist_find_first(stringlist, char*)") diff --git a/ThirdParty/Ert/devel/python/python/ert/util/test_area.py b/ThirdParty/Ert/devel/python/python/ert/util/test_area.py index a4316686be..49123fcd6e 100644 --- a/ThirdParty/Ert/devel/python/python/ert/util/test_area.py +++ b/ThirdParty/Ert/devel/python/python/ert/util/test_area.py @@ -13,19 +13,28 @@ # # See the GNU General Public License at # for more details. +import os.path from ert.cwrap import clib, BaseCClass, CWrapper - - -lib = clib.ert_load("libtest_util.so") +from ert.util import UTIL_LIB class TestArea(BaseCClass): - def __init__(self, test_name, store_area=False): - c_ptr = TestArea.cNamespace().test_area_alloc(test_name, store_area) + def __init__(self, test_name, prefix = None , store_area=False): + if prefix: + if os.path.exists( prefix ): + c_ptr = TestArea.cNamespace().test_area_alloc__(prefix , test_name) + else: + raise IOError("The prefix path:%s must exist" % prefix) + else: + c_ptr = TestArea.cNamespace().test_area_alloc(test_name) super(TestArea, self).__init__(c_ptr) + self.set_store( store_area ) + - + def get_cwd(self): + return TestArea.cNamespace().get_cwd(self) + def install_file( self, filename): TestArea.cNamespace().install_file(self, filename) @@ -34,6 +43,11 @@ def install_file( self, filename): def copy_directory( self, directory): TestArea.cNamespace().copy_directory(self, directory) + def copy_parent_directory( self , path): + TestArea.cNamespace().copy_parent_directory(self , path) + + def copy_parent_content( self , path): + TestArea.cNamespace().copy_parent_content(self , path) def copy_directory_content( self, directory): TestArea.cNamespace().copy_directory_content(self, directory) @@ -44,17 +58,22 @@ def copy_file( self, filename): def free(self): TestArea.cNamespace().free(self) + def set_store(self, store): + TestArea.cNamespace().set_store(self , store) + + class TestAreaContext(object): - def __init__(self, test_name, store_area=False): + def __init__(self, test_name, prefix = None , store_area=False): self.test_name = test_name self.store_area = store_area + self.prefix = prefix def __enter__(self): """ @rtype: TestArea """ - self.test_area = TestArea(self.test_name, self.store_area) + self.test_area = TestArea(self.test_name, prefix = self.prefix , store_area = self.store_area ) return self.test_area @@ -64,14 +83,19 @@ def __exit__(self, exc_type, exc_val, exc_tb): -cwrapper = CWrapper(lib) +cwrapper = CWrapper(UTIL_LIB) CWrapper.registerType("test_area", TestArea) CWrapper.registerType("test_area_obj", TestArea.createPythonObject) CWrapper.registerType("test_area_ref", TestArea.createCReference) -TestArea.cNamespace().test_area_alloc = cwrapper.prototype("c_void_p test_work_area_alloc( char* , bool)") +TestArea.cNamespace().test_area_alloc = cwrapper.prototype("c_void_p test_work_area_alloc( char* )") +TestArea.cNamespace().test_area_alloc__ = cwrapper.prototype("c_void_p test_work_area_alloc__( char* , char* )") TestArea.cNamespace().free = cwrapper.prototype("void test_work_area_free( test_area )") TestArea.cNamespace().install_file = cwrapper.prototype("void test_work_area_install_file( test_area , char* )") TestArea.cNamespace().copy_directory = cwrapper.prototype("void test_work_area_copy_directory( test_area , char* )") TestArea.cNamespace().copy_file = cwrapper.prototype("void test_work_area_copy_file( test_area , char* )") TestArea.cNamespace().copy_directory_content = cwrapper.prototype("void test_work_area_copy_directory_content( test_area , char* )") +TestArea.cNamespace().copy_parent_directory = cwrapper.prototype("void test_work_area_copy_parent_directory( test_area , char* )") +TestArea.cNamespace().copy_parent_content = cwrapper.prototype("void test_work_area_copy_parent_content( test_area , char* )") +TestArea.cNamespace().get_cwd = cwrapper.prototype("char* test_work_area_get_cwd( test_area )") +TestArea.cNamespace().set_store = cwrapper.prototype("void test_work_area_set_store( test_area , bool)") diff --git a/ThirdParty/Ert/devel/python/python/ert/util/tvector.py b/ThirdParty/Ert/devel/python/python/ert/util/tvector.py index 680a0e746b..9b3c3c7efd 100644 --- a/ThirdParty/Ert/devel/python/python/ert/util/tvector.py +++ b/ThirdParty/Ert/devel/python/python/ert/util/tvector.py @@ -143,7 +143,7 @@ def str(self , width = 5 , max_lines = 10 , fmt = None): s = "" lines = self.size / width if not fmt: - fmt = self.def_fmt + " " + fmt = self.default_format + " " if max_lines is None or lines <= max_lines: s += self.str_data( width , 0 , self.size , fmt) @@ -366,7 +366,7 @@ def printf( self , fmt = None , name = None , stream = sys.stdout ): """ cfile = CFILE( stream ) if not fmt: - fmt = self.def_fmt + fmt = self.default_format self.cNamespace().fprintf(self , cfile , name , fmt) @property @@ -491,11 +491,15 @@ def numpy_copy(self): # invoke the ugly cls.initialized flag. class DoubleVector(TVector): + default_format = "%8.4f" + def __init__(self, default_value=0, initial_size=0): super(DoubleVector, self).__init__(default_value, initial_size) class BoolVector(TVector): + default_format = "%8d" + def __init__(self, default_value=0, initial_size=0): super(BoolVector, self).__init__(default_value, initial_size) @@ -513,16 +517,18 @@ def active_mask(cls , range_string): "1,4-7,10X" => {} The empty list will evaluate to false + @rtype: BoolVector """ return cls.cNamespace().create_active_mask(range_string) @classmethod - def create_from_list(cls, size, source_list): - """Allocates a bool vector from a Python list""" + def createFromList(cls, size, source_list): + """Allocates a bool vector from a Python list of indexes""" bool_vector = BoolVector(False, size) - for index in range(len(source_list)): - bool_vector[index] = source_list[index] + for index in source_list: + index = int(index) + bool_vector[index] = True return bool_vector @@ -532,7 +538,7 @@ def create_from_list(cls, size, source_list): class IntVector(TVector): - + default_format = "%d" def __init__(self, default_value=0, initial_size=0): super(IntVector, self).__init__(default_value, initial_size) @@ -556,6 +562,8 @@ def active_list(cls , range_string): class TimeVector(TVector): + default_format = "%d" + def __init__(self, default_value=0, initial_size=0): super(TimeVector, self).__init__(default_value, initial_size) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/CMakeLists.txt index 9df22897b1..3eafe0fa49 100644 --- a/ThirdParty/Ert/devel/python/python/ert_gui/CMakeLists.txt +++ b/ThirdParty/Ert/devel/python/python/ert_gui/CMakeLists.txt @@ -1,3 +1,12 @@ -add_python_package( "Python ert_gui" ${PYTHON_INSTALL_PREFIX}/ert_gui "__init__.py;gert_main.py;newconfig.py" True) -add_subdirectory( pages ) -add_subdirectory( widgets ) +set(PYTHON_SOURCES + __init__.py + gert_main.py + main_window.py + newconfig.py +) + +add_python_package("Python ert_gui" ${PYTHON_INSTALL_PREFIX}/ert_gui "${PYTHON_SOURCES}" True) + +add_subdirectory(models) +add_subdirectory(pages) +add_subdirectory(widgets) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/__init__.py index e69de29bb2..862a10d88c 100644 --- a/ThirdParty/Ert/devel/python/python/ert_gui/__init__.py +++ b/ThirdParty/Ert/devel/python/python/ert_gui/__init__.py @@ -0,0 +1,12 @@ +import sys +import warnings + +ABSOLUTE_REQUIRED_VERSION_HEX = 0x02060000 +WARNING_REQUIRED_VERSION_HEX = 0x02070000 + + +if sys.hexversion < ABSOLUTE_REQUIRED_VERSION_HEX: + raise Exception("ERT GUI Python requires at least version 2.6 of Python") + +if sys.hexversion < WARNING_REQUIRED_VERSION_HEX: + warnings.warn("To get optimal graphical performance you should use Python 2.7") diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/gert_main.py b/ThirdParty/Ert/devel/python/python/ert_gui/gert_main.py index 0f19da4192..ec3cf9e781 100644 --- a/ThirdParty/Ert/devel/python/python/ert_gui/gert_main.py +++ b/ThirdParty/Ert/devel/python/python/ert_gui/gert_main.py @@ -110,102 +110,101 @@ # #-------------------- -------------------- -from PyQt4 import QtGui, QtCore import sys import os - - -from ert.ert.ertwrapper import ErtWrapper +from PyQt4.QtCore import Qt +from PyQt4.QtGui import QApplication, QSplashScreen +from ert.enkf import EnKFMain +from ert_gui.main_window import GertMainWindow +from ert_gui.models import ErtConnector +from ert_gui.pages.configuration_panel import ConfigurationPanel +from ert_gui.pages.simulation_panel import SimulationPanel +from ert_gui.widgets.help_dock import HelpDock import ert_gui.widgets.util -import ert_gui.widgets.help -ert_gui.widgets.help.help_prefix = os.getenv("ERT_SHARE_PATH")+ "/gui/help/" -ert_gui.widgets.util.img_prefix = os.getenv("ERT_SHARE_PATH")+ "/gui/img/" -from ert.enkf.enkf_main import EnKFMain +ert_gui.widgets.util.img_prefix = os.getenv("ERT_SHARE_PATH") + "/gui/img/" from ert_gui.newconfig import NewConfigurationDialog -from ert_gui.pages.application import Application -from ert_gui.pages.init.initpanel import InitPanel -from ert_gui.pages.run.runpanel import RunPanel -from ert_gui.widgets.helpedwidget import ContentModel -from ert_gui.widgets.util import resourceImage, resourceIcon - +from ert_gui.widgets.util import resourceImage -import matplotlib def main(): - app = QtGui.QApplication(sys.argv) #Early so that QT is initialized before other imports - from ert_gui.pages.config.configpages import ConfigPages - from ert_gui.pages.plot.plotpanel import PlotPanel + QApplication.setGraphicsSystem("raster") + app = QApplication(sys.argv) #Early so that QT is initialized before other imports - splash = QtGui.QSplashScreen(resourceImage("newsplash") , QtCore.Qt.WindowStaysOnTopHint) + splash = QSplashScreen(resourceImage("newsplash"), Qt.WindowStaysOnTopHint) splash.show() - splash.showMessage("Starting up...", QtCore.Qt.AlignLeft, QtCore.Qt.white) + splash.showMessage("Starting up...", Qt.AlignLeft, Qt.white) app.processEvents() - window = Application() + HelpDock.setHelpLinkPrefix(os.getenv("ERT_SHARE_PATH") + "/gui/help/") - splash.showMessage("Bootstrapping...", QtCore.Qt.AlignLeft, QtCore.Qt.white) + splash.showMessage("Bootstrapping...", Qt.AlignLeft, Qt.white) app.processEvents() - - ert = ErtWrapper( ) - strict = True + + strict = True site_config = os.getenv("ERT_SITE_CONFIG") if len(sys.argv) == 1: - print "-----------------------------------------------------------------" - print "-- You must supply the name of configuration file as the first --" - print "-- commandline argument: --" - print "-- --" - print "-- bash% gert --" - print "-- --" - print "-- If the configuration file does not exist, gert will create --" - print "-- create a new configuration file. --" - print "-----------------------------------------------------------------" - #sys.exit(0) + print("-----------------------------------------------------------------") + print("-- You must supply the name of configuration file as the first --") + print("-- commandline argument: --") + print("-- --") + print("-- bash% gert --") + print("-- --") + print("-- If the configuration file does not exist, gert will create --") + print("-- create a new configuration file. --") + print("-----------------------------------------------------------------") else: enkf_config = sys.argv[1] if not os.path.exists(enkf_config): - print "Trying to start new config" + print("Trying to start new config") new_configuration_dialog = NewConfigurationDialog(enkf_config) success = new_configuration_dialog.exec_() if not success: - print "Can not run without a configuration file." + print("Can not run without a configuration file.") sys.exit(1) else: - enkf_config = new_configuration_dialog.getConfigurationPath() + enkf_config = new_configuration_dialog.getConfigurationPath() firste_case_name = new_configuration_dialog.getCaseName() - dbase_type = new_configuration_dialog.getDBaseType() + dbase_type = new_configuration_dialog.getDBaseType() num_realizations = new_configuration_dialog.getNumberOfRealizations() - storage_path = new_configuration_dialog.getStoragePath() + storage_path = new_configuration_dialog.getStoragePath() - EnKFMain.create_new_config(enkf_config, storage_path , firste_case_name, dbase_type, num_realizations) + EnKFMain.createNewConfig(enkf_config, storage_path, firste_case_name, dbase_type, num_realizations) strict = False - ert.bootstrap(enkf_config, site_config = site_config, strict = strict) - window.setSaveFunction(ert.save) + ert = EnKFMain(enkf_config, site_config=site_config, strict=strict) + ErtConnector.setErt(ert) + + window = GertMainWindow() + window.setSaveFunction(ert.saveConfig()) - splash.showMessage("Creating GUI...", QtCore.Qt.AlignLeft, QtCore.Qt.white) + splash.showMessage("Creating GUI...", Qt.AlignLeft, Qt.white) app.processEvents() - window.addPage("Configuration", resourceIcon("config"), ConfigPages(window)) - window.addPage("Init" , resourceIcon("db"), InitPanel(window)) - window.addPage("Run" , resourceIcon("run"), RunPanel(window)) - window.addPage("Plots", resourceIcon("plot"), PlotPanel()) + simulation_panel = SimulationPanel() + window.addTab(simulation_panel.getName(), simulation_panel) + configuration_panel = ConfigurationPanel() + window.addTab(configuration_panel.getName(), configuration_panel) - splash.showMessage("Communicating with ERT...", QtCore.Qt.AlignLeft, QtCore.Qt.white) + splash.showMessage("Communicating with ERT...", Qt.AlignLeft, Qt.white) app.processEvents() - ContentModel.contentModel = ert - ContentModel.updateObservers() + window.show() splash.finish(window) + + + HelpDock.setHelpMessageLink("welcome_to_ert") + sys.exit(app.exec_()) -if __name__ =="__main__": + +if __name__ == "__main__": main() diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/main_window.py b/ThirdParty/Ert/devel/python/python/ert_gui/main_window.py new file mode 100644 index 0000000000..e813b46af8 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/main_window.py @@ -0,0 +1,67 @@ +from PyQt4.QtCore import QSettings, Qt +from PyQt4.QtGui import QMainWindow, QTabWidget, qApp +from ert_gui.widgets.help_dock import HelpDock + + +class GertMainWindow(QMainWindow): + """An application (window widget) with a list of "tasks" on the left side and a panel on the right side""" + + def __init__(self): + """Constructor""" + QMainWindow.__init__(self) + + self.resize(900, 700) + self.setWindowTitle('gERT') + + self.tabs = QTabWidget() + self.setCentralWidget(self.tabs) + + self.help_dock = HelpDock.getInstance() + self.addDockWidget(Qt.RightDockWidgetArea, self.help_dock) + + + self.__createMenu() + self.save_function = None + self.__fetchSettings() + + + def setSaveFunction(self, save_function): + """Set the function to be called when the save menu choice is selected.""" + self.save_function = save_function + + def addTab(self, name, tab_widget): + self.tabs.addTab(tab_widget, name) + + def __save(self): + if not self.save_function is None: + self.save_function() + + def __createMenu(self): + file_menu = self.menuBar().addMenu("&File") + file_menu.addAction("Save Config File", self.__save) + file_menu.addAction("Close", self.__quit) + + view_menu = self.menuBar().addMenu("&View") + view_menu.addAction(self.help_dock.toggleViewAction()) + + def __quit(self): + self.__saveSettings() + qApp.quit() + + def __saveSettings(self): + settings = QSettings("Statoil", "ErtGui") + settings.setValue("geometry", self.saveGeometry()) + settings.setValue("windowState", self.saveState()) + + def closeEvent(self, event): + #Use QT settings saving mechanism + #settings stored in ~/.config/Statoil/ErtGui.conf + self.__saveSettings() + QMainWindow.closeEvent(self, event) + + def __fetchSettings(self): + settings = QSettings("Statoil", "ErtGui") + self.restoreGeometry(settings.value("geometry").toByteArray()) + self.restoreState(settings.value("windowState").toByteArray()) + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/models/CMakeLists.txt new file mode 100644 index 0000000000..2ade2b4bd6 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/CMakeLists.txt @@ -0,0 +1,11 @@ +set(PYTHON_SOURCES + __init__.py + ert_connector.py + observable.py + weak_method.py +) + +add_python_package("Python ert_gui.models" ${PYTHON_INSTALL_PREFIX}/ert_gui/models "${PYTHON_SOURCES}" True) + +add_subdirectory(connectors) +add_subdirectory(mixins) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/__init__.py new file mode 100644 index 0000000000..6823836b51 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/__init__.py @@ -0,0 +1,3 @@ +from .weak_method import WeakMethod +from .observable import Observable +from .ert_connector import ErtConnector diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/CMakeLists.txt new file mode 100644 index 0000000000..fea143e17b --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/CMakeLists.txt @@ -0,0 +1,13 @@ +set(PYTHON_SOURCES + __init__.py + case_selector.py + ensemble_resizer.py + run_path.py + simulation_mode.py +) + +add_python_package("Python ert_gui.models.connectors" ${PYTHON_INSTALL_PREFIX}/ert_gui/models/connectors "${PYTHON_SOURCES}" True) + +add_subdirectory(init) +add_subdirectory(queue_system) +add_subdirectory(run) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/__init__.py new file mode 100644 index 0000000000..ed494ce567 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/__init__.py @@ -0,0 +1,2 @@ +from .ensemble_resizer import EnsembleSizeModel +from .run_path import RunPathModel diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/case_selector.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/case_selector.py new file mode 100644 index 0000000000..1d097007bf --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/case_selector.py @@ -0,0 +1,33 @@ +from ert_gui.models import ErtConnector +from ert.util import StringList +from ert_gui.models.mixins import ChoiceModelMixin +from ert_gui.widgets.util import may_take_a_long_time + + +class CaseModel(ErtConnector, ChoiceModelMixin): + def __init__(self): + self.observable().addEvent(self.CURRENT_CHOICE_CHANGED_EVENT) + self.observable().addEvent(self.CHOICE_LIST_CHANGED_EVENT) + + def initialize(self): + self.observable().notify(self.CHOICE_LIST_CHANGED_EVENT) + self.observable().notify(self.CURRENT_CHOICE_CHANGED_EVENT) + + def getChoices(self): + """ @rtype: StringList """ + fs = self.ert().getFileSystem() + case_list = self.ert().getCaseList() + return case_list + + def getCurrentChoice(self): + """ @rtype: str """ + case_list = self.getChoices() + current_case = self.ert().getFileSystem() + return current_case.getCaseName() + + @may_take_a_long_time + def setCurrentChoice(self, case): + case = str(case) + if not case == "": + self.ert().userSelectFileSystem(case) + self.observable().notify(self.CURRENT_CHOICE_CHANGED_EVENT) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/ensemble_resizer.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/ensemble_resizer.py new file mode 100644 index 0000000000..ed2b73707f --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/ensemble_resizer.py @@ -0,0 +1,24 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import SpinnerModelMixin + + +class EnsembleSizeModel(ErtConnector, SpinnerModelMixin): + + def getMaxValue(self): + """ @rtype: int """ + return 10000 + + def getMinValue(self): + """ @rtype: int """ + return 1 + + def getSpinnerValue(self): + """ @rtype: int """ + return self.ert().getEnsembleSize() + + def setSpinnerValue(self, value): + self.ert().resizeEnsemble(int(value)) + self.observable().notify(self.SPINNER_VALUE_CHANGED_EVENT) + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/CMakeLists.txt new file mode 100644 index 0000000000..9696748776 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/CMakeLists.txt @@ -0,0 +1,15 @@ +set(PYTHON_SOURCES + __init__.py + case_list.py + case_selector.py + init_from_existing.py + init_from_scratch.py + init_history_length.py + init_members.py + init_parameters.py + initialized_case_selector.py + is_case_initialized.py +) + +add_python_package("Python ert_gui.models.connectors.init" ${PYTHON_INSTALL_PREFIX}/ert_gui/models/connectors/init "${PYTHON_SOURCES}" True) + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/__init__.py new file mode 100644 index 0000000000..54b1122148 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/__init__.py @@ -0,0 +1,9 @@ +from .case_list import CaseList +from .case_selector import CaseSelectorModel +from .initialized_case_selector import InitializedCaseSelectorModel +from .init_members import InitializationMembersModel +from .init_parameters import InitializationParametersModel +from .init_from_scratch import InitializeFromScratchModel +from .init_from_existing import InitializeFromExistingCaseModel +from .is_case_initialized import IsCaseInitializedModel +from .init_history_length import HistoryLengthModel diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/case_list.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/case_list.py new file mode 100644 index 0000000000..58a9fb8e2d --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/case_list.py @@ -0,0 +1,25 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import ListModelMixin + + +class CaseList(ErtConnector, ListModelMixin): + + def getList(self): + fs = self.ert().getFileSystem() + case_list = self.ert().getCaseList() + return sorted(case_list) + + def addItem(self, value): + self.ert().selectFileSystem(value) + self.observable().notify(ListModelMixin.LIST_CHANGED_EVENT) + + # def removeItem(self, value): + # print("Remove item: %s" % value) + # pass + + + + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/case_selector.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/case_selector.py new file mode 100644 index 0000000000..d803eb7507 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/case_selector.py @@ -0,0 +1,32 @@ +from ert_gui.models import ErtConnector +from ert.util import StringList +from ert_gui.models.connectors.init.case_list import CaseList +from ert_gui.models.mixins import ChoiceModelMixin +from ert_gui.widgets.util import may_take_a_long_time + + +class CaseSelectorModel(ErtConnector, ChoiceModelMixin): + def __init__(self): + CaseList().observable().attach(CaseList.LIST_CHANGED_EVENT, self.__caseListChanged) + super(CaseSelectorModel, self).__init__() + + def __caseListChanged(self): + self.observable().notify(ChoiceModelMixin.CHOICE_LIST_CHANGED_EVENT) + self.observable().notify(ChoiceModelMixin.CURRENT_CHOICE_CHANGED_EVENT) + + def getChoices(self): + """ @rtype: StringList """ + return CaseList().getList() + + def getCurrentChoice(self): + """ @rtype: str """ + case_list = self.getChoices() + current_case = self.ert().getFileSystem() + return current_case.getCaseName() + + @may_take_a_long_time + def setCurrentChoice(self, case): + case = str(case) + if not case == "": + self.ert().userSelectFileSystem(case) + self.observable().notify(self.CURRENT_CHOICE_CHANGED_EVENT) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_from_existing.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_from_existing.py new file mode 100644 index 0000000000..b3c949e15d --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_from_existing.py @@ -0,0 +1,48 @@ +from ert.enkf.enums.enkf_state_type_enum import EnkfStateType +from ert.util import StringList, BoolVector +from ert_gui.models import ErtConnector +from ert_gui.models.connectors.ensemble_resizer import EnsembleSizeModel +from ert_gui.models.connectors.init import InitializationParametersModel, InitializationMembersModel +from ert_gui.models.connectors.init.init_history_length import HistoryLengthModel +from ert_gui.models.connectors.init.initialized_case_selector import InitializedCaseSelectorModel +from ert_gui.models.mixins import ButtonModelMixin + + +class InitializeFromExistingCaseModel(ErtConnector, ButtonModelMixin): + + def __init__(self): + InitializedCaseSelectorModel().observable().attach(InitializedCaseSelectorModel.CHOICE_LIST_CHANGED_EVENT, self.__caseChanged) + super(InitializeFromExistingCaseModel, self).__init__() + + def __caseChanged(self): + self.observable().notify(ButtonModelMixin.BUTTON_STATE_CHANGED_EVENT) + + def buttonTriggered(self): + source_case = InitializedCaseSelectorModel().getCurrentChoice() + source_report_step = HistoryLengthModel().getSpinnerValue() + source_state = EnkfStateType.ANALYZED + selected_members = InitializationMembersModel().getSelectedItems() + total_member_count = EnsembleSizeModel().getSpinnerValue() + + member_mask = BoolVector.createFromList(total_member_count, selected_members) + ranking_key = None + selected_parameters = StringList((InitializationParametersModel()).getSelectedItems()) + + # print("%s %d %d %s %s" % (source_case, source_report_step, int(source_state), str(selected_members), str(selected_parameters))) + + self.ert().initializeFromExistingCase(source_case, source_report_step, source_state, member_mask, ranking_key, selected_parameters) + + self.observable().notify(ButtonModelMixin.BUTTON_TRIGGERED_EVENT) + + def getButtonName(self): + return "Initialize" + + def buttonIsEnabled(self): + return len(InitializedCaseSelectorModel().getChoices()) > 0 + + + + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_from_scratch.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_from_scratch.py new file mode 100644 index 0000000000..527e336181 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_from_scratch.py @@ -0,0 +1,25 @@ +from ert.util import StringList +from ert_gui.models import ErtConnector +from ert_gui.models.connectors.init import InitializationParametersModel, InitializationMembersModel +from ert_gui.models.mixins import ButtonModelMixin + + +class InitializeFromScratchModel(ErtConnector, ButtonModelMixin): + + def buttonTriggered(self): + selected_parameters = StringList((InitializationParametersModel()).getSelectedItems()) + members = (InitializationMembersModel()).getSelectedItems() + + for member in members: + member = int(member.strip()) + self.ert().initializeFromScratch(selected_parameters, member, member) + + self.observable().notify(ButtonModelMixin.BUTTON_TRIGGERED_EVENT) + + def getButtonName(self): + return "Initialize" + + def buttonIsEnabled(self): + return True + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_history_length.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_history_length.py new file mode 100644 index 0000000000..ecbe6a277b --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_history_length.py @@ -0,0 +1,35 @@ +from ert_gui.models.ert_connector import ErtConnector +from ert_gui.models.mixins import SpinnerModelMixin + + +class HistoryLengthModel(ErtConnector, SpinnerModelMixin): + + def __init__(self): + self.__value = self.getMaxValue() + super(HistoryLengthModel, self).__init__() + + #todo: notify when the history length changes... + + def getMinValue(self): + """ @rtype: int """ + return 0 + + def getMaxValue(self): + """ @rtype: int """ + return self.ert().getHistoryLength() + + def getSpinnerValue(self): + return self.__value + + def setSpinnerValue(self, value): + self.__value = value + self.observable().notify(SpinnerModelMixin.SPINNER_VALUE_CHANGED_EVENT) + + def setToMax(self): + self.setSpinnerValue(self.getMaxValue()) + + def setToMin(self): + self.setSpinnerValue(self.getMinValue()) + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_members.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_members.py new file mode 100644 index 0000000000..81ac0e5ba6 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_members.py @@ -0,0 +1,21 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.connectors.ensemble_resizer import EnsembleSizeModel +from ert_gui.models.mixins import SelectableListModelMixin +from ert.util import StringList + + +class InitializationMembersModel(ErtConnector, SelectableListModelMixin): + + + def __init__(self): + EnsembleSizeModel().observable().attach(EnsembleSizeModel.SPINNER_VALUE_CHANGED_EVENT, self.__ensembleSizeChanged) + super(InitializationMembersModel, self).__init__() + + def __ensembleSizeChanged(self): + self.observable().notify(SelectableListModelMixin.LIST_CHANGED_EVENT) + self.observable().notify(SelectableListModelMixin.SELECTION_CHANGED_EVENT) + + def getList(self): + """ @rtype: StringList """ + size = EnsembleSizeModel().getSpinnerValue() + return [str(num) for num in range(0, size)] diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_parameters.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_parameters.py new file mode 100644 index 0000000000..a0bbb8cb7e --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/init_parameters.py @@ -0,0 +1,13 @@ +from ert.enkf.enums import EnkfVarType +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import SelectableListModelMixin +from ert.util import StringList + + +class InitializationParametersModel(ErtConnector, SelectableListModelMixin): + + def getList(self): + """ @rtype: StringList """ + return self.ert().ensembleConfig().getKeylistFromVarType(EnkfVarType.PARAMETER) + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/initialized_case_selector.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/initialized_case_selector.py new file mode 100644 index 0000000000..2a6cda745a --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/initialized_case_selector.py @@ -0,0 +1,68 @@ +from ert_gui.models import ErtConnector +from ert.util import StringList +from ert_gui.models.connectors.init import CaseSelectorModel +from ert_gui.models.connectors.init.case_list import CaseList +from ert_gui.models.mixins import ChoiceModelMixin + +""" Returns all initialized cases except the currently selected one. """ +class InitializedCaseSelectorModel(ErtConnector, ChoiceModelMixin): + + def __init__(self): + self.__current_case = None + self.__initialized_cases = [] + + CaseList().observable().attach(CaseList.LIST_CHANGED_EVENT, self.__caseListChanged) + CaseSelectorModel().observable().attach(CaseSelectorModel.CURRENT_CHOICE_CHANGED_EVENT, self.__currentCaseChanged) + self.__fetchCases() + + super(InitializedCaseSelectorModel, self).__init__() + + + def __fetchCases(self): + self.__initialized_cases = [] + + for case in CaseList().getList(): + # print("%s %s %s" % (current_case, case, self.ert().isCaseInitialized(case))) + # if case != current_case and self.ert().isCaseInitialized(case): + if self.ert().isCaseInitialized(case): + self.__initialized_cases.append(case) + + def __caseListChanged(self): + self.__fetchCases() + + self.observable().notify(ChoiceModelMixin.CHOICE_LIST_CHANGED_EVENT) + self.observable().notify(ChoiceModelMixin.CURRENT_CHOICE_CHANGED_EVENT) + + def __currentCaseChanged(self): + self.observable().notify(ChoiceModelMixin.CHOICE_LIST_CHANGED_EVENT) + self.observable().notify(ChoiceModelMixin.CURRENT_CHOICE_CHANGED_EVENT) + + + def getChoices(self): + """ @rtype: StringList """ + copy = list(self.__initialized_cases) + current_case = CaseSelectorModel().getCurrentChoice() + + if current_case in copy: + copy.remove(current_case) + + return copy + + def getCurrentChoice(self): + """ @rtype: str """ + case_list = self.getChoices() + + if self.__current_case is None: + if len(case_list) > 0: + self.__current_case = case_list[0] + else: + self.__current_case = None + + if len(case_list) > 0 and not self.__current_case in case_list: + self.__current_case = case_list[0] + + return self.__current_case + + def setCurrentChoice(self, case): + self.__current_case = case + self.observable().notify(self.CURRENT_CHOICE_CHANGED_EVENT) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/is_case_initialized.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/is_case_initialized.py new file mode 100644 index 0000000000..a5ad4c7dee --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/init/is_case_initialized.py @@ -0,0 +1,38 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.connectors.ensemble_resizer import EnsembleSizeModel +from ert_gui.models.connectors.init import InitializeFromScratchModel, CaseSelectorModel +from ert_gui.models.connectors.init.init_from_existing import InitializeFromExistingCaseModel +from ert_gui.models.mixins import TextModelMixin, BooleanModelMixin + + +class IsCaseInitializedModel(ErtConnector, BooleanModelMixin, TextModelMixin): + + def __init__(self): + CaseSelectorModel().observable().attach(CaseSelectorModel.CURRENT_CHOICE_CHANGED_EVENT, self.__caseChanged) + EnsembleSizeModel().observable().attach(EnsembleSizeModel.SPINNER_VALUE_CHANGED_EVENT, self.__caseChanged) + InitializeFromScratchModel().observable().attach(InitializeFromScratchModel.BUTTON_TRIGGERED_EVENT, self.__caseChanged) + InitializeFromExistingCaseModel().observable().attach(InitializeFromScratchModel.BUTTON_TRIGGERED_EVENT, self.__caseChanged) + + super(IsCaseInitializedModel, self).__init__() + + def __caseChanged(self): + self.observable().notify(IsCaseInitializedModel.BOOLEAN_VALUE_CHANGED_EVENT) + self.observable().notify(IsCaseInitializedModel.TEXT_VALUE_CHANGED_EVENT) + + def getText(self): + """ + A message saying if the case is not initialized. Returns an empty string if the case is initialized. + @rtype: str + """ + if not self.isTrue(): + return "The current case is not initialized!" + + return "" + + def isTrue(self): + """ + True if the current case is initialized! + @rtype: bool + """ + return self.ert().isInitialized() + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/CMakeLists.txt new file mode 100644 index 0000000000..a4594ff44a --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/CMakeLists.txt @@ -0,0 +1,14 @@ +set(PYTHON_SOURCES + __init__.py + local_max_running.py + lsf_max_running.py + lsf_queue.py + lsf_request.py + queue_system_selector.py + rsh_command.py + rsh_host_list.py + rsh_max_running.py +) + +add_python_package("Python ert_gui.models.connectors.queue_system" ${PYTHON_INSTALL_PREFIX}/ert_gui/models/connectors/queue_system "${PYTHON_SOURCES}" True) + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/__init__.py new file mode 100644 index 0000000000..0b2b28d61a --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/__init__.py @@ -0,0 +1,8 @@ +from .queue_system_selector import QueueSystemSelector +from .lsf_max_running import LsfMaxRunning +from .lsf_queue import LsfQueue +from .lsf_request import LsfRequest +from .local_max_running import LocalMaxRunning +from .rsh_max_running import RshMaxRunning +from .rsh_host_list import RshHostListModel +from .rsh_command import RshCommand \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/local_max_running.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/local_max_running.py new file mode 100644 index 0000000000..9a605be87f --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/local_max_running.py @@ -0,0 +1,23 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import SpinnerModelMixin + + +class LocalMaxRunning(ErtConnector, SpinnerModelMixin): + + def getMaxValue(self): + """ @rtype: int """ + return 1000 + + def getMinValue(self): + """ @rtype: int """ + return 1 + + def getSpinnerValue(self): + """ @rtype: int """ + return self.ert().siteConfig().getMaxRunningLocal() + + def setSpinnerValue(self, value): + self.ert().siteConfig().setMaxRunningLocal(value) + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/lsf_max_running.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/lsf_max_running.py new file mode 100644 index 0000000000..af260be291 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/lsf_max_running.py @@ -0,0 +1,23 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import SpinnerModelMixin + + +class LsfMaxRunning(ErtConnector, SpinnerModelMixin): + + def getMaxValue(self): + """ @rtype: int """ + return 1000 + + def getMinValue(self): + """ @rtype: int """ + return 1 + + def getSpinnerValue(self): + """ @rtype: int """ + return self.ert().siteConfig().getMaxRunningLsf() + + def setSpinnerValue(self, value): + self.ert().siteConfig().setMaxRunningLsf(value) + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/lsf_queue.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/lsf_queue.py new file mode 100644 index 0000000000..1617ca276f --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/lsf_queue.py @@ -0,0 +1,15 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import BasicModelMixin + + +class LsfQueue(ErtConnector, BasicModelMixin): + + def getValue(self): + """ @rtype: str """ + return self.ert().siteConfig().getLsfQueue() + + def setValue(self, value): + self.ert().siteConfig().setLsfQueue(value) + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/lsf_request.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/lsf_request.py new file mode 100644 index 0000000000..867afd4190 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/lsf_request.py @@ -0,0 +1,15 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import BasicModelMixin + + +class LsfRequest(ErtConnector, BasicModelMixin): + + def getValue(self): + """ @rtype: str """ + return self.ert().siteConfig().getLsfRequest() + + def setValue(self, value): + self.ert().siteConfig().setLsfRequest(value) + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/queue_system_selector.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/queue_system_selector.py new file mode 100644 index 0000000000..e26f37d216 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/queue_system_selector.py @@ -0,0 +1,18 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import ChoiceModelMixin + + +class QueueSystemSelector(ErtConnector, ChoiceModelMixin): + + def getChoices(self): + return ["LSF", "RSH", "LOCAL"] + + def getCurrentChoice(self): + return self.ert().siteConfig().getQueueName().upper() + + def setCurrentChoice(self, queue_type_name): + self.ert().siteConfig().setJobQueue(str(queue_type_name)) + self.observable().notify(ChoiceModelMixin.CURRENT_CHOICE_CHANGED_EVENT) + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/rsh_command.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/rsh_command.py new file mode 100644 index 0000000000..d9c634a757 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/rsh_command.py @@ -0,0 +1,34 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import PathModelMixin + + +class RshCommand(ErtConnector, PathModelMixin): + + def pathIsRequired(self): + return True + + def pathMustBeADirectory(self): + return False + + def pathMustBeAFile(self): + return True + + def pathMustBeExecutable(self): + return True + + def pathMustExist(self): + return True + + def pathMustBeAbsolute(self): + return True + + def getPath(self): + return self.ert().siteConfig().getRshCommand() + + def setPath(self, value): + self.ert().siteConfig().set_rsh_command(str(value)) + self.observable().notify(self.PATH_CHANGED_EVENT) + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/rsh_host_list.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/rsh_host_list.py new file mode 100644 index 0000000000..9133533f1e --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/rsh_host_list.py @@ -0,0 +1,39 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins.dictionary_model import DictionaryModelMixin + + +class RshHostListModel(ErtConnector, DictionaryModelMixin): + + def getDictionary(self): + host_list = self.ert().siteConfig().getRshHostList() + return host_list + + def addKey(self, key): + self.setValueForKey(key, 1) + + def setValueForKey(self, key, value): + try: + max_running = int(value) + except ValueError: + max_running = 1 + + self.ert().siteConfig().addRshHost(key, max_running) + + self.observable().notify(self.DICTIONARY_CHANGED_EVENT) + + def removeKey(self, key_to_remove): + hosts = self.getDictionary() + + self.ert().siteConfig().clearRshHostList() + + for key in hosts: + if not key == key_to_remove: + self.ert().siteConfig().addRshHost(key, hosts[key]) + + self.observable().notify(self.DICTIONARY_CHANGED_EVENT) + + + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/rsh_max_running.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/rsh_max_running.py new file mode 100644 index 0000000000..8b3fc8a54e --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/queue_system/rsh_max_running.py @@ -0,0 +1,23 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import SpinnerModelMixin + + +class RshMaxRunning(ErtConnector, SpinnerModelMixin): + + def getMaxValue(self): + """ @rtype: int """ + return 1000 + + def getMinValue(self): + """ @rtype: int """ + return 1 + + def getSpinnerValue(self): + """ @rtype: int """ + return self.ert().siteConfig().getMaxRunningRsh() + + def setSpinnerValue(self, value): + self.ert().siteConfig().setMaxRunningRsh(value) + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/CMakeLists.txt new file mode 100644 index 0000000000..b204c02f59 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/CMakeLists.txt @@ -0,0 +1,16 @@ +set(PYTHON_SOURCES + __init__.py + enkf_assimilation.py + ensemble_experiment.py + iterated_smoother.py + one_more_iteration.py + run_members.py + run_status.py + simulation_mode.py + simulation_runner.py + simulations_tracker.py + smoother.py +) + +add_python_package("Python ert_gui.models.connectors.run" ${PYTHON_INSTALL_PREFIX}/ert_gui/models/connectors/run "${PYTHON_SOURCES}" True) + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/__init__.py new file mode 100644 index 0000000000..f615cd7ac7 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/__init__.py @@ -0,0 +1,13 @@ +from .run_members import RunMembersModel + +from .enkf_assimilation import EnkfAssimilation +from .ensemble_experiment import EnsembleExperiment +from .iterated_smoother import IteratedSmoother +from .smoother import Smoother +from .simulation_mode import SimulationModeModel +from .iterated_smoother import IteratedSmoother +from .one_more_iteration import OneMoreIteration + +from .run_status import RunStatusModel +from .simulation_runner import SimulationRunner +from .simulations_tracker import SimulationsTracker \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/enkf_assimilation.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/enkf_assimilation.py new file mode 100644 index 0000000000..ddd7fadcf0 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/enkf_assimilation.py @@ -0,0 +1,21 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import ButtonModelMixin + + +class EnkfAssimilation(ErtConnector, ButtonModelMixin): + + def buttonTriggered(self): + print(str(self)) + + self.observable().notify(ButtonModelMixin.BUTTON_TRIGGERED_EVENT) + + def getButtonName(self): + return "Run" + + def buttonIsEnabled(self): + return False + + def __str__(self): + return "EnKF Assimilation" + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/ensemble_experiment.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/ensemble_experiment.py new file mode 100644 index 0000000000..2fda7f5be9 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/ensemble_experiment.py @@ -0,0 +1,34 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.connectors.ensemble_resizer import EnsembleSizeModel +from ert_gui.models.connectors.run import RunMembersModel +from ert_gui.models.mixins import ButtonModelMixin, RunModelMixin + + +class EnsembleExperiment(ErtConnector, RunModelMixin, ButtonModelMixin): + + def startSimulations(self): + selected_members = [int(member) for member in RunMembersModel().getSelectedItems()] + total_member_count = EnsembleSizeModel().getSpinnerValue() + + self.ert().runEnsembleExperiment(selected_members, total_member_count) + + def killAllSimulations(self): + job_queue = self.ert().siteConfig().getJobQueue() + job_queue.killAllJobs() + + + def buttonTriggered(self): + self.startSimulations() + self.observable().notify(ButtonModelMixin.BUTTON_TRIGGERED_EVENT) + + def getButtonName(self): + return "Run" + + def buttonIsEnabled(self): + return True + + def __str__(self): + return "Ensemble Experiment" + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/iterated_smoother.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/iterated_smoother.py new file mode 100644 index 0000000000..7317102319 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/iterated_smoother.py @@ -0,0 +1,22 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import ButtonModelMixin + + +class IteratedSmoother(ErtConnector, ButtonModelMixin): + + def buttonTriggered(self): + print(str(self)) + + self.observable().notify(ButtonModelMixin.BUTTON_TRIGGERED_EVENT) + + def getButtonName(self): + return "Run" + + def __str__(self): + return "Iterated Smoother" + + def buttonIsEnabled(self): + return False + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/one_more_iteration.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/one_more_iteration.py new file mode 100644 index 0000000000..abfec88970 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/one_more_iteration.py @@ -0,0 +1,30 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.connectors.run import IteratedSmoother, SimulationModeModel +from ert_gui.models.mixins import ButtonModelMixin + + +class OneMoreIteration(ErtConnector, ButtonModelMixin): + + def __init__(self): + self.__enabled = False + SimulationModeModel().observable().attach(SimulationModeModel.CURRENT_CHOICE_CHANGED_EVENT, self.__simulationModeChanged) + super(OneMoreIteration, self).__init__() + + def __simulationModeChanged(self): + self.__enabled = SimulationModeModel().getCurrentChoice() == IteratedSmoother() + self.observable().notify(ButtonModelMixin.BUTTON_STATE_CHANGED_EVENT) + + def buttonTriggered(self): + print(str(self)) + + self.observable().notify(ButtonModelMixin.BUTTON_TRIGGERED_EVENT) + + def getButtonName(self): + return "Run one more iteration" + + def buttonIsEnabled(self): + return self.__enabled + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/run_members.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/run_members.py new file mode 100644 index 0000000000..8a9dea24c5 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/run_members.py @@ -0,0 +1,20 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.connectors.ensemble_resizer import EnsembleSizeModel +from ert_gui.models.mixins import SelectableListModelMixin +from ert.util import StringList + + +class RunMembersModel(ErtConnector, SelectableListModelMixin): + + def __init__(self): + EnsembleSizeModel().observable().attach(EnsembleSizeModel.SPINNER_VALUE_CHANGED_EVENT, self.__ensembleSizeChanged) + super(RunMembersModel, self).__init__() + + def __ensembleSizeChanged(self): + self.observable().notify(SelectableListModelMixin.LIST_CHANGED_EVENT) + self.observable().notify(SelectableListModelMixin.SELECTION_CHANGED_EVENT) + + def getList(self): + """ @rtype: StringList """ + size = EnsembleSizeModel().getSpinnerValue() + return [str(num) for num in range(0, size)] diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/run_status.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/run_status.py new file mode 100644 index 0000000000..b850b47044 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/run_status.py @@ -0,0 +1,89 @@ +import time +from ert_gui.models import ErtConnector +from ert_gui.models.connectors.run import RunMembersModel +from ert_gui.models.mixins import ModelMixin + + +class RunStatusModel(ErtConnector, ModelMixin): + STATUS_CHANGED_EVENT = "status_changed_event" + + def __init__(self): + super(RunStatusModel, self).__init__() + + self.__status = {} + self.__resetStatusFlag() + self.__status_count = {} + + self.__is_running = False + + + def registerDefaultEvents(self): + super(RunStatusModel, self).registerDefaultEvents() + self.observable().addEvent(RunStatusModel.STATUS_CHANGED_EVENT) + + + def startStatusPoller(self): + assert not self.__is_running, "Job already started!" + + while not self.ert().siteConfig().isQueueRunning(): + time.sleep(0.5) + + self.__is_running = True + + selected_members = [int(member) for member in RunMembersModel().getSelectedItems()] + self.__resetMemberStatus() + + while self.ert().siteConfig().isQueueRunning(): + self.__resetStatusFlag() + + for member in selected_members: + state = self.ert().getMemberRunningState(member) + status = state.getRunStatus() + + self.__setMemberStatus(member, status) + + self.__updateStatusCount() + + self.__checkStatusChangedFlag() # Emit once for all members if any changes has occurred + + time.sleep(0.5) + + self.__is_running = False + + + def getStatusCounts(self): + return dict(self.__status_count) + + def __setMemberStatus(self, member, status): + if not self.__status.has_key(member): + self.__status[member] = status + self.__setStatusChangedFlag() + + if self.__status[member] != status: + self.__status[member] = status + self.__setStatusChangedFlag() + + def __resetStatusFlag(self): + self.__status_changed_flag = False + + def __setStatusChangedFlag(self): + self.__status_changed_flag = True + + def __checkStatusChangedFlag(self): + if self.__status_changed_flag: + self.observable().notify(RunStatusModel.STATUS_CHANGED_EVENT) + + def __resetMemberStatus(self): + self.__status.clear() + + def __updateStatusCount(self): + self.__status_count.clear() + + for member in self.__status: + status = self.__status[member] + + if not self.__status_count.has_key(status): + self.__status_count[status] = 0 + + self.__status_count[status] += 1 + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/simulation_mode.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/simulation_mode.py new file mode 100644 index 0000000000..46c42a0796 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/simulation_mode.py @@ -0,0 +1,27 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.connectors.run import EnsembleExperiment, EnkfAssimilation, Smoother, IteratedSmoother +from ert_gui.models.mixins import ChoiceModelMixin + + +class SimulationModeModel(ErtConnector, ChoiceModelMixin): + # __modes = ["Ensemble experiment", "EnKF assimilation", "Smoother", "Iterated Smoother"] + __modes = [EnsembleExperiment(), EnkfAssimilation(), Smoother(), IteratedSmoother()] + + def __init__(self): + self.__value = SimulationModeModel.__modes[0] + super(SimulationModeModel, self).__init__() + + def getChoices(self): + return SimulationModeModel.__modes + + def getCurrentChoice(self): + return self.__value + + def setCurrentChoice(self, value): + self.__value = value + self.observable().notify(self.CURRENT_CHOICE_CHANGED_EVENT) + + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/simulation_runner.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/simulation_runner.py new file mode 100644 index 0000000000..26066964bf --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/simulation_runner.py @@ -0,0 +1,49 @@ +from threading import Thread +import time +from ert_gui.models.connectors.run.run_status import RunStatusModel +from ert_gui.models.mixins import ModelMixin, RunModelMixin + + +class SimulationRunner(Thread, ModelMixin): + SIMULATION_FINISHED_EVENT = "simulation_finished_event" + + def __init__(self, button_model): + super(SimulationRunner, self).__init__(name="enkf_main_run_thread") + self.setDaemon(True) + + assert isinstance(button_model, RunModelMixin) + + self.__model = button_model + + self.__job_start_time = 0 + self.__job_stop_time = 0 + + def registerDefaultEvents(self): + super(SimulationRunner, self).registerDefaultEvents() + self.observable().addEvent(SimulationRunner.SIMULATION_FINISHED_EVENT) + + + def run(self): + self.__job_start_time = int(time.time()) + + status_thread = Thread(name = "enkf_main_run_status_poll_thread") + status_thread.setDaemon(True) + status_thread.run = RunStatusModel().startStatusPoller + status_thread.start() + + self.__model.startSimulations() + self.__job_stop_time = int(time.time()) + + self.observable().notify(SimulationRunner.SIMULATION_FINISHED_EVENT) + + def getRunningTime(self): + if self.__job_stop_time < self.__job_start_time: + return time.time() - self.__job_start_time + else: + return self.__job_stop_time - self.__job_start_time + + def killAllSimulations(self): + self.__model.killAllSimulations() + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/simulations_tracker.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/simulations_tracker.py new file mode 100644 index 0000000000..357331fe68 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/simulations_tracker.py @@ -0,0 +1,100 @@ +from ert.job_queue import JobStatusType +from ert_gui.models.connectors.run.run_members import RunMembersModel +from ert_gui.models.connectors.run.run_status import RunStatusModel +from ert_gui.models.mixins import ListModelMixin + + +class SimulationStateStatus(object): + WAITING = (164, 164, 255) + PENDING = (164, 200, 255) + RUNNING = (200, 255, 200) + FAILED = (255, 200, 200) + + USER_KILLED = (255, 255, 200) + FINISHED = (200, 200, 200) + NOT_ACTIVE = (255, 255, 255) + + def __init__(self, name, state, color, total_count): + self.__name = name + self.__state = state + self.__color = color + + self.__count = 0 + self.__total_count = total_count + + @property + def name(self): + return self.__name + + @property + def state(self): + return self.__state + + @property + def color(self): + return self.__color + + @property + def count(self): + return self.__count + + @count.setter + def count(self, value): + self.__count = value + + @property + def total_count(self): + return self.__total_count + + +class SimulationsTracker(ListModelMixin): + def __init__(self): + super(SimulationsTracker, self).__init__() + RunStatusModel().observable().attach(RunStatusModel.STATUS_CHANGED_EVENT, self.__statusChanged) + + total_count = len(RunMembersModel().getSelectedItems()) + + waiting_state = SimulationStateStatus("Waiting", JobStatusType.JOB_QUEUE_NOT_ACTIVE | JobStatusType.JOB_QUEUE_WAITING | JobStatusType.JOB_QUEUE_SUBMITTED, SimulationStateStatus.WAITING, total_count) + pending_state = SimulationStateStatus("Pending", JobStatusType.JOB_QUEUE_PENDING, SimulationStateStatus.PENDING, total_count) + running_state = SimulationStateStatus("Running", JobStatusType.JOB_QUEUE_RUNNING | JobStatusType.JOB_QUEUE_EXIT | JobStatusType.JOB_QUEUE_RUNNING_CALLBACK, SimulationStateStatus.RUNNING, total_count) + killed_state = SimulationStateStatus("User killed", JobStatusType.JOB_QUEUE_USER_KILLED | JobStatusType.JOB_QUEUE_USER_EXIT, SimulationStateStatus.USER_KILLED, total_count) + failed_state = SimulationStateStatus("Failed", JobStatusType.JOB_QUEUE_FAILED, SimulationStateStatus.FAILED, total_count) + done_state = SimulationStateStatus("Finished", JobStatusType.JOB_QUEUE_DONE | JobStatusType.JOB_QUEUE_SUCCESS, SimulationStateStatus.FINISHED, total_count) + + self.states = [waiting_state, pending_state, running_state, killed_state, failed_state, done_state] + + self.__checkForUnusedEnums() + + def __statusChanged(self): + status_counts = RunStatusModel().getStatusCounts() + + for state in self.states: + state.count = 0 + + for status in status_counts: + count = status_counts[status] + + for state in self.states: + if status in state.state: + state.count += count + + self.observable().notify(ListModelMixin.LIST_CHANGED_EVENT) + + + def getList(self): + """ @rtype: list of SimulationStateStatus """ + return list(self.states) + + def __checkForUnusedEnums(self): + + for enum in JobStatusType.enums(): + used = False + for state in self.states: + if enum in state.state: + used = True + + if not used: + raise AssertionError("Enum identifier '%s' not used!" % enum) + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/smoother.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/smoother.py new file mode 100644 index 0000000000..a9e65d47a1 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run/smoother.py @@ -0,0 +1,22 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import ButtonModelMixin + + +class Smoother(ErtConnector, ButtonModelMixin): + + def buttonTriggered(self): + print(str(self)) + + self.observable().notify(ButtonModelMixin.BUTTON_TRIGGERED_EVENT) + + def getButtonName(self): + return "Run" + + + def __str__(self): + return "Integrated Smoother" + + + def buttonIsEnabled(self): + return False + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run_path.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run_path.py new file mode 100644 index 0000000000..0f85c4f7f7 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/run_path.py @@ -0,0 +1,22 @@ +from ert_gui.models import ErtConnector +from ert.enkf import ModelConfig +from ert_gui.models.mixins import BasicModelMixin + + +class RunPathModel(ErtConnector, BasicModelMixin): + def getValue(self): + """ @rtype: str """ + return self.getModelConfig().getRunpathAsString() + + def setValue(self, run_path): + self.getModelConfig().setRunpath(str(run_path)) + self.observable().notify(self.VALUE_CHANGED_EVENT) + + def getModelConfig(self): + """ @rtype: ModelConfig """ + return self.ert().getModelConfig() + + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/simulation_mode.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/simulation_mode.py new file mode 100644 index 0000000000..ecb8c5936f --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/connectors/simulation_mode.py @@ -0,0 +1,30 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import ChoiceModelMixin + + +class SimulationModeModel(ErtConnector, ChoiceModelMixin): + __modes = ["Ensemble experiment", "EnKF assimilation", "Smoother"] + + def __init__(self): + self.observable().addEvent(self.CHOICE_LIST_CHANGED_EVENT) + self.observable().addEvent(self.CURRENT_CHOICE_CHANGED_EVENT) + + def initialize(self): + self.value = SimulationModeModel.__modes[0] + self.observable().notify(self.CHOICE_LIST_CHANGED_EVENT) + self.observable().notify(self.CURRENT_CHOICE_CHANGED_EVENT) + + def getChoices(self): + return SimulationModeModel.__modes + + def getCurrentChoice(self): + return self.value + + def setCurrentChoice(self, value): + self.value = value + self.observable().notify(self.CURRENT_CHOICE_CHANGED_EVENT) + + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/ert_connector.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/ert_connector.py new file mode 100644 index 0000000000..7a7891574d --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/ert_connector.py @@ -0,0 +1,36 @@ +from ert.enkf import EnKFMain + +#http://stackoverflow.com/questions/13789235/how-to-initialize-singleton-derived-object-once +class Singleton(type): + __instances = {} + def __call__(cls, *args, **kwargs): + if cls not in cls.__instances: + cls.__instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) + return cls.__instances[cls] + +class ErtConnector(object): + __metaclass__ = Singleton + + """ + ErtConnector uses the Singleton pattern. + Every time you instantiate an ErtConnector or a subclass of ErtConnector the same instance is returned. + """ + __ert = None + + def __init__(self, *args, **kwargs): + super(ErtConnector, self).__init__(*args, **kwargs) + + def __new__(cls, *args): + if cls is ErtConnector: + return None + + return super(ErtConnector, cls).__new__(cls) + + + def ert(self): + """ @rtype: EnKFMain """ + return ErtConnector.__ert + + @classmethod + def setErt(cls, ert): + ErtConnector.__ert = ert diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/CMakeLists.txt new file mode 100644 index 0000000000..502011cafe --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/CMakeLists.txt @@ -0,0 +1,22 @@ +set(PYTHON_SOURCES + __init__.py + basic_model.py + boolean_model.py + button_model.py + choice_model.py + dictionary_model.py + keyword_model.py + list_model.py + model.py + path_model.py + range_model.py + run_model.py + selectable_list_model.py + selectable_model.py + spinner_model.py + text_model.py +) + +add_python_package("Python ert_gui.models.mixins" ${PYTHON_INSTALL_PREFIX}/ert_gui/models/mixins "${PYTHON_SOURCES}" True) + +add_subdirectory(connectorless) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/__init__.py new file mode 100644 index 0000000000..b1d29c5882 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/__init__.py @@ -0,0 +1,14 @@ +from .model import AbstractMethodError, ModelMixin +from .basic_model import BasicModelMixin +from .choice_model import ChoiceModelMixin +from .range_model import RangeModelMixin +from .spinner_model import SpinnerModelMixin +from .dictionary_model import DictionaryModelMixin +from .list_model import ListModelMixin +from .path_model import PathModelMixin +from .boolean_model import BooleanModelMixin +from .text_model import TextModelMixin +from .selectable_model import SelectableModelMixin +from .selectable_list_model import SelectableListModelMixin +from .button_model import ButtonModelMixin +from .run_model import RunModelMixin diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/basic_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/basic_model.py new file mode 100644 index 0000000000..c4a298da48 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/basic_model.py @@ -0,0 +1,16 @@ +from ert_gui.models.mixins import ModelMixin, AbstractMethodError + + +class BasicModelMixin(ModelMixin): + VALUE_CHANGED_EVENT = "value_changed_event" + + def registerDefaultEvents(self): + super(BasicModelMixin, self).registerDefaultEvents() + self.observable().addEvent(BasicModelMixin.VALUE_CHANGED_EVENT) + + def getValue(self): + raise AbstractMethodError(self, "getValue") + + def setValue(self, value): + raise AbstractMethodError(self, "setValue") + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/boolean_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/boolean_model.py new file mode 100644 index 0000000000..09c3e5254c --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/boolean_model.py @@ -0,0 +1,17 @@ +from ert_gui.models.mixins import ModelMixin, AbstractMethodError + + +class BooleanModelMixin(ModelMixin): + BOOLEAN_VALUE_CHANGED_EVENT = "boolean_value_changed_event" # single element changed + + def registerDefaultEvents(self): + super(BooleanModelMixin, self).registerDefaultEvents() + self.observable().addEvent(BooleanModelMixin.BOOLEAN_VALUE_CHANGED_EVENT) + + def isTrue(self): + """ @rtype: bool """ + raise AbstractMethodError(self, "isTrue") + + def setTrue(self, value): + raise AbstractMethodError(self, "setTrue") + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/button_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/button_model.py new file mode 100644 index 0000000000..76c1ed5bee --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/button_model.py @@ -0,0 +1,23 @@ +from ert_gui.models.mixins import ModelMixin, AbstractMethodError + + +class ButtonModelMixin(ModelMixin): + BUTTON_TRIGGERED_EVENT = "button_triggered_event" + BUTTON_STATE_CHANGED_EVENT = "button_state_changed_event" + + def registerDefaultEvents(self): + super(ButtonModelMixin, self).registerDefaultEvents() + self.observable().addEvent(ButtonModelMixin.BUTTON_TRIGGERED_EVENT) + self.observable().addEvent(ButtonModelMixin.BUTTON_STATE_CHANGED_EVENT) + + def getButtonName(self): + raise AbstractMethodError(self, "getButtonName") + + def buttonTriggered(self): + raise AbstractMethodError(self, "buttonTriggered") + + def buttonIsEnabled(self): + """ @rtype: bool """ + raise AbstractMethodError(self, "buttonIsEnabled") + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/choice_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/choice_model.py new file mode 100644 index 0000000000..41c85c5873 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/choice_model.py @@ -0,0 +1,20 @@ +from ert_gui.models.mixins import ModelMixin, AbstractMethodError + + +class ChoiceModelMixin(ModelMixin): + CHOICE_LIST_CHANGED_EVENT = "choice_list_changed_event" + CURRENT_CHOICE_CHANGED_EVENT = "current_choice_changed_event" + + def registerDefaultEvents(self): + super(ChoiceModelMixin, self).registerDefaultEvents() + self.observable().addEvent(ChoiceModelMixin.CURRENT_CHOICE_CHANGED_EVENT) + self.observable().addEvent(ChoiceModelMixin.CHOICE_LIST_CHANGED_EVENT) + + def getChoices(self): + raise AbstractMethodError(self, "getChoices") + + def getCurrentChoice(self): + raise AbstractMethodError(self, "getCurrentChoice") + + def setCurrentChoice(self, value): + raise AbstractMethodError(self, "setCurrentChoice") diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/connectorless/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/connectorless/CMakeLists.txt new file mode 100644 index 0000000000..6db79876ac --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/connectorless/CMakeLists.txt @@ -0,0 +1,7 @@ +set(PYTHON_SOURCES + __init__.py + function_button_model.py +) + +add_python_package("Python ert_gui.models.mixins.connectorless" ${PYTHON_INSTALL_PREFIX}/ert_gui/models/mixins/connectorless "${PYTHON_SOURCES}" True) + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/connectorless/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/connectorless/__init__.py new file mode 100644 index 0000000000..d0ae835fc2 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/connectorless/__init__.py @@ -0,0 +1 @@ +from .function_button_model import FunctionButtonModel \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/connectorless/function_button_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/connectorless/function_button_model.py new file mode 100644 index 0000000000..1d4a3fa294 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/connectorless/function_button_model.py @@ -0,0 +1,25 @@ +from ert_gui.models.mixins import ButtonModelMixin + + +class FunctionButtonModel(ButtonModelMixin): + + def __init__(self, name, function_reference): + self.__name = name + self.__function_reference = function_reference + self.__enabled = True + + super(FunctionButtonModel, self).__init__() + + def getButtonName(self): + return self.__name + + def buttonTriggered(self): + self.__function_reference() + self.observable().notify(ButtonModelMixin.BUTTON_TRIGGERED_EVENT) + + def buttonIsEnabled(self): + return self.__enabled + + def setEnabled(self, enabled): + self.__enabled = enabled + self.observable().notify(ButtonModelMixin.BUTTON_STATE_CHANGED_EVENT) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/dictionary_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/dictionary_model.py new file mode 100644 index 0000000000..d99240d469 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/dictionary_model.py @@ -0,0 +1,22 @@ +from ert_gui.models.mixins import ModelMixin, AbstractMethodError + + +class DictionaryModelMixin(ModelMixin): + DICTIONARY_CHANGED_EVENT = "dictionary_value_changed_event" + + def registerDefaultEvents(self): + super(DictionaryModelMixin, self).registerDefaultEvents() + self.observable().addEvent(DictionaryModelMixin.DICTIONARY_CHANGED_EVENT) + + def getDictionary(self): + """ @rtype: dict """ + raise AbstractMethodError(self, "getDictionary") + + def addKey(self, key): + raise AbstractMethodError(self, "addKey") + + def setValueForKey(self, key, value): + raise AbstractMethodError(self, "setValueForKey") + + def removeKey(self, key): + raise AbstractMethodError(self, "removeKey") \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/keyword_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/keyword_model.py new file mode 100644 index 0000000000..ceaed8eb5b --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/keyword_model.py @@ -0,0 +1,24 @@ +from ert_gui.models.mixins import ModelMixin + + +class KeywordModelMixin(ModelMixin): + KEYWORD_VALUE_CHANGED_EVENT = "keyword_value_changed_event" + + def getKeyName(self): + """ @rtype: str """ + raise NotImplementedError("Class %s has not implemented support for %s()" % (self.__class__.__name__, "getKeyName")) + + def getValueName(self): + """ @rtype: str """ + raise NotImplementedError("Class %s has not implemented support for %s()" % (self.__class__.__name__, "getValueName")) + + def getDefaultValue(self): + """ @rtype: str """ + raise NotImplementedError("Class %s has not implemented support for %s()" % (self.__class__.__name__, "getDefaultValue")) + + def getKeywords(self): + """ @rtype: dict """ + raise NotImplementedError("Class %s has not implemented support for %s()" % (self.__class__.__name__, "getKeywords")) + + def setKeywords(self, value): + raise NotImplementedError("Class %s has not implemented support for %s()" % (self.__class__.__name__, "setKeywords")) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/list_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/list_model.py new file mode 100644 index 0000000000..43a6b0a842 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/list_model.py @@ -0,0 +1,19 @@ +from ert_gui.models.mixins import ModelMixin, AbstractMethodError + + +class ListModelMixin(ModelMixin): + LIST_CHANGED_EVENT = "list_value_changed_event" + + def registerDefaultEvents(self): + super(ListModelMixin, self).registerDefaultEvents() + self.observable().addEvent(ListModelMixin.LIST_CHANGED_EVENT) + + def getList(self): + """ @rtype: list """ + raise AbstractMethodError(self, "getList") + + def addItem(self, value): + raise AbstractMethodError(self, "addItem") + + def removeItem(self, value): + raise AbstractMethodError(self, "removeItem") diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/model.py new file mode 100644 index 0000000000..fd9d55c280 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/model.py @@ -0,0 +1,29 @@ +from ert_gui.models import Observable + +class AbstractMethodError(NotImplementedError): + def __init__(self, obj, function_name): + super(AbstractMethodError, self).__init__("Class %s has not implemented support for %s()" % (obj.__class__.__name__, function_name)) + + +class ModelMixin(object): + def __init__(self, *args): + pass + # print("%s init" % self.__class__.__name__) + + def __new__(cls, *args): + # print("Construct: %s" % cls.__name__) + obj = super(ModelMixin, cls).__new__(cls) + obj.__observable = Observable(cls.__name__) + obj.registerDefaultEvents() + return obj + + + def registerDefaultEvents(self): + """Register all events that applicable to the model. """ + pass + + + def observable(self): + """ @rtype: Observable """ + return self.__observable + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/path_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/path_model.py new file mode 100644 index 0000000000..5b1d205e3a --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/path_model.py @@ -0,0 +1,42 @@ +from ert_gui.models.mixins import ModelMixin, AbstractMethodError + + +class PathModelMixin(ModelMixin): + PATH_CHANGED_EVENT = "path_changed_event" + + def registerDefaultEvents(self): + super(PathModelMixin, self).registerDefaultEvents() + self.observable().addEvent(PathModelMixin.PATH_CHANGED_EVENT) + + def pathIsRequired(self): + """ @rtype: bool """ + raise AbstractMethodError(self, "isRequired") + + def pathMustExist(self): + """ @rtype: bool """ + raise AbstractMethodError(self, "pathMustExist") + + def pathMustBeExecutable(self): + """ @rtype: bool """ + raise AbstractMethodError(self, "pathMustBeExecutable") + + def pathMustBeAFile(self): + """ @rtype: bool """ + raise AbstractMethodError(self, "pathMustBeAFile") + + def pathMustBeADirectory(self): + """ @rtype: bool """ + raise AbstractMethodError(self, "pathMustBeADirectory") + + def pathMustBeAbsolute(self): + """ @rtype: bool """ + raise AbstractMethodError(self, "pathMustBeExecutable") + + def getPath(self): + """ @rtype: str """ + raise AbstractMethodError(self, "getValue") + + def setPath(self, value): + raise AbstractMethodError(self, "setValue") + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/range_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/range_model.py new file mode 100644 index 0000000000..bb40f10298 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/range_model.py @@ -0,0 +1,16 @@ +from ert_gui.models.mixins import ModelMixin, AbstractMethodError + + +class RangeModelMixin(ModelMixin): + RANGE_VALUE_CHANGED_EVENT = "range_value_changed_event" + + def registerDefaultEvents(self): + super(RangeModelMixin, self).registerDefaultEvents() + self.observable().addEvent(RangeModelMixin.RANGE_VALUE_CHANGED_EVENT) + + def getMaxValue(self): + raise AbstractMethodError(self, "getMaxValue") + + def getMinValue(self): + raise AbstractMethodError(self, "getMinValue") + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/run_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/run_model.py new file mode 100644 index 0000000000..1398ccc9b5 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/run_model.py @@ -0,0 +1,10 @@ +from ert_gui.models.mixins import ModelMixin, AbstractMethodError + + +class RunModelMixin(ModelMixin): + + def startSimulations(self): + raise AbstractMethodError(self, "startSimulations") + + def killAllSimulations(self): + raise AbstractMethodError(self, "startSimulations") \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/selectable_list_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/selectable_list_model.py new file mode 100644 index 0000000000..8f60001727 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/selectable_list_model.py @@ -0,0 +1,60 @@ +from ert_gui.models.mixins.list_model import ListModelMixin +from ert_gui.models.mixins.selectable_model import SelectableModelMixin + + +class SelectableListModelMixin(ListModelMixin, SelectableModelMixin): + + def __init__(self): + self.__selection = {} + super(SelectableListModelMixin, self).__init__() + + def isValueSelected(self, value): + if self.__selection.has_key(value): + return self.__selection[value] + else: + return True + + def selectValue(self, value): + self.__setSelectState(value, True) + self.observable().notify(self.SELECTION_CHANGED_EVENT) + + def unselectValue(self, value): + self.__setSelectState(value, False) + self.observable().notify(self.SELECTION_CHANGED_EVENT) + + def unselectAll(self): + for item in self.getList(): + self.__setSelectState(item, False) + + self.observable().notify(self.SELECTION_CHANGED_EVENT) + + def selectAll(self): + for item in self.getList(): + self.__setSelectState(item, True) + + self.observable().notify(self.SELECTION_CHANGED_EVENT) + + def getSelectedItems(self): + result = [] + items = self.getList() + + for item in items: + if self.isValueSelected(item): + result.append(item) + + return result + + def __setSelectState(self, key, state): + self.__selection[key] = state + + + + + + + + + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/selectable_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/selectable_model.py new file mode 100644 index 0000000000..3f9a4d0bd2 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/selectable_model.py @@ -0,0 +1,28 @@ +from ert_gui.models.mixins import ModelMixin, AbstractMethodError + + +class SelectableModelMixin(ModelMixin): + SELECTION_CHANGED_EVENT = "selection_changed_event" # single element changed + + def registerDefaultEvents(self): + super(SelectableModelMixin, self).registerDefaultEvents() + self.observable().addEvent(SelectableModelMixin.SELECTION_CHANGED_EVENT) + + def selectValue(self, value): + raise AbstractMethodError(self, "selectValue") + + def unselectValue(self, value): + raise AbstractMethodError(self, "unselectValue") + + def isValueSelected(self, value): + """ @rtype: bool """ + raise AbstractMethodError(self, "isValueSelected") + + def selectAll(self): + raise AbstractMethodError(self, "selectAll") + + def unselectAll(self): + raise AbstractMethodError(self, "unselectAll") + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/spinner_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/spinner_model.py new file mode 100644 index 0000000000..90b64077a9 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/spinner_model.py @@ -0,0 +1,15 @@ +from ert_gui.models.mixins import RangeModelMixin, AbstractMethodError + + +class SpinnerModelMixin(RangeModelMixin): + SPINNER_VALUE_CHANGED_EVENT = "spinner_value_changed_event" + + def registerDefaultEvents(self): + super(SpinnerModelMixin, self).registerDefaultEvents() + self.observable().addEvent(SpinnerModelMixin.SPINNER_VALUE_CHANGED_EVENT) + + def getSpinnerValue(self): + raise AbstractMethodError(self, "getSpinnerValue") + + def setSpinnerValue(self, value): + raise AbstractMethodError(self, "setSpinnerValue") diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/text_model.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/text_model.py new file mode 100644 index 0000000000..79ddfd05b1 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/text_model.py @@ -0,0 +1,17 @@ +from ert_gui.models.mixins import ModelMixin, AbstractMethodError + + +class TextModelMixin(ModelMixin): + TEXT_VALUE_CHANGED_EVENT = "text_value_changed_event" + + def registerDefaultEvents(self): + super(TextModelMixin, self).registerDefaultEvents() + self.observable().addEvent(TextModelMixin.TEXT_VALUE_CHANGED_EVENT) + + def getText(self): + """ @rtype: str """ + raise AbstractMethodError(self, "getText") + + def setText(self, value): + raise AbstractMethodError(self, "setText") + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/observable.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/observable.py new file mode 100644 index 0000000000..34dbab354e --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/observable.py @@ -0,0 +1,64 @@ +from ert_gui.models import WeakMethod + + +class Observable(object): + + def __init__(self, name): + self.observers = {} + self.name = name + + def addEvent(self, event): + if not event in self.observers: + self.observers[event] = [] + + def __contains__(self, event): + return event in self.observers + + def attach(self, event, observer_function): + assert callable(observer_function), "The observer function must be callable!" + + if not event in self: + raise LookupError("Observer do not have an event of type: %s" % str(event)) + + if not observer_function in self.observers[event]: + weak_ref = WeakMethod(observer_function) + self.observers[event].append(weak_ref) + + def detach(self, event, observer_function): + + if not event in self: + raise LookupError("Observer do not have an event of type: %s" % str(event)) + + if not observer_function in self.observers[event]: + raise ValueError("Observer is not observing event '%s' from observable with name: %s" % (str(event), self.name)) + + self.observers[event].remove(observer_function) + + def notify(self, event, debug_message=None): + if not event in self: + raise LookupError("Observer '%s' do not have an event of type: %s" % (self.name, str(event))) + + # if len(self.observers[event]) == 0: + # raise ValueError("Observer has no observers for event of type: %s " % event) + + if debug_message is not None: + print("Notification: %s - %s " % (event, str(debug_message))) + + dead_references = [] + for observer_ref in self.observers[event]: + observer_function = observer_ref() + # print("%s %s" % (observer_ref, observer_function)) + if observer_function is not None: + observer_function() + else: + dead_references.append(observer_ref) + + for reference in dead_references: + self.observers[event].remove(reference) + print("Removed dead reference: %s" % reference) + + def __str__(self): + return "Observable %s: %s" % (self.name, str(self.observers.keys())) + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/models/weak_method.py b/ThirdParty/Ert/devel/python/python/ert_gui/models/weak_method.py new file mode 100644 index 0000000000..fc8c210580 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/models/weak_method.py @@ -0,0 +1,69 @@ +from weakref import * + + +class weak_callable(object): + def __init__(self, obj, func): + self.__object = obj + self.__method = func + + def __call__(self, *args, **kws): + if self.__object is not None: + return self.__method(self.__object(), *args, **kws) + else: + return self.__method(*args, **kws) + + def __getattr__(self, attr): + if attr == 'im_self': + return self.__object + if attr == 'im_func': + return self.__method + raise AttributeError, attr + + +class WeakMethod(object): + """ Wraps a function or, more importantly, a bound method, in + a way that allows a bound method's object to be GC'd, while + providing the same interface as a normal weak reference. """ + + def __init__(self, func): + try: + self.__object = ref(func.im_self) + self.__method = func.im_func + except AttributeError: + # It's not a bound method. + self.__object = None + self.__method = func + + def __call__(self): + if self.isDead(): + return None + + return weak_callable(self.__object, self.__method) + + def __eq__(self, other): + if isinstance(other, WeakMethod): + return super(WeakMethod, self).__eq__(other) + else: + try: + o = ref(other.im_self) + m = other.im_func + return self.__object == o and self.__method == m + except AttributeError: + # It's not a bound method. + return self.__method == other + + def __str__(self): + dead = "" + if self.isDead(): + dead = "Dead " + + binding = "bound" + + if self.__object is None: + binding = "unbound" + + return "%sWeakMethod for %s function. " % (dead, binding) + super(WeakMethod, self).__str__() + + + def isDead(self): + return self.__object is not None and self.__object() is None \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/pages/CMakeLists.txt index 73e3edd049..2b13670dd2 100644 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/CMakeLists.txt +++ b/ThirdParty/Ert/devel/python/python/ert_gui/pages/CMakeLists.txt @@ -1,5 +1,13 @@ -add_python_package( "Python gui.pages" ${PYTHON_INSTALL_PREFIX}/ert_gui/pages "application.py;__init__.py" True) -add_subdirectory( config ) -add_subdirectory( init ) -add_subdirectory( plot ) -add_subdirectory( run ) +set(PYTHON_SOURCES + __init__.py + case_init_configuration.py + configuration_panel.py + message_center.py + popup_dialog.py + queue_system_configuration.py + run_dialog.py + simulation_panel.py +) + +add_python_package("Python ert_gui.pages" ${PYTHON_INSTALL_PREFIX}/ert_gui/pages "${PYTHON_SOURCES}" True) + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/application.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/application.py deleted file mode 100644 index 605c29e2b1..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/application.py +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'application.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -from PyQt4.QtGui import QDockWidget -from PyQt4.QtCore import Qt, QSettings - -class Application(QtGui.QMainWindow): - """An application (window widget) with a list of "tasks" on the left side and a panel on the right side""" - - def __init__(self): - """Constructor""" - QtGui.QMainWindow.__init__(self) - - self.resize(900, 700) - self.setWindowTitle('ERT GUI') - - centralWidget = QtGui.QWidget() - widgetLayout = QtGui.QVBoxLayout() - - self.contentsWidget = QtGui.QListWidget() - self.contentsWidget.setViewMode(QtGui.QListView.IconMode) - self.contentsWidget.setIconSize(QtCore.QSize(96, 96)) - self.contentsWidget.setMovement(QtGui.QListView.Static) - self.contentsWidget.setMaximumWidth(128) - self.contentsWidget.setMinimumWidth(128) - self.contentsWidget.setSpacing(12) - - dock = self._createDock() - - self.addDockWidget(Qt.LeftDockWidgetArea, dock) - - self.pagesWidget = QtGui.QStackedWidget() - - - horizontalLayout = QtGui.QHBoxLayout() - horizontalLayout.addWidget(self.pagesWidget, 1) - widgetLayout.addLayout(horizontalLayout) - - self._createMenu(dock) - - centralWidget.setLayout(widgetLayout) - self.setCentralWidget(centralWidget) - - self.save_function = None - - self._fetchSettings() - - def setSaveFunction(self, save_function): - """Set the function to be called when the save menu choice is selected.""" - self.save_function = save_function - - def _save(self): - if not self.save_function is None: - self.save_function() - - def _createDock(self): - dock = QDockWidget("") - dock.setObjectName("ERTGUI Workflow") - dock.setWidget(self.contentsWidget) - dock.setFeatures(QDockWidget.DockWidgetClosable) - dock.setAllowedAreas(Qt.LeftDockWidgetArea) - return dock - - def _createMenu(self, dock): - file_menu = self.menuBar().addMenu("&File") - file_menu.addAction("Save configuration", self._save) - file_menu.addAction("Close", self._quit) - - self.view_menu = self.menuBar().addMenu("&View") - self.view_menu.addAction(dock.toggleViewAction()) - self.view_menu.addSeparator() - - def addPage(self, name, icon, page): - """Add another page to the application""" - button = QtGui.QListWidgetItem(self.contentsWidget) - button.setIcon(icon) - button.setText(name) - button.setTextAlignment(QtCore.Qt.AlignHCenter) - button.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) - - def switchPage(): - self.contentsWidget.setCurrentRow(self.contentsWidget.row(button)) - - self.view_menu.addAction(name, switchPage) - - self.pagesWidget.addWidget(page) - self.connect(self.contentsWidget, QtCore.SIGNAL('currentItemChanged(QListWidgetItem *, QListWidgetItem *)'), self._changePage) - - self.contentsWidget.setCurrentRow(0) - - - def _changePage(self, current, previous): - """Switch page. Connected to the: currentItemChanged() signal of the list widget on the left side""" - if current is None: - current = previous - - self.pagesWidget.setCurrentIndex(self.contentsWidget.row(current)) - - def _quit(self): - self._saveSettings() - QtGui.qApp.quit() - - def _saveSettings(self): - settings = QSettings("Statoil", "ErtGui") - settings.setValue("geometry", self.saveGeometry()) - settings.setValue("windowState", self.saveState()) - - def closeEvent(self, event): - #Use QT settings saving mechanism - #settings stored in ~/.config/Statoil/ErtGui.conf - self._saveSettings() - QtGui.QMainWindow.closeEvent(self, event) - - def _fetchSettings(self): - settings = QSettings("Statoil", "ErtGui") - self.restoreGeometry(settings.value("geometry").toByteArray()) - self.restoreState(settings.value("windowState").toByteArray()) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/case_init_configuration.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/case_init_configuration.py new file mode 100644 index 0000000000..0745109cd0 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/pages/case_init_configuration.py @@ -0,0 +1,115 @@ +from PyQt4.QtGui import QToolButton +from ert_gui.models.connectors.init import InitializeFromScratchModel +from ert_gui.models.connectors.init.case_list import CaseList +from ert_gui.models.connectors.init.init_from_existing import InitializeFromExistingCaseModel +from ert_gui.models.connectors.init.init_history_length import HistoryLengthModel +from ert_gui.models.connectors.init.init_members import InitializationMembersModel +from ert_gui.models.connectors.init.init_parameters import InitializationParametersModel +from ert_gui.models.connectors.init.initialized_case_selector import InitializedCaseSelectorModel +from ert_gui.widgets.button import Button +from ert_gui.widgets.check_list import CheckList +from ert_gui.widgets.combo_choice import ComboChoice +from ert_gui.widgets.integer_spinner import IntegerSpinner +from ert_gui.widgets.keyword_list import KeywordList +from ert_gui.widgets.row_group import RowGroup +from ert_gui.widgets.row_panel import RowPanel +from ert_gui.widgets.validated_dialog import ValidatedDialog + + +class CaseInitializationConfigurationPanel(RowPanel): + + def __init__(self): + RowPanel.__init__(self, "Case Management") + + self.addCreateNewCaseTab() + self.addInitializeFromScratchTab() + self.addInitializeFromExistingTab() + + self.endTabs() + + def newValidatedKeywordPopup(self, existing_keywords): + dialog = ValidatedDialog("New case", "Enter name of new case:", existing_keywords) + return dialog.showAndTell() + + def addCreateNewCaseTab(self): + self.startTabs("Create new case") + + case_list = KeywordList(CaseList(), "Available cases", "init/case_list") + case_list.setMaximumWidth(250) + case_list.newKeywordPopup = self.newValidatedKeywordPopup + case_list.setSelectable(False) + + self.addRow(case_list) + + + def addInitializeFromScratchTab(self): + self.addTab("Initialize from scratch") + + row_group = RowGroup() + parameter_model = InitializationParametersModel() + parameter_check_list = CheckList(parameter_model, "Parameters", "init/select_parameters") + parameter_check_list.setMaximumWidth(300) + row_group.addWidget(parameter_check_list) + + member_model = InitializationMembersModel() + member_check_list = CheckList(member_model, "Members", "init/select_members") + member_check_list.setMaximumWidth(150) + row_group.addWidget(member_check_list) + + self.addRow(row_group) + + self.addSpace(10) + + initialize_from_scratch = InitializeFromScratchModel() + self.addRow(Button(initialize_from_scratch, help_link="init/initialize_from_scratch")) + + self.addSpace(10) + + + def addInitializeFromExistingTab(self): + self.addTab("Initialize from existing") + + + initialized_cases = ComboChoice(InitializedCaseSelectorModel(), "Source case", "init/source_case") + self.addRow(initialized_cases) + + #self.addRow("State", "Analyzed/Forecast") + + timestep_group = RowGroup("Timestep") + history_length = HistoryLengthModel() + history_length_spinner = IntegerSpinner(history_length, "Timestep", "config/init/history_length") + timestep_group.addWidget(history_length_spinner) + + initial = QToolButton() + initial.setText("Initial") + initial.clicked.connect(history_length.setToMin) + timestep_group.addWidget(initial) + + end_of_time = QToolButton() + end_of_time.setText("End of time") + end_of_time.clicked.connect(history_length.setToMax) + timestep_group.addWidget(end_of_time) + + self.addRow(timestep_group) + + self.addSpace(10) + + row_group = RowGroup() + parameter_model = InitializationParametersModel() + parameter_check_list = CheckList(parameter_model, "Parameters", "init/select_parameters") + parameter_check_list.setMaximumWidth(300) + row_group.addWidget(parameter_check_list) + + member_model = InitializationMembersModel() + member_check_list = CheckList(member_model, "Members", "init/select_members") + member_check_list.setMaximumWidth(150) + row_group.addWidget(member_check_list) + + self.addRow(row_group) + + self.addSpace(10) + + initialize_from_existing = InitializeFromExistingCaseModel() + self.addRow(Button(initialize_from_existing, help_link="init/initialize_from_existing")) + + self.addSpace(10) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/CMakeLists.txt deleted file mode 100644 index ffe74a9b66..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_python_package( "Python ert_gui.pages.config" ${PYTHON_INSTALL_PREFIX}/ert_gui/pages/config "__init__.py;analysis.py;configpages.py;eclipse.py;ensemble.py;observations.py;plot.py;queuesystem.py;simulation.py;systemenv.py" True) -add_subdirectory( jobs ) -add_subdirectory( parameters ) -add_subdirectory( simulations ) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/__init__.py deleted file mode 100644 index 79c95cf38a..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/analysis.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/analysis.py deleted file mode 100644 index ffd0839516..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/analysis.py +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'analysis.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -# ---------------------------------------------------------------------------------------------- -# Analysis tab -# ---------------------------------------------------------------------------------------------- -from ert_gui.widgets.checkbox import CheckBox -from ert_gui.widgets.spinnerwidgets import IntegerSpinner, DoubleSpinner, DoubleSpinner -import ert_gui.widgets.tablewidgets -from ert_gui.widgets.pathchooser import PathChooser -from PyQt4 import QtGui -import ert.enkf - -def createAnalysisPage(configPanel, parent): - configPanel.startPage("Analysis") - - r = configPanel.addRow(CheckBox(parent, "ENKF rerun", "config/analysis/enkf_rerun", "Perform rerun")) - r.initialize = lambda ert : ert.main.analysis_config.get_rerun - r.getter = lambda ert : ert.main.analysis_config.get_rerun - r.setter = lambda ert, value : ert.main.analysis_config.set_rerun( value) - - r = configPanel.addRow(IntegerSpinner(parent, "Rerun start", "config/analysis/rerun_start", 0, 100000)) - r.initialize = lambda ert : ert.main.analysis_config.get_rerun_start - r.getter = lambda ert : ert.main.analysis_config.get_rerun_start - r.setter = lambda ert, value : ert.main.analysis_config.set_rerun_start( value) - - r = configPanel.addRow(PathChooser(parent, "ENKF schedule file", "config/analysis/enkf_sched_file")) - r.initialize = lambda ert : ert.main.model_config.get_enkf_sched_file - r.getter = lambda ert : ert.main.model_config.get_enkf_sched_file - r.setter = lambda ert, value : ert.main.model_config.set_enkf_sched_file(str(value)) - - r = configPanel.addRow(ert_gui.widgets.tablewidgets.KeywordList(parent, "Local config", "config/analysis/local_config")) - r.newKeywordPopup = lambda list : QtGui.QFileDialog.getOpenFileName(r, "Select a path", "") - - def get_local_config_files(ert): - local_config = ert.main.local_config - config_files_pointer = ert.main.local_config.get_config_files - return config_files_pointer - - r.initialize = get_local_config_files - r.getter = get_local_config_files - - def add_config_file(ert, value): - local_config = ert.main.local_config - ert.main.local_config.clear_config_files - - for file in value: - ert.main.local_config.add_config_file( file) - - r.setter = add_config_file - - r = configPanel.addRow(PathChooser(parent, "Update log", "config/analysis/update_log")) - r.initialize = lambda ert : ert.main.analysis_config.get_log_path - r.getter = lambda ert : ert.main.analysis_config.get_log_path - r.setter = lambda ert, value : ert.main.analysis_config.set_log_path( str(value)) - - - configPanel.startGroup("EnKF") - - r = configPanel.addRow(DoubleSpinner(parent, "Alpha", "config/analysis/enkf_alpha", 0, 100000, 2)) - r.initialize = lambda ert : ert.main.analysis_config.get_alpha - r.getter = lambda ert : ert.main.analysis_config.get_alpha - r.setter = lambda ert, value : ert.main.analysis_config.set_alpha( value) - - r = configPanel.addRow(CheckBox(parent, "Merge Observations", "config/analysis/enkf_merge_observations", "Perform merge")) - r.initialize = lambda ert : ert.main.analysis_config.get_merge_observations - r.getter = lambda ert : ert.main.analysis_config.get_merge_observations - r.setter = lambda ert, value : ert.main.analysis_config.set_merge_observations( value) - - configPanel.endGroup() - configPanel.endPage() diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/configpages.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/configpages.py deleted file mode 100644 index e9be36339f..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/configpages.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'configpages.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - -from ert_gui.widgets.configpanel import ConfigPanel -import eclipse -import analysis -import queuesystem -import systemenv -import plot -import observations -import simulation -import ensemble - - -class ConfigPages(ConfigPanel): - - - def __init__(self, parent): - ConfigPanel.__init__(self, parent) - - eclipse.createEclipsePage(self, parent) - analysis.createAnalysisPage(self, parent) - queuesystem.createQueueSystemPage(self, parent) - systemenv.createSystemPage(self, parent) - ensemble.createEnsemblePage(self, parent) - observations.createObservationsPage(self, parent) - simulation.createSimulationsPage(self, parent) - plot.createPlotPage(self, parent) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/eclipse.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/eclipse.py deleted file mode 100644 index 0d6c7415ea..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/eclipse.py +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'eclipse.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -# ---------------------------------------------------------------------------------------------- -# Eclipse tab -# ---------------------------------------------------------------------------------------------- -from ert_gui.widgets.pathchooser import PathChooser -from ert_gui.widgets.tablewidgets import KeywordTable, KeywordList -from ert_gui.widgets.configpanel import ConfigPanel -import ert.enkf - -def createEclipsePage(configPanel, parent): - configPanel.startPage("Eclipse") - - r = configPanel.addRow(PathChooser(parent, "Eclipse Base", "config/eclipse/eclbase", path_format=True)) - r.initialize = lambda ert : ert.main.ecl_config.get_eclbase - r.getter = lambda ert : ert.main.ecl_config.get_eclbase - r.setter = lambda ert, value : ert.main.set_eclbase(str(value)) - - r = configPanel.addRow(PathChooser(parent, "Data file", "config/eclipse/data_file", show_files=True)) - r.initialize = lambda ert : ert.main.ecl_config.get_data_file - r.getter = lambda ert : ert.main.ecl_config.get_data_file - r.setter = lambda ert, value : ert.main.set_datafile(str(value)) - - r = configPanel.addRow(PathChooser(parent, "Grid", "config/eclipse/grid", show_files=True)) - r.initialize = lambda ert : ert.main.ecl_config.get_gridfile - r.getter = lambda ert : ert.main.ecl_config.get_gridfile - r.setter = lambda ert, value : ert.main.ecl_config.set_gridfile(str(value)) - - r = configPanel.addRow(PathChooser(parent, "Schedule file" , "config/eclipse/schedule_file" , show_files = True)) - r.initialize = lambda ert : ert.main.ecl_config.get_schedule_file - r.getter = lambda ert : ert.main.ecl_config.get_schedule_file - r.setter = lambda ert, value : ert.main.ecl_config.set_schedule_file( str(value)) - - - r = configPanel.addRow(PathChooser(parent, "Init section", "config/eclipse/init_section", show_files=True)) - r.initialize = lambda ert : ert.main.ecl_config.get_init_section - r.getter = lambda ert : ert.main.ecl_config.get_init_section - r.setter = lambda ert, value : ert.main.ecl_config.set_init_section( str(value)) - - - r = configPanel.addRow(PathChooser(parent, "Refcase", "config/eclipse/refcase", show_files=True)) - r.initialize = lambda ert : ert.main.ecl_config.get_refcase_name - r.getter = lambda ert : ert.main.ecl_config.get_refcase_name - r.setter = lambda ert, value : ert.main.ecl_config.load_refcase( str(value)) - - r = configPanel.addRow(PathChooser(parent, "Schedule prediction file", "config/eclipse/schedule_prediction_file", show_files=True)) - r.initialize = lambda ert : ert.main.get_schedule_prediction_file - r.getter = lambda ert : ert.main.get_schedule_prediction_file - r.setter = lambda ert, value : ert.main.set_schedule_prediction_file( ert.nonify( value )) - - r = configPanel.addRow(KeywordTable(parent, "Data keywords", "config/eclipse/data_kw")) - r.getter = lambda ert : ert.getSubstitutionList(ert.main.get_data_kw) - - def add_data_kw(ert, listOfKeywords): - ert.main.clear_data_kw - - for keyword in listOfKeywords: - ert.main.add_data_kw( keyword[0], keyword[1]) - - r.setter = add_data_kw - - r.initialize = lambda ert : ert.getSubstitutionList(ert.main.get_data_kw) - - configPanel.addSeparator() - - internalPanel = ConfigPanel(parent) - - internalPanel.startPage("Static keywords") - - r = internalPanel.addRow(KeywordList(parent, "", "config/eclipse/add_static_kw")) - r.getter = lambda ert : ert.main.ecl_config.get_static_kw_list - - def add_static_kw(ert, listOfKeywords): - ert.main.ecl_config.clear_static_kw - - for keyword in listOfKeywords: - ert.main.ecl_config.add_static_kw(keyword) - - r.setter = add_static_kw - r.initialize = lambda ert : ert.main.ecl_config.get_static_kw_list - internalPanel.endPage() - - # todo: add support for fixed length schedule keywords - #internalPanel.startPage("Fixed length schedule keywords") - # - #r = internalPanel.addRow(KeywordList(widget, "", "add_fixed_length_schedule_kw")) - #r.getter = lambda ert : ert.getAttribute("add_fixed_length_schedule_kw") - #r.setter = lambda ert, value : ert.setAttribute("add_fixed_length_schedule_kw", value) - # - #internalPanel.endPage() - - configPanel.addRow(internalPanel) - - configPanel.endPage() diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/ensemble.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/ensemble.py deleted file mode 100644 index 74fcce42af..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/ensemble.py +++ /dev/null @@ -1,246 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'ensemble.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -# ---------------------------------------------------------------------------------------------- -# Ensemble tab -# ---------------------------------------------------------------------------------------------- -from PyQt4 import QtCore -from ert_gui.widgets.spinnerwidgets import IntegerSpinner -from parameters.parameterpanel import ParameterPanel -from parameters.parametermodels import SummaryModel, DataModel, FieldModel, KeywordModel -import ert.ert.enums as enums -import ert.enkf.enkf_config_node -import ert.enkf.gen_kw_config -import ert.enkf.gen_data_config - -def createEnsemblePage(configPanel, parent): - configPanel.startPage("Ensemble") - - r = configPanel.addRow(IntegerSpinner(parent, "Number of realizations", "config/ensemble/num_realizations", 1, 10000)) - - r.initialize = lambda ert : ert.main.ens_size - r.getter = lambda ert : ert.main.ens_size - r.setter = lambda ert, value : ert.main.resize_ensemble( value) - - parent.connect(r, QtCore.SIGNAL("contentsChanged()"), lambda : r.modelEmit("ensembleResized()")) - - - configPanel.startGroup("Parameters") - r = configPanel.addRow(ParameterPanel(parent, "", "")) # no help file necessary - parent.connect(r, QtCore.SIGNAL("contentsChanged()"), lambda : r.modelEmit("ensembleUpdated()")) - - - def getEnsembleParameters(ert): - keys = ert.main.ensemble_config.alloc_keylist - - parameters = [] - for key in keys: - node = ert.main.ensemble_config.get_node( key) - type = node.get_impl_type - data = node.get_ref - - model = None - if type == FieldModel.TYPE: - model = FieldModel(key) - - field_type = node.field_model.get_type - field_type = enums.field_type[field_type] - model["type"] = field_type - - truncation = node.field_model.get_truncation_mode - - if truncation & enums.truncation_type.TRUNCATE_MAX: - model["max"] = node.field_model.get_truncation_max - - if truncation & enums.truncation_type.TRUNCATE_MIN: - model["min"] = node.field_model.get_truncation_min - - model["init"] = node.field_model.get_init_transform_name - model["output"] = node.field_model.get_output_transform_name - - model["init_files"] = node.get_init_file_fmt - model["min_std"] = node.get_min_std_file - model["enkf_outfile"] = node.get_enkf_outfile - model["enkf_infile"] = node.get_enkf_infile - - elif type == DataModel.TYPE: - model = DataModel(key) - - output_format_value = node.data_model.get_output_format - output_format = enums.gen_data_file_format.resolveValue(output_format_value) - - input_format_value = node.data_model.get_input_format - input_format = enums.gen_data_file_format.resolveValue(input_format_value) - - template_file = node.data_model.get_template_file - template_key = node.data_model.get_template_key - init_file_fmt = node.get_init_file_fmt - - model["output_format"] = output_format - model["input_format"] = input_format - model["template_file"] = template_file - model["template_key"] = template_key - model["init_file_fmt"] = init_file_fmt - - min_std = node.get_min_std_file - enkf_outfile = node.get_enkf_outfile - enkf_infile = node.get_enkf_infile - - - - model["min_std"] = min_std - model["enkf_outfile"] = enkf_outfile - model["enkf_infile"] = enkf_infile - - elif type == KeywordModel.TYPE: - model = KeywordModel(key) - model["min_std"] = node.get_min_std_file - model["enkf_outfile"] = node.get_enkf_outfile - model["template"] = node.keyword_model.get_template_file - model["init_file"] = node.get_init_file_fmt - model["parameter_file"] = node.keyword_model.get_parameter_file - elif type == SummaryModel.TYPE: - model = SummaryModel(key) - else: - pass #Unknown type - - #model.setValid(ert.main.enkf_config_node.is_valid) - - parameters.append(model) - - return parameters - - def removeParameter(ert, parameter_key): - ert.main.del_node(ert.main, parameter_key) - - def insertParameter(ert, parameter): - key = parameter.getName() - if parameter.getType() == FieldModel.TYPE: - grid = ert.main.ecl_config.get_grid - node = ert.main.ensemble_config.add_field( key, grid) - parameter.setValid(ert.main.enkf_config_node.is_valid) - elif parameter.getType() == DataModel.TYPE: - node = ert.main.ensemble_config.add_gen_data( key) - parameter.setValid(ert.main.enkf_config_node.is_valid) - elif parameter.getType() == KeywordModel.TYPE: - node = ert.main.ensemble_config.add_gen_kw( key) - parameter.setValid(ert.main.enkf_config_node.is_valid) - elif parameter.getType() == SummaryModel.TYPE: - parameter.setValid(True) - b = ert.main.ensemble_config.add_summary( key) - return b > 0 #0 == NULL - else: - print "Unknown type: ", parameter - return False - - return True - - def updateParameter(ert, parameter_model): - key = parameter_model.getName() - node = ert.main.ensemble_config.get_node( key) - - if isinstance(parameter_model, FieldModel): - type = parameter_model["type"] - - minimum = parameter_model["min"] - maximum = parameter_model["max"] - truncate = truncation_type.resolveTruncationType(minimum, maximum) - - if minimum == "": - minimum = 0.0 - - if maximum == "": - maximum = 0.0 - - if type == field_type.ECLIPSE_RESTART: #dynamic - ert.main.enkf_config_node.update_state_field(node, - truncate.value(), - float(minimum), - float(maximum)) - elif type == field_type.ECLIPSE_PARAMETER: #parameter - ert.main.enkf_config_node.update_parameter_field(node, - ert.nonify(parameter_model["enkf_outfile"]), - ert.nonify(parameter_model["init_files"]), - ert.nonify(parameter_model["min_std"]), - truncate.value(), - float(minimum), - float(maximum), - parameter_model["init"], - parameter_model["output"]) - elif type == field_type.GENERAL: #general - ert.main.enkf_config_node.update_general_field(node, - ert.nonify(parameter_model["enkf_outfile"]), - ert.nonify(parameter_model["enkf_infile"]), - ert.nonify(parameter_model["init_files"]), - ert.nonify(parameter_model["min_std"]), - truncate.value(), - float(minimum), - float(maximum), - parameter_model["init"], - None, - parameter_model["output"]) - - parameter_model.setValid(ert.main.enkf_config_node.is_valid) - - elif isinstance(parameter_model, KeywordModel): - enkf_outfile_fmt = parameter_model["enkf_outfile"] - template_file = parameter_model["template"] - parameter_file = parameter_model["parameter_file"] - min_std_file = parameter_model["min_std"] - init_file_fmt = parameter_model["init_files"] - ert.main.enkf_config_node.update_gen_kw(node, - ert.nonify(enkf_outfile_fmt), - ert.nonify(template_file), - ert.nonify(parameter_file), - ert.nonify(min_std_file), - ert.nonify(init_file_fmt)) - parameter_model.setValid(ert.main.enkf_config_node.is_valid) - elif isinstance(parameter_model, SummaryModel): - #should never be called from SummaryModel... - raise AssertionError("Summary keys can not be updated!") - elif isinstance(parameter_model, DataModel): - input_format = gen_data_file_format.resolveName(str(parameter_model["input_format"])) - output_format = gen_data_file_format.resolveName(str(parameter_model["output_format"])) - ert.main.enkf_config_node.update_gen_data(node, - input_format.value(), - output_format.value(), - ert.nonify(parameter_model["init_file_fmt"]), - ert.nonify(parameter_model["template_file"]), - ert.nonify(parameter_model["template_key"]), - ert.nonify(parameter_model["enkf_outfile"]), - ert.nonify(parameter_model["enkf_infile"]), - ert.nonify(parameter_model["min_std"])) - parameter_model.setValid(ert.main.enkf_config_node.is_valid) - else: - raise AssertionError("Type is not supported: %s" % (parameter_model.__class__)) - - if ert.main.enkf_config_node.is_valid: - ert.main.update_node( ert.main , key ) - - - - - r.getter = getEnsembleParameters - r.initialize = getEnsembleParameters - r.remove = removeParameter - r.insert = insertParameter - r.setter = updateParameter - configPanel.endGroup() - - configPanel.endPage() - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/CMakeLists.txt deleted file mode 100644 index 6eda67f87d..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_python_package( "Python ert_gui.pages.config.jobs" ${PYTHON_INSTALL_PREFIX}/ert_gui/pages/config/jobs "__init__.py;forwardmodelpanel.py;jobsdialog.py;jobspanel.py" True) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/forwardmodelpanel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/forwardmodelpanel.py deleted file mode 100644 index bdab0fa371..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/forwardmodelpanel.py +++ /dev/null @@ -1,196 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'forwardmodelpanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from ert_gui.widgets.helpedwidget import HelpedWidget, ContentModel -from ert_gui.widgets.searchablelist import SearchableList -from PyQt4 import QtGui, QtCore -from ert_gui.widgets.pathchooser import PathChooser -from ert_gui.widgets.validateddialog import ValidatedDialog -import ert_gui.widgets.util -import os -from ert_gui.widgets.util import ValidationInfo -from jobsdialog import EditJobDialog -from ert_gui.widgets.stringbox import StringBox - -class ForwardModelPanel(HelpedWidget): - """ - Widget for adding, removing and editing forward models. - Only uses the setter and getter hooks. - The panel expects remove to return True or False based on the success of the removal. - """ - - def __init__(self, parent=None): - HelpedWidget.__init__(self, parent, "Forward Model", "config/simulation/forward_model") - - self.forward_model_job = ForwardModelJob("undefined") - - self.createWidgets(parent) - - self.emptyPanel = ert_gui.widgets.util.createEmptyPanel() - - self.pagesWidget = QtGui.QStackedWidget() - self.pagesWidget.addWidget(self.emptyPanel) - self.pagesWidget.addWidget(self.forward_model_panel) - self.addWidget(self.pagesWidget) - - self.addHelpButton() - - def createWidgets(self, parent): - self.searchableList = SearchableList(parent, list_height=150, list_width=150, ignore_case=True, order_editable=True) - self.addWidget(self.searchableList) - self.connect(self.searchableList, QtCore.SIGNAL('currentItemChanged(QListWidgetItem, QListWidgetItem)'),self.changeParameter) - self.connect(self.searchableList, QtCore.SIGNAL('addItem(QListWidgetItem)'), self.addItem) - self.connect(self.searchableList, QtCore.SIGNAL('removeItem(QListWidgetItem)'), self.removeItem) - self.connect(self.searchableList, QtCore.SIGNAL('orderChanged(QListWidgetItem)'), self.forwardModelChanged) - - - self.forward_model_panel = ert_gui.widgets.util.createEmptyPanel() - - layout = QtGui.QFormLayout() - layout.setLabelAlignment(QtCore.Qt.AlignRight) - - - self.forward_model_args = StringBox(self, "", "config/simulation/forward_model_arguments") - self.forward_model_args.initialize = ContentModel.emptyInitializer - self.forward_model_args.setter = self.setArguments - self.forward_model_args.getter = lambda model: self.forward_model_job.arguments - - layout.addRow("Arguments:", self.forward_model_args) - - layout.addRow(ert_gui.widgets.util.createSpace(20)) - - self.help_text = QtGui.QLabel() - self.help_text.setText("") - - layout.addRow(ert_gui.widgets.util.centeredWidget(self.help_text)) - - self.forward_model_panel.setLayout(layout) - self.modelConnect('jobListChanged()', self.fetchContent) - - def setArguments(self, model, arguments): - """Set the arguments of the current forward model job.""" - self.forward_model_job.setArguments(arguments) - self.forwardModelChanged() - - def fetchContent(self): - """ - Retrieves data from the model and inserts it into the widget. - Expects a hash containing these two keys: available_jobs and forward_model. - available_jobs=list of names - forward_model)list of tuples containing(name, arguments, help_text) - """ - data = self.getFromModel() - - self.available_jobs = data['available_jobs'] - - forward_model = data['forward_model'] - self.searchableList.list.clear() - for job in forward_model: - jobitem = QtGui.QListWidgetItem() - jobitem.setText(job[0]) - forward_model_job = ForwardModelJob(job[0]) - forward_model_job.setArguments(job[1]) - forward_model_job.setHelpText(job[2]) - - jobitem.setData(QtCore.Qt.UserRole, forward_model_job) - jobitem.setToolTip(job[0]) - self.searchableList.list.addItem(jobitem) - - def setForwardModelJob(self, forward_model_job): - """Set the current visible forward model job""" - self.forward_model_job = forward_model_job - self.help_text.setText(forward_model_job.help_text) - self.forward_model_args.fetchContent() - - def changeParameter(self, current, previous): - """Switch between forward models. Selection from the list""" - if current is None: - self.pagesWidget.setCurrentWidget(self.emptyPanel) - else: - self.pagesWidget.setCurrentWidget(self.forward_model_panel) - self.setForwardModelJob(current.data(QtCore.Qt.UserRole).toPyObject()) - - def forwardModelChanged(self): - """ - Called whenever the forward model is changed. (reordering, adding, removing) - The data submitted to the updateContent() (from ContentModel) is a list of tuples (name, arguments) - """ - items = self.searchableList.getItems() - currentRow = self.searchableList.list.currentRow() - forward_model = [] - for item in items: - forward_model_job = item.data(QtCore.Qt.UserRole).toPyObject() - forward_model.append((forward_model_job.name, forward_model_job.arguments)) - - self.updateContent(forward_model) - self.fetchContent() - self.searchableList.list.setCurrentRow(currentRow) - - def addToList(self, list, name): - """Adds a new job to the list""" - param = QtGui.QListWidgetItem() - param.setText(name) - - new_job = ForwardModelJob(name) - param.setData(QtCore.Qt.UserRole, new_job) - - list.addItem(param) - list.setCurrentItem(param) - return param - - def addItem(self, list): - """Called by the add button to insert a new job""" - - pd = ValidatedDialog(self, "New forward model job", "Select a job:", self.available_jobs, True) - if pd.exec_(): - self.addToList(list, pd.getName()) - self.forwardModelChanged() - - def removeItem(self, list): - """Called by the remove button to remove a selected job""" - currentRow = list.currentRow() - - if currentRow >= 0: - title = "Delete forward model job?" - msg = "Are you sure you want to delete the job from the forward model?" - btns = QtGui.QMessageBox.Yes | QtGui.QMessageBox.No - doDelete = QtGui.QMessageBox.question(self, title, msg, btns) - - if doDelete == QtGui.QMessageBox.Yes: - list.takeItem(currentRow) - self.forwardModelChanged() - -class ForwardModelJob: - """Stores the name, arguments and help text of a job.""" - - def __init__(self, name, arguments=None, help_text=""): - self.name = name - self.setArguments(arguments) - self.setHelpText(help_text) - - def setArguments(self, args): - if args is None: - args = "" - self.arguments = args - - def setHelpText(self, text): - if text == "": - self.help_text = "No help available for this job." - else: - self.help_text = text - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/jobsdialog.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/jobsdialog.py deleted file mode 100644 index df006158d6..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/jobsdialog.py +++ /dev/null @@ -1,262 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'jobsdialog.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -from ert_gui.widgets.configpanel import ConfigPanel -from ert_gui.widgets.pathchooser import PathChooser -from ert_gui.widgets.tablewidgets import KeywordTable -from ert_gui.widgets.tablewidgets import KeywordList -from ert_gui.widgets.stringbox import StringBox -import os -from ert_gui.widgets.spinnerwidgets import IntegerSpinner -import ert_gui.widgets.util -from ert_gui.widgets.helpedwidget import ContentModelProxy - -class EditJobDialog(QtGui.QDialog): - """ - A panel for creating custom jobs. - """ - def __init__(self, parent=None): - QtGui.QDialog.__init__(self, parent) - self.setModal(True) - self.setWindowTitle("Edit job") - self.setMinimumWidth(650) - - layout = QtGui.QVBoxLayout() - - self.jobPanel = JobConfigPanel(parent) - - layout.addWidget(self.jobPanel) - - self.doneButton = QtGui.QPushButton("Done", self) - self.cancelButton = QtGui.QPushButton("Cancel", self) - self.connect(self.doneButton, QtCore.SIGNAL('clicked()'), self.saveJob) - self.connect(self.cancelButton, QtCore.SIGNAL('clicked()'), self.reject) - - self.validationInfo = widgets.util.ValidationInfo() - - buttonLayout = QtGui.QHBoxLayout() - buttonLayout.addWidget(self.validationInfo) - buttonLayout.addStretch(1) - buttonLayout.addWidget(self.doneButton) - buttonLayout.addWidget(self.cancelButton) - - layout.addSpacing(10) - layout.addLayout(buttonLayout) - - self.setLayout(layout) - - - def keyPressEvent(self, event): - if not event.key() == QtCore.Qt.Key_Escape: - QtGui.QDialog.keyPressEvent(self, event) - - def setJob(self, job): - self.jobPanel.setJob(job) - - def saveJob(self): - msg = self.jobPanel.saveJob() - if msg is None: - self.accept() - else: - self.validationInfo.setMessage(msg) - - -class JobConfigPanel(ConfigPanel): - def __init__(self, parent=None): - ConfigPanel.__init__(self, parent) - - self.initialized = False - - layout = QtGui.QFormLayout() - layout.setLabelAlignment(QtCore.Qt.AlignRight) - - def jid(ert): - """Returns the pointer to the current job (self.job)""" - jl = ert.main.site_config.get_installed_jobs - return jl.get_job(self.job.name) - - def set_stdin(ert,value): - job = jid(ert) - job.set_stdin_file(value) - - def get_stdin(ert): - job = jid(ert) - return job.get_stdin_file - - self.stdin = PathChooser(self, "", "config/systemenv/install_job_stdin", show_files=True, must_be_set=False, must_exist=True) - self.stdin.setter = set_stdin - self.stdin.getter = get_stdin - self.stdin.initialize =get_stdin - - def set_stdout(ert,value): - job = jid(ert) - job.set_stdout_file(value) - - def get_stdout(ert): - job = jid(ert) - return job.get_stdout_file - - self.stdout = PathChooser(self, "", "config/systemenv/install_job_stdout", show_files=True, must_be_set=True, must_exist=False) - self.stdout.setter = set_stdout - self.stdout.getter = get_stdout - self.stdout.initialize = get_stdout - - def set_stderr(ert,value): - job = jid(ert) - job.set_stderr_file(value) - - def get_stderr(ert): - job = jid(ert) - return job.get_stderr_file - - self.stderr = PathChooser(self, "", "config/systemenv/install_job_stderr", show_files=True, must_be_set=True, must_exist=False) - self.stderr.setter = set_stderr - self.stderr.getter = get_stderr - self.stderr.initialize = get_stderr - - def set_target_file(ert,value): - job = jid(ert) - job.set_target_file(value) - - def get_target_file(ert): - job = jid(ert) - return job.get_target_file - - self.target_file = PathChooser(self, "", "config/systemenv/install_job_target_file", show_files=True, must_be_set=False, must_exist=False) - self.target_file.setter = set_target_file - self.target_file.getter = get_target_file - self.target_file.initialize = get_target_file - - def set_executable(ert,value): - job = jid(ert) - job.set_executable(value) - - def get_executable(ert): - job = jid(ert) - return job.get_executable - - self.executable = PathChooser(self, "", "config/systemenv/install_job_executable", show_files=True, must_be_set=True, - must_exist=True, is_executable_file=True) - self.executable.setter = set_executable - self.executable.getter = get_executable - - def setEnv(ert, value): - job = jid(ert) - job.clear_environment - - for env in value: - job.set_environment(env[0], env[1]) - - def getEnv(ert): - job = jid(ert) - return ert.getHash(job.get_environment) - - self.env = KeywordTable(self, "", "config/systemenv/install_job_env", colHead1="Variable", colHead2="Value") - self.env.setter = setEnv - self.env.getter = getEnv - - def set_arglist(ert,value): - job = jid(ert) - job.set_private_args_from_string(value) - - def get_arglist(ert): - job = jid(ert) - return job.get_private_args_as_string - - self.arglist = StringBox(self, "", "config/systemenv/install_job_arglist") - self.arglist.setter = set_arglist - self.arglist.getter = get_arglist - - def set_max_running(ert,value): - job = jid(ert) - job.set_max_running(value) - - def get_max_running(ert): - job = jid(ert) - return job.get_max_running - - self.max_running = IntegerSpinner(self, "", "config/systemenv/install_job_max_running", 0, 10000) - self.max_running.setter = set_max_running - self.max_running.getter = get_max_running - - def set_max_running_minutes(ert,value): - job = jid(ert) - job.set_max_running_minutes(value) - - def get_max_running(ert): - job = jid(ert) - return job.get_max_running_minutes - - self.max_running_minutes = IntegerSpinner(self, "", "config/systemenv/install_job_max_running_minutes", 0, 10000) - self.max_running_minutes.setter = set_max_running_minutes - self.max_running_minutes.getter = get_max_running_minutes - - - self.startPage("Standard") - self.add("Executable.:", self.executable) - self.add("Stdout:", self.stdout) - self.add("Stderr:", self.stderr) - self.add("Target file:", self.target_file) - self.add("Arglist.:", self.arglist) - self.endPage() - - self.startPage("Advanced") - self.add("Stdin:", self.stdin) - self.add("Max running:", self.max_running) - self.max_running.setInfo("(0=unlimited)") - self.add("Max running minutes:", self.max_running_minutes) - self.max_running_minutes.setInfo("(0=unlimited)") - self.add("Env.:", self.env) - self.endPage() - - def add(self, label, widget): - self.addRow(widget, label) - - - def setJob(self, job): - self.job = job - - self.initialize(self.stdin.getModel()) - - self.cmproxy = ContentModelProxy() #Since only the last change matters and no insert and remove is done - self.cmproxy.proxify(self.stdin, self.stdout, self.stderr, self.target_file, self.executable, - self.env, self.arglist, - self.max_running, self.max_running_minutes) - - self.stdin.fetchContent() - self.stdout.fetchContent() - self.stderr.fetchContent() - self.target_file.fetchContent() - self.executable.fetchContent() - self.env.fetchContent() - self.arglist.fetchContent() - self.max_running.fetchContent() - self.max_running_minutes.fetchContent() - - def saveJob(self): - if self.executable.isValid() and self.stderr.isValid() and self.stdout.isValid(): - self.cmproxy.apply() - - ert = self.stdin.getModel() - jl = ert.enkf.site_config_get_installed_jobs(ert.site_config) - jid = ert.job_queue.ext_joblist_get_job(jl, self.job.name) - ert.job_queue.ext_job_save(jid) - return None - else: - return "These fields are required: executable, stdout and stderr!" - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/jobspanel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/jobspanel.py deleted file mode 100644 index 18f4681a10..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/jobs/jobspanel.py +++ /dev/null @@ -1,186 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'jobspanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from ert_gui.widgets.helpedwidget import HelpedWidget, ContentModel -from ert_gui.widgets.searchablelist import SearchableList -from PyQt4 import QtGui, QtCore -from ert_gui.widgets.pathchooser import PathChooser -from ert_gui.widgets.validateddialog import ValidatedDialog -import ert_gui.widgets.util -import os -from ert_gui.widgets.util import ValidationInfo -from jobsdialog import EditJobDialog - -class JobsPanel(HelpedWidget): - """ - Widget for adding, removing and editing jobs. - These additional ContentModel functions must be implemented: insert and remove. - The panel expects remove to return True or False based on the success of the removal. - """ - - def __init__(self, parent=None): - HelpedWidget.__init__(self, parent, "", "config/systemenv/install_jobs") - - self.job = Job("undefined") - - self.createWidgets(parent) - - self.emptyPanel = ert_gui.widgets.util.createEmptyPanel() - - self.pagesWidget = QtGui.QStackedWidget() - self.pagesWidget.addWidget(self.emptyPanel) - self.pagesWidget.addWidget(self.jobPanel) - self.addWidget(self.pagesWidget) - - def createWidgets(self, parent): - self.searchableList = SearchableList(parent, list_height=200, list_width=150, ignore_case=True) - self.addWidget(self.searchableList) - self.connect(self.searchableList , QtCore.SIGNAL('currentItemChanged(QListWidgetItem, QListWidgetItem)'),self.changeParameter) - self.connect(self.searchableList , QtCore.SIGNAL('addItem(QListWidgetItem)'), self.addItem) - self.connect(self.searchableList , QtCore.SIGNAL('removeItem(QListWidgetItem)'), self.removeItem) - - - self.jobPanel = ert_gui.widgets.util.createEmptyPanel() - - layout = QtGui.QFormLayout() - layout.setLabelAlignment(QtCore.Qt.AlignRight) - - self.jobpath = PathChooser(self, "", "config/systemenv/install_job_path", show_files=True, must_be_set=True) - self.jobpath.initialize = ContentModel.emptyInitializer - self.jobpath.setter = self.setPath - self.jobpath.getter = lambda model: self.job.path - - layout.addRow("Job:", self.jobpath) - - layout.addRow(ert_gui.widgets.util.createSpace(20)) - - self.validationInfo = ValidationInfo(ValidationInfo.EXCLAMATION) - self.validationInfo.setMessage("Pressing edit will create a job that does not exist.") - - self.editButton = QtGui.QPushButton(self) - self.editButton.setToolTip("Edit job") - self.editButton.setIcon(ert_gui.widgets.util.resourceIcon("cog")) - self.editButton.setText("Edit") - self.connect(self.editButton, QtCore.SIGNAL('clicked()'), self.editJob) - - - layout.addRow(ert_gui.widgets.util.centeredWidget(self.editButton)) - - layout.addRow(ert_gui.widgets.util.centeredWidget(self.validationInfo)) - - - self.jobPanel.setLayout(layout) - - def setPath(self, model, path): - self.job.set("path", path) - self.updateContent(self.job) - -# if os.path.exists(path): -# self.validationInfo.setMessage("") -# else: -# self.validationInfo.setMessage("The path must exist! Edit to create the job.") - - def editJob(self): - if not os.path.exists(Job.path_prefix): - os.mkdir(Job.path_prefix) - - ejd = EditJobDialog(self) - ejd.setJob(self.job) - ejd.exec_() - self.jobpath.validatePath() - - def fetchContent(self): - """Retrieves data from the model and inserts it into the widget""" - jobs = self.getFromModel() - - for job in jobs: - jobitem = QtGui.QListWidgetItem() - jobitem.setText(job.name) - jobitem.setData(QtCore.Qt.UserRole, job) - jobitem.setToolTip(job.name) - self.searchableList.list.addItem(jobitem) - - def setJob(self, job): - self.job = job - self.jobpath.fetchContent() - - def changeParameter(self, current, previous): - """Switch between jobs. Selection from the list""" - if current is None: - self.pagesWidget.setCurrentWidget(self.emptyPanel) - else: - self.pagesWidget.setCurrentWidget(self.jobPanel) - self.setJob(current.data(QtCore.Qt.UserRole).toPyObject()) - - def addToList(self, list, name): - """Adds a new job to the list""" - param = QtGui.QListWidgetItem() - param.setText(name) - - new_job = Job(name) - param.setData(QtCore.Qt.UserRole, new_job) - - list.addItem(param) - list.setCurrentItem(param) - return new_job - - def addItem(self, list): - """Called by the add button to insert a new job""" - uniqueNames = [] - for index in range(list.count()): - uniqueNames.append(str(list.item(index).text())) - - pd = ValidatedDialog(self, "New job", "Enter name of new job:", uniqueNames) - if pd.exec_(): - new_job = self.addToList(list, pd.getName()) - - self.updateContent(new_job, operation=self.INSERT) - self.modelEmit('jobListChanged()') - - def removeItem(self, list): - """Called by the remove button to remove a selected job""" - currentRow = list.currentRow() - - if currentRow >= 0: - title = "Delete job?" - msg = "Are you sure you want to delete the job?" - btns = QtGui.QMessageBox.Yes | QtGui.QMessageBox.No - doDelete = QtGui.QMessageBox.question(self, title, msg, btns) - - if doDelete == QtGui.QMessageBox.Yes: - item = list.currentItem() - job = item.data(QtCore.Qt.UserRole).toPyObject() - success = self.updateContent(job, operation=self.REMOVE) - if success: - list.takeItem(currentRow) - self.modelEmit('jobListChanged()') - - -class Job: - path_prefix = "private_jobs" - - def __init__(self, name, path=None): - self.name = name - - if path is None: - self.path = self.path_prefix + "/" + name - else: - self.path = str(path) - - - def set(self, attr, value): - setattr(self, attr, value) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/observations.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/observations.py deleted file mode 100644 index b32de5adc4..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/observations.py +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'observations.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -# ---------------------------------------------------------------------------------------------- -# Observations tab -# ---------------------------------------------------------------------------------------------- -from ert_gui.widgets.combochoice import ComboChoice -from ert_gui.widgets.pathchooser import PathChooser -from ert.ert.enums import history_source_type -from ert_gui.widgets.reloadbutton import ReloadButton -from ert.sched.history import HistoryType - -def createObservationsPage(configPanel, parent): - configPanel.startPage("Observations") - - r = configPanel.addRow(ComboChoice(parent, history_source_type.values(), "History source", "config/observations/history_source")) - - def get_history_source(ert): - history_source = ert.main.model_config.get_history_source - return history_source_type.resolveValue(history_source.get_source_string) - - r.initialize = get_history_source - r.getter = get_history_source - - def set_history_source(ert, value): - history_source_enum = history_source_type.resolveName(str(value)) - sched_file = ert.main.ecl_config.get_sched_file - refcase = ert.main.ecl_config.get_refcase - if history_source_enum.value() == 0: - history = HistoryType.alloc_from_sched_file(sched_file) - if history_source_enum.value() == 1: - history = HistoryType.alloc_from_refcase(refcase, True) - if history_source_enum.value() == 2: - history = HistoryType.alloc_from_refcase(refcase, False) - ert.main.model_config.set_history_source(history, sched_file, refcase) - - r.setter = set_history_source - - - r = configPanel.addRow(PathChooser(parent, "Observations config", "config/observations/obs_config", True)) - - def get_obs(ert): - obs = ert.main.get_obs - return obs.get_config_file - - r.initialize = get_obs - r.getter = get_obs - - - def set_obs(ert, value): - ert.main.load_obs( str(value)) - r.setter = set_obs - - - r = configPanel.addRow(ReloadButton(parent, "Reload Observations", "config/observations/reload_observation", "Reload")) - r.initialize = lambda ert : ert.main.reload_obs - r.getter = lambda ert : ert.main.reload_obs - - - configPanel.endPage() diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/CMakeLists.txt deleted file mode 100644 index 0d5db1aa04..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_python_package( "Python ert_gui.pages.config.parameters" ${PYTHON_INSTALL_PREFIX}/ert_gui/pages/config/parameters "__init__.py;datapanel.py;fieldpanel.py;keywordpanel.py;parameterdialog.py;parametermodels.py;parameterpanel.py" True) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/__init__.py deleted file mode 100644 index 79c95cf38a..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/datapanel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/datapanel.py deleted file mode 100644 index 3c7ba91618..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/datapanel.py +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'datapanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -from ert_gui.widgets.combochoice import ComboChoice -from ert_gui.widgets.stringbox import DoubleBox -from ert_gui.widgets.pathchooser import PathChooser -from parametermodels import DataModel -import ert.ert.enums as enums -import ert_gui.widgets.helpedwidget - -class DataPanel(QtGui.QFrame): - - def __init__(self, parent): - QtGui.QFrame.__init__(self, parent) - - self.setFrameShape(QtGui.QFrame.StyledPanel) - self.setFrameShadow(QtGui.QFrame.Plain) - self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) - - layout = QtGui.QFormLayout() - layout.setLabelAlignment(QtCore.Qt.AlignRight) - - self.dataModel = DataModel("") - - self.input = ComboChoice(self, enums.gen_data_file_format.INPUT_TYPES, "", "config/ensemble/gen_data_param_init") - self.modelWrap(self.input, "input_format") - - self.output = ComboChoice(self, enums.gen_data_file_format.OUTPUT_TYPES, "", "config/ensemble/gen_data_param_output") - self.modelWrap(self.output, "output_format") - - self.template_file = PathChooser(self, "", "config/ensemble/gen_data_template_file", True , must_be_set=False) - self.modelWrap(self.template_file, "template_file") - - self.template_key = PathChooser(self, "", "config/ensemble/gen_data_template_key", True , must_be_set=False) - self.modelWrap(self.template_key, "template_key") - - self.init_file_fmt = PathChooser(self, "", "config/ensemble/gen_data_init_file_fmt", True , must_be_set=False) - self.modelWrap(self.init_file_fmt, "init_file_fmt") - - - self.file_generated_by_enkf = PathChooser(self, "", "config/ensemble/gen_data_file_generated_by_enkf", True, must_be_set=False) - self.modelWrap(self.file_generated_by_enkf, "enkf_outfile") - - self.file_loaded_by_enkf = PathChooser(self, "", "config/ensemble/gen_data_file_loaded_by_enkf", True, must_be_set=False) - self.modelWrap(self.file_loaded_by_enkf, "enkf_infile") - - self.min_std = PathChooser(self, "", "config/ensemble/gen_data_min_std", True, must_be_set=False) - self.modelWrap(self.min_std, "min_std") - - layout.addRow("Input:", self.input) - layout.addRow("Output:", self.output) - layout.addRow("Template file:", self.template_file) - layout.addRow("Template key:", self.template_key) - layout.addRow("Init files:", self.init_file_fmt) - layout.addRow("Include file:", self.file_generated_by_enkf) - layout.addRow("Min. std.:", self.min_std) - layout.addRow("File loaded by EnKF:", self.file_loaded_by_enkf) - - button = QtGui.QPushButton() - button.setText("Reload") - button.setMaximumWidth(70) - self.connect(button, QtCore.SIGNAL('clicked()'), self._reload) - - layout.addRow("Reload template:", button) - - self.setLayout(layout) - - def _reload(self): - self.dataModel.emitUpdate() - - def modelWrap(self, widget, attribute): - widget.initialize = ert_gui.widgets.helpedwidget.ContentModel.emptyInitializer - widget.setter = lambda model, value: self.dataModel.set(attribute, value) - widget.getter = lambda model: self.dataModel[attribute] - - def setDataModel(self, dataModel): - self.dataModel = dataModel - - self.input.fetchContent() - self.output.fetchContent() - self.template_file.fetchContent() - self.template_key.fetchContent() - self.init_file_fmt.fetchContent() - self.file_generated_by_enkf.fetchContent() - self.file_loaded_by_enkf.fetchContent() - self.min_std.fetchContent() diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/fieldpanel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/fieldpanel.py deleted file mode 100644 index 978245006a..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/fieldpanel.py +++ /dev/null @@ -1,122 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'fieldpanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -from ert_gui.widgets.combochoice import ComboChoice -from ert_gui.widgets.stringbox import DoubleBox -from ert_gui.widgets.pathchooser import PathChooser -from parametermodels import FieldModel -from ert.ert.enums import field_type -from ert_gui.widgets.helpedwidget import ContentModel - -class FieldPanel(QtGui.QFrame): - - def __init__(self, parent): - QtGui.QFrame.__init__(self, parent) - - self.setFrameShape(QtGui.QFrame.StyledPanel) - self.setFrameShadow(QtGui.QFrame.Plain) - self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) - - layout = QtGui.QFormLayout() - layout.setLabelAlignment(QtCore.Qt.AlignRight) - - self.fieldModel = FieldModel("") - - self.fieldType = ComboChoice(self, field_type.values(), "", "config/ensemble/field_type") - self.fieldType.setter = lambda model, value: self.typeChanged(field_type[str(value)]) - self.fieldType.getter = lambda model: str(self.fieldModel["type"]) - self.fieldType.initialize = ContentModel.emptyInitializer - - self.min = DoubleBox(self, "", "config/ensemble/field_min") - self.modelWrap(self.min, "min") - - self.max = DoubleBox(self, "", "config/ensemble/field_max") - self.modelWrap(self.max, "max") - - self.init = ComboChoice(self, ["None", "EXP", "EXP0", "LOG", "LN","LN0", "POW10", "ADD", "MUL", "RANDINT", "RANDFLOAT"], "", "config/ensemble/field_init") - self.modelWrap(self.init, "init") - - self.output = ComboChoice(self, ["None", "EXP", "EXP0", "LOG", "LN","LN0", "POW10", "ADD", "MUL", "RANDINT", "RANDFLOAT"], "", "config/ensemble/field_output") - self.modelWrap(self.output, "output") - - self.init_files = PathChooser(self, "", "config/ensemble/field_init_files", True) - self.modelWrap(self.init_files, "init_files") - - self.file_generated_by_enkf = PathChooser(self, "", "config/ensemble/field_file_generated_by_enkf", True) - self.modelWrap(self.file_generated_by_enkf, "enkf_outfile") - - self.file_loaded_by_enkf = PathChooser(self, "", "config/ensemble/field_file_loaded_by_enkf", True) - self.modelWrap(self.file_loaded_by_enkf, "enkf_infile") - - self.min_std = PathChooser(self, "", "config/ensemble/field_min_std", True, must_be_set=False) - self.modelWrap(self.min_std, "min_std") - - layout.addRow("Field type:", self.fieldType) - layout.addRow("Include file:", self.file_generated_by_enkf) # generated by ERT - layout.addRow("Init files:", self.init_files) - layout.addRow("Min:", self.min) - layout.addRow("Max:", self.max) - layout.addRow("Init transformation:", self.init) - layout.addRow("Output transformation:", self.output) - layout.addRow("Min. std.:", self.min_std) - layout.addRow("File loaded by EnKF:", self.file_loaded_by_enkf) - - self.setLayout(layout) - - self.typeChanged(field_type.ECLIPSE_RESTART) - - def modelWrap(self, widget, attribute): - widget.initialize = ContentModel.emptyInitializer - widget.setter = lambda model, value: self.fieldModel.set(attribute, value) - widget.getter = lambda model: self.fieldModel[attribute] - - def typeChanged(self, value): - setattr(self.fieldModel, "type", value) - - self.min.setEnabled(True) - self.max.setEnabled(True) - self.init.setEnabled(True) - self.output.setEnabled(True) - self.init_files.setEnabled(True) - self.file_generated_by_enkf.setEnabled(True) - self.file_loaded_by_enkf.setEnabled(True) - self.min_std.setEnabled(True) - - if value == field_type.ECLIPSE_RESTART: - self.init.setEnabled(False) - self.output.setEnabled(False) - self.init_files.setEnabled(False) - self.file_generated_by_enkf.setEnabled(False) - self.file_loaded_by_enkf.setEnabled(False) - self.min_std.setEnabled(False) - - elif value == field_type.ECLIPSE_PARAMETER: - self.file_loaded_by_enkf.setEnabled(False) - - def setFieldModel(self, fieldModel): - self.fieldModel = fieldModel - - self.fieldType.fetchContent() - self.min.fetchContent() - self.max.fetchContent() - self.init.fetchContent() - self.output.fetchContent() - self.init_files.fetchContent() - self.file_generated_by_enkf.fetchContent() - self.file_loaded_by_enkf.fetchContent() - self.min_std.fetchContent() diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/keywordpanel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/keywordpanel.py deleted file mode 100644 index 3318822641..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/keywordpanel.py +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'keywordpanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -from ert_gui.widgets.combochoice import ComboChoice -from ert_gui.widgets.stringbox import DoubleBox -from ert_gui.widgets.pathchooser import PathChooser -from parametermodels import KeywordModel -from ert_gui.widgets.helpedwidget import ContentModel - -class KeywordPanel(QtGui.QFrame): - def __init__(self, parent): - QtGui.QFrame.__init__(self, parent) - - self.setFrameShape(QtGui.QFrame.StyledPanel) - self.setFrameShadow(QtGui.QFrame.Plain) - self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) - - layout = QtGui.QFormLayout() - layout.setLabelAlignment(QtCore.Qt.AlignRight) - - self.keywordModel = KeywordModel("") - - self.min_std = PathChooser(self, "", "config/ensemble/gen_kw_min_std", True , must_be_set = False) - self.modelWrap(self.min_std, "min_std") - - self.template = PathChooser(self, "", "config/ensemble/gen_kw_template", True) - self.modelWrap(self.template, "template") - - self.enkf_outfile = PathChooser(self, "", "config/ensemble/gen_kw_enkf_outfile", True, must_be_set=False) - self.modelWrap(self.enkf_outfile, "enkf_outfile") - - self.init_files = PathChooser(self, "", "config/ensemble/gen_kw_init_files", True, must_be_set=False) - self.modelWrap(self.init_files, "init_files") - - self.parameter_file = PathChooser(self, "", "config/ensemble/gen_kw_parameter_file", True, must_be_set=False) - self.modelWrap(self.parameter_file, "parameter_file") - - layout.addRow("Parameter file:" , self.parameter_file) - layout.addRow("Include file:" , self.enkf_outfile) - layout.addRow("Template:" , self.template) - layout.addRow("Minimum std:" , self.min_std) - layout.addRow("Init files:" , self.init_files) - - button = QtGui.QPushButton() - button.setText("Reload") - button.setMaximumWidth(70) - self.connect(button, QtCore.SIGNAL('clicked()'), self._reload) - - layout.addRow("Reload files:", button) - - self.setLayout(layout) - - def _reload(self): - self.keywordModel.emitUpdate() - - def setKeywordModel(self, keywordModel): - self.keywordModel = keywordModel - - self.min_std.fetchContent() - self.template.fetchContent() - self.enkf_outfile.fetchContent() - self.init_files.fetchContent() - self.parameter_file.fetchContent() - - def modelWrap(self, widget, attribute): - widget.initialize = ContentModel.emptyInitializer - widget.setter = lambda model, value: self.keywordModel.set(attribute, value) - widget.getter = lambda model: self.keywordModel[attribute] - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/parameterdialog.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/parameterdialog.py deleted file mode 100644 index 981f8cf556..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/parameterdialog.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'parameterdialog.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -from ert_gui.widgets.validateddialog import ValidatedDialog - -class ParameterDialog(ValidatedDialog): - """A dialog for creating parameters based on type and name. Performs validation of name.""" - - def __init__(self, parent, types, uniqueNames): - """Creates a new dialog that validates uniqueness against the provided list""" - ValidatedDialog.__init__(self, parent, 'Create new parameter', "Select type and enter name of parameter:", uniqueNames) - - self.paramCombo = QtGui.QComboBox(self) - - keys = types.keys() - keys.sort() - for key in keys: - self.paramCombo.addItem(types[key], key.name) - - self.layout.insertRow(2, "Type:", self.paramCombo) - - - def getTypeName(self): - """Return the type selected by the user""" - return str(self.paramCombo.currentText()).strip() - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/parametermodels.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/parametermodels.py deleted file mode 100644 index 69e6876e08..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/parametermodels.py +++ /dev/null @@ -1,108 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'parametermodels.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from ert.ert.enums import enkf_impl_type, field_type -from PyQt4.QtCore import QObject -from PyQt4.Qt import SIGNAL - -class Model(QObject): - - def __init__(self, name): - QObject.__init__(self) - self.name = name - self.data = {} - self.valid = True - - def set(self, attr, value): - self[attr] = value - - def __setitem__(self, attr, value): - self.data[attr] = value - self.emitUpdate() - - - def __getitem__(self, item): - return self.data[item] - - def isValid(self): - return self.valid - - def setValid(self, valid): - if not self.valid == valid: - self.valid = valid - self.emitUpdate() - - def emitUpdate(self): - self.emit(SIGNAL("modelChanged(Model)"), self) - - - def getName(self): - return self.name - - -class FieldModel(Model): - TYPE = enkf_impl_type.FIELD - - def __init__(self, name): - Model.__init__(self, name) - self.name = name - - self["type"] = field_type.GENERAL - self["min"] = "" - self["max"] = "" - self["init"] = "None" - self["output"] = "None" - self["init_files"] = "" - self["enkf_outfile"] = "" - self["enkf_infile"] = "" - self["min_std"] = "" - -class KeywordModel(Model): - TYPE = enkf_impl_type.GEN_KW - - def __init__(self, name): - Model.__init__(self, name) - self.name = name - - self["min_std"] = "" - self["enkf_outfile"] = "" - self["template"] = "" - self["init_files"] = "" - self["parameter_file"] = "" - -class DataModel(Model): - TYPE = enkf_impl_type.GEN_DATA - - def __init__(self, name): - Model.__init__(self, name) - self.name = name - - self["input_format"] = "" - self["output_format"] = "" - self["template_file"] = "" - self["template_key"] = "" - self["init_file_fmt"] = "" - self["enkf_outfile"] = "" - self["enkf_infile"] = "" - self["min_std"] = "" - -class SummaryModel(Model): - TYPE = enkf_impl_type.SUMMARY - - def __init__(self, name): - Model.__init__(self, name) - self.name = name diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/parameterpanel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/parameterpanel.py deleted file mode 100644 index 46a27fc694..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/parameters/parameterpanel.py +++ /dev/null @@ -1,233 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'parameterpanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore - -from ert_gui.widgets.helpedwidget import * -from ert_gui.widgets.tablewidgets import AddRemoveWidget -from ert_gui.widgets import util -from ert_gui.widgets.pathchooser import PathChooser -from ert_gui.widgets.combochoice import ComboChoice -import ert_gui.widgets.stringbox -from fieldpanel import * -from parameterdialog import ParameterDialog -from ert_gui.widgets.searchablelist import SearchableList -from datapanel import DataPanel -from keywordpanel import KeywordPanel -import ert_gui.widgets.util -from parametermodels import SummaryModel, FieldModel, DataModel, KeywordModel -from PyQt4.QtCore import SIGNAL - - -class ParameterPanel(HelpedWidget): - """Shows a widget for parameters. The data structure expected and sent to the getter and setter is an array of Parameters.""" - - def __init__(self, parent=None, label="", help=""): - """Construct a ParameterPanel.""" - HelpedWidget.__init__(self, parent, label, help) - - self.searchableList = SearchableList(converter=lambda item : item.getName(), list_width=175) - self.addWidget(self.searchableList) - - - self.pagesWidget = QtGui.QStackedWidget() - - self.emptyPanel = ert_gui.widgets.util.createEmptyPanel() - - self.fieldPanel = FieldPanel(self) - self.dataPanel = DataPanel(self) - self.keywordPanel = KeywordPanel(self) - - self.pagesWidget.addWidget(self.emptyPanel) - self.pagesWidget.addWidget(self.fieldPanel) - self.pagesWidget.addWidget(self.dataPanel) - self.pagesWidget.addWidget(self.keywordPanel) - - self.addWidget(self.pagesWidget) - - self.connect(self.searchableList, QtCore.SIGNAL('currentItemChanged(QListWidgetItem, QListWidgetItem)'), self.changeParameter) - self.connect(self.searchableList, QtCore.SIGNAL('addItem(QListWidgetItem)'), self.addItem) - self.connect(self.searchableList, QtCore.SIGNAL('removeItem(QListWidgetItem)'), self.removeItem) - - #self.addHelpButton() - - - def changeParameter(self, current, previous): - if not current: - self.pagesWidget.setCurrentWidget(self.emptyPanel) - elif FieldModel.TYPE == current.getType(): - self.pagesWidget.setCurrentWidget(self.fieldPanel) - self.fieldPanel.setFieldModel(current.getUserData()) - elif DataModel.TYPE == current.getType(): - self.pagesWidget.setCurrentWidget(self.dataPanel) - self.dataPanel.setDataModel(current.getUserData()) - elif KeywordModel.TYPE == current.getType(): - self.pagesWidget.setCurrentWidget(self.keywordPanel) - self.keywordPanel.setKeywordModel(current.getUserData()) - else: - self.pagesWidget.setCurrentWidget(self.emptyPanel) - - - def createParameter(self, type_name, name): - """Adds a new parameter to the list""" - - if type_name == FieldModel.TYPE.name: - type = FieldModel.TYPE - data = FieldModel(name) - elif type_name == DataModel.TYPE.name: - type = DataModel.TYPE - data = DataModel(name) - elif type_name == KeywordModel.TYPE.name: - type = KeywordModel.TYPE - data = KeywordModel(name) - elif type_name == SummaryModel.TYPE.name: - type = SummaryModel.TYPE - data = SummaryModel(name) - else: - raise AssertionError("Type name unknown: %s" % (type_name)) - - param = Parameter(name, type) - param.setUserData(data) - param.setValid(False) - return param - - - def addToList(self, list, parameter): - list.addItem(parameter) - list.setCurrentItem(parameter) - - user_data = parameter.getUserData() - ##self.connect(user_data, SIGNAL('modelChanged(Model)'), self.modelChanged) - - def modelChanged(self, parameter_model): - """Called whenever the content of a model changes""" - self.updateContent(parameter_model) - - - def addItem(self, list): - """Called by the add button to insert a new parameter. A Parameter object is sent to the ContentModel inserter""" - uniqueNames = [] - for index in range(list.count()): - uniqueNames.append(str(list.item(index).text())) - - pd = ParameterDialog(self, Parameter.get_typeIcons() , uniqueNames) - if pd.exec_(): - parameter = self.createParameter(pd.getTypeName(), pd.getName()) - ok = self.updateContent(parameter, operation=ContentModel.INSERT) - if ok: - self.addToList(list, parameter) - - # todo: emit when a new field is added also make initandcopy listen -> self.modelEmit("casesUpdated()") - - - def removeItem(self, list): - """Called by the remove button to remove a selected parameter. The key is forwarded to the ContentModel remover""" - currentRow = list.currentRow() - - if currentRow >= 0: - doDelete = QtGui.QMessageBox.question(self, "Delete parameter?", "Are you sure you want to delete the parameter?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No) - - if doDelete == QtGui.QMessageBox.Yes: - item = list.item(currentRow) - user_data = item.getUserData() - self.disconnect(user_data, SIGNAL('modelChanged(Model)'), self.modelChanged) - self.updateContent(item.getName(), operation=ContentModel.REMOVE) - list.takeItem(currentRow) - #todo: emit change - - def fetchContent(self): - """Retrieves data from the model and inserts it into the list""" - parameters = self.getFromModel() - - for parameter in parameters: - if parameter is None: - sys.stderr.write("Unknown type name!\n") - break - #raise AssertionError("Unknown type name!") - - param = Parameter(parameter.name, parameter.TYPE) - param.setUserData(parameter) - param.setValid(parameter.isValid()) - - self.addToList(self.searchableList.getList(), param) - - if self.searchableList.getList().count > 0: - self.searchableList.getList().setCurrentRow(0) - - - -class Parameter(QtGui.QListWidgetItem): - """ListWidgetItem class that represents a Parameter with an associated icon.""" - - typeIcons__ = None - - @classmethod - def get_typeIcons(cls): - if cls.typeIcons__ is None: - typeIcons__ = {FieldModel.TYPE: util.resourceIcon("grid_16"), - DataModel.TYPE: util.resourceIcon("data"), - SummaryModel.TYPE: util.resourceIcon("summary"), - KeywordModel.TYPE: util.resourceIcon("key")} - return typeIcons__ - - - - def __init__(self, name, type, icon=None): - if icon is None: - icon = Parameter.get_typeIcons()[type] - - QtGui.QListWidgetItem.__init__(self, icon, name) - self.type = type - self.name = name - self.user_data = None - self.setValid(True) - - def getType(self): - """Retruns the type of this parameter""" - return self.type - - def getName(self): - """Returns the name of this parameter (keyword)""" - return self.name - - def __ge__(self, other): - if self.type.name == other.type.name: - return self.name.lower() >= other.name.lower() - else: - return self.type.name >= other.type.name - - def __lt__(self, other): - return not self >= other - - def setUserData(self, data): - """Set user data for this parameter.""" - self.user_data = data - - def getUserData(self): - """Retrieve the user data.""" - return self.user_data - - def setValid(self, valid): - """Set the validity of this item. An invalid item is colored red""" - self.valid = valid - - if valid: - self.setBackgroundColor(QtCore.Qt.white) - else: - self.setBackgroundColor(HelpedWidget.STRONG_ERROR_COLOR) - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/plot.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/plot.py deleted file mode 100644 index aa670fd133..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/plot.py +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'plot.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -# ---------------------------------------------------------------------------------------------- -# Plot tab -# ---------------------------------------------------------------------------------------------- -from ert_gui.widgets.pathchooser import PathChooser -from ert_gui.widgets.combochoice import ComboChoice -from ert_gui.widgets.spinnerwidgets import IntegerSpinner - - -def createPlotPage(configPanel, parent): - configPanel.startPage("Plot") - - r = configPanel.addRow(PathChooser(parent, "Output path", "config/plot/path")) - r.initialize = lambda ert : ert.main.plot_config.get_path - r.getter = lambda ert : ert.main.plot_config.get_path - r.setter = lambda ert, value : ert.main.plot_config.set_path( str(value)) - - r = configPanel.addRow(ComboChoice(parent, ["PLPLOT", "TEXT"], "Driver", "config/plot/plot_driver")) - r.initialize = lambda ert : ert.main.plot_config.get_driver - r.getter = lambda ert : ert.main.plot_config.get_driver - r.setter = lambda ert, value : ert.main.plot_config.set_driver( str(value)) - - r = configPanel.addRow(IntegerSpinner(parent, "Errorbar max", "config/plot/plot_errorbar_max", 1, 10000000)) - r.initialize = lambda ert : ert.main.plot_config.get_errorbar_max - r.getter = lambda ert : ert.main.plot_config.get_errorbar_max - r.setter = lambda ert, value : ert.main.plot_config.set_errorbar_max( value) - - r = configPanel.addRow(IntegerSpinner(parent, "Width", "config/plot/width", 1, 10000)) - r.initialize = lambda ert : ert.main.plot_config.get_width - r.getter = lambda ert : ert.main.plot_config.get_width - r.setter = lambda ert, value : ert.main.plot_config.set_width( value) - - r = configPanel.addRow(IntegerSpinner(parent, "Height", "config/plot/plot_height", 1, 10000)) - r.initialize = lambda ert : ert.main.plot_config.get_height - r.getter = lambda ert : ert.main.plot_config.get_height - r.setter = lambda ert, value : ert.main.plot_config.set_height( value) - - r = configPanel.addRow(PathChooser(parent, "Image Viewer", "config/plot/image_viewer", True)) - r.initialize = lambda ert : ert.main.plot_config.get_viewer - r.getter = lambda ert : ert.main.plot_config.get_viewer - r.setter = lambda ert, value : ert.main.plot_config.set_viewer( str(value)) - - r = configPanel.addRow(ComboChoice(parent, ["bmp", "jpg", "png", "tif"], "Image type", "config/plot/image_type")) - r.initialize = lambda ert : ert.main.plot_config.get_image_type - r.getter = lambda ert : ert.main.plot_config.get_image_type - r.setter = lambda ert, value : ert.main.plot_config.set_image_type( str(value)) - - - configPanel.endPage() diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/queuesystem.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/queuesystem.py deleted file mode 100644 index f890b6a1db..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/queuesystem.py +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'queuesystem.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -# ---------------------------------------------------------------------------------------------- -# Queue System tab -# ---------------------------------------------------------------------------------------------- -from ert_gui.widgets.configpanel import ConfigPanel -from ert_gui.widgets.combochoice import ComboChoice -from ert_gui.widgets.stringbox import StringBox -from ert_gui.widgets.pathchooser import PathChooser -from ert_gui.widgets.spinnerwidgets import IntegerSpinner -from ert_gui.widgets.tablewidgets import KeywordTable - -def createQueueSystemPage(configPanel, parent): - configPanel.startPage("Queue System") - - r = configPanel.addRow(ComboChoice(parent, ["LSF", "RSH", "LOCAL"], "Queue system", "config/queue_system/queue_system")) - r.initialize = lambda ert : ert.main.site_config.get_queue_name - r.getter = lambda ert : ert.main.site_config.get_queue_name - r.setter = lambda ert, value : ert.main.site_config.set_job_queue(str(value)) - - internalPanel = ConfigPanel(parent) - - internalPanel.startPage("LSF") - - r = internalPanel.addRow(StringBox(parent, "LSF Queue", "config/queue_system/lsf_queue")) - r.initialize = lambda ert : ert.main.site_config.get_lsf_queue - r.getter = lambda ert : ert.main.site_config.get_lsf_queue - r.setter = lambda ert, value : ert.main.site_config.set_lsf_queue( str(value)) - - r = internalPanel.addRow(IntegerSpinner(parent, "Max running", "config/queue_system/max_running_lsf", 1, 1000)) - r.initialize = lambda ert : ert.main.site_config.get_max_running_lsf - r.getter = lambda ert : ert.main.site_config.get_max_running_lsf - r.setter = lambda ert, value : ert.main.site_config.set_max_running_lsf( value) - - r = internalPanel.addRow(StringBox(parent, "Resources", "config/queue_system/lsf_resources")) - r.initialize = lambda ert : ert.main.site_config.get_lsf_request - r.getter = lambda ert : ert.main.site_config.get_lsf_request - r.setter = lambda ert, value : ert.main.site_config.set_lsf_request(str(value)) - - internalPanel.endPage() - - - internalPanel.startPage("RSH") - - r = internalPanel.addRow(PathChooser(parent, "Command", "config/queue_system/rsh_command", show_files=True, must_exist=True, is_executable_file=True)) - r.initialize = lambda ert : ert.main.site_config.get_rsh_command - r.getter = lambda ert : ert.main.site_config.get_rsh_command - r.setter = lambda ert, value : ert.main.site_config.set_rsh_command(str(value)) - - r = internalPanel.addRow(IntegerSpinner(parent, "Max running", "config/queue_system/max_running_rsh", 1, 1000)) - r.initialize = lambda ert : ert.main.site_config.get_max_running_rsh - r.getter = lambda ert : ert.main.site_config.get_max_running_rsh - r.setter = lambda ert, value : ert.main.site_config.set_max_running_rsh( value) - - - r = internalPanel.addRow(KeywordTable(parent, "Host List", "config/queue_system/rsh_host_list", "Host", "Number of jobs")) - r.initialize = lambda ert : ert.getHash(ert.main.site_config.get_rsh_host_list, True) - r.getter = lambda ert : ert.getHash(ert.main.site_config.get_rsh_host_list, True) - - def add_rsh_host(ert, listOfKeywords): - ert.main.site_config.clear_rsh_host_list - - for keyword in listOfKeywords: - if keyword[1].strip() == "": - max_running = 1 - else: - max_running = int(keyword[1]) - - ert.main.site_config.add_rsh_host( keyword[0], max_running) - - r.setter = add_rsh_host - - - internalPanel.endPage() - - internalPanel.startPage("LOCAL") - - r = internalPanel.addRow(IntegerSpinner(parent, "Max running", "config/queue_system/max_running_local", 1, 1000)) - r.initialize = lambda ert : ert.main.site_config.get_max_running_local - r.getter = lambda ert : ert.main.site_config.get_max_running_local - r.setter = lambda ert, value : ert.main.site_config.set_max_running_local(value) - - internalPanel.endPage() - configPanel.addRow(internalPanel) - - configPanel.endPage() diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulation.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulation.py deleted file mode 100644 index d833e20cb1..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulation.py +++ /dev/null @@ -1,204 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'simulation.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -# ---------------------------------------------------------------------------------------------- -# Simulations tab -# ---------------------------------------------------------------------------------------------- -from PyQt4 import QtCore -from ert_gui.widgets.spinnerwidgets import IntegerSpinner -from ert_gui.widgets.tablewidgets import KeywordTable -from ert_gui.widgets.pathchooser import PathChooser -from ert_gui.widgets.checkbox import CheckBox -from ert_gui.widgets.configpanel import ConfigPanel -from ert_gui.widgets.stringbox import StringBox -from jobs.forwardmodelpanel import ForwardModelPanel -from simulations.runpathpanel import RunpathMemberList, RunpathMemberPanel -from ert.ert.enums import keep_runpath_type -from simulations.runtemplatepanel import RunTemplatePanel -import ert_gui.widgets.helpedwidget -import os -from ert.util.stringlist import StringList - -def createSimulationsPage(configPanel, parent): - configPanel.startPage("Simulations") - - - r = configPanel.addRow(IntegerSpinner(parent, "Max submit", "config/simulation/max_submit", 1, 10000)) - r.initialize = lambda ert : ert.main.site_config.get_max_submit - r.getter = lambda ert : ert.main.site_config.get_max_submit - r.setter = lambda ert, value : ert.main.site_config.set_max_submit( value) - - r = configPanel.addRow(IntegerSpinner(parent, "Max internal submit", "config/simulation/max_resample", 1, 10000)) - r.initialize = lambda ert : ert.main.model_config.get_max_internal_submit - r.getter = lambda ert : ert.main.model_config.get_max_internal_submit - r.setter = lambda ert, value : ert.main.model_config.set_max_internal_submit( value) - - - - r = configPanel.addRow(ForwardModelPanel(parent)) - - - def get_forward_model(ert): - site_config = ert.main.site_config - installed_jobs = ert.main.site_config.get_installed_jobs - available_jobs = installed_jobs.alloc_list - - result = {'available_jobs': available_jobs} - - model_config = ert.main.model_config - forward_model = model_config.get_forward_model - job_names = forward_model.alloc_joblist - - forward_model_jobs = [] - - count = 0 - for name in job_names: - ext_job = forward_model.iget_job( count) - arg_string = ext_job.get_private_args_as_string - help_text = ext_job.get_help_text - forward_model_jobs.append((name, arg_string, help_text)) - count+=1 - - result['forward_model'] = forward_model_jobs - - return result - - r.getter = get_forward_model - r.initialize = get_forward_model - - def update_forward_model(ert, forward_model): - forward_model_object = ert.main.model_config.get_forward_model - forward_model_object.clear - - for job in forward_model: - name = job[0] - args = job[1] - ext_job = forward_model.add_job( name) - ext_job.set_private_args_from_string( args) - - r.setter = update_forward_model - - - - r = configPanel.addRow(PathChooser(parent, "Case table", "config/simulation/case_table")) - - - def get_case_table(ert): - return ert.main.model_config.get_case_table_file - r.getter = get_case_table - r.initialize = get_case_table - - def set_case_table(ert, value): - if os.path.exists(value): - ert.main.set_case_table( ert.nonify(value)) - r.setter = set_case_table - - - r = configPanel.addRow(PathChooser(parent, "License path", "config/simulation/license_path")) - r.getter = lambda ert : ert.main.site_config.get_license_root_path - r.initialize = lambda ert : ert.main.site_config.get_license_root_path - - def ls(string): - if string is None: - return "" - else: - return string - - r.setter = lambda ert, value : ert.main.site_config.set_license_root_path( ls(value)) - - - - internalPanel = ConfigPanel(parent) - - internalPanel.startPage("Runpath") - - r = internalPanel.addRow(PathChooser(parent, "Runpath", "config/simulation/runpath", path_format=True)) - - r.getter = lambda ert : ert.main.model_config.get_runpath_as_char - r.initialize = lambda ert : ert.main.model_config.get_runpath_as_char - r.setter = lambda ert, value : ert.main.model_config.select_runpath( str(value)) - parent.connect(r, QtCore.SIGNAL("contentsChanged()"), lambda : r.modelEmit("runpathChanged()")) - - - r = internalPanel.addRow(CheckBox(parent, "Pre clear", "config/simulation/pre_clear_runpath", "Perform pre clear")) - - r.getter = lambda ert : ert.main.get_pre_clear_runpath - r.initialize = lambda ert : ert.main.get_pre_clear_runpath - r.setter = lambda ert, value : ert.main.set_pre_clear_runpath( value) - - - r = internalPanel.addRow(RunpathMemberPanel(widgetLabel="Retain runpath", helpLabel="config/simulation/runpath_retain")) - def get_runpath_retain_state(ert): - ensemble_size = ert.main.ens_size - - result = [] - for index in range(ensemble_size): - state = ert.main.iget_keep_runpath( index) - result.append((index, keep_runpath_type.resolveValue(state))) - - return result - - r.getter = get_runpath_retain_state - r.initialize = get_runpath_retain_state - - def set_runpath_retain_state(ert, items): - for item in items: - ert.main.iset_keep_runpath(item.member, item.runpath_state.value()) - - r.setter = set_runpath_retain_state - - - internalPanel.endPage() - - internalPanel.startPage("Run Template") - - r = internalPanel.addRow(RunTemplatePanel(parent)) - - def get_run_templates(ert): - templates = ert.main.get_templates - template_names = templates.alloc_list - - result = [] - for name in template_names: - template = templates.get_template(name) - template_file = template.get_template_file - target_file = template.get_target_file - arguments = template.get_args_as_string - result.append((name, template_file, target_file, arguments)) - return result - - r.getter = get_run_templates - r.initialize = get_run_templates - - def set_run_templates(ert, template_list): - templates_object = ert.main.get_templates - templates_object.clear - - for template in template_list: - templates_object.add_template( template[0], template[1], template[2], template[3]) - - r.setter = set_run_templates - -# r = internalPanel.addRow(MultiColumnTable(parent, "", "run_template", ["Template", "Target file", "Arguments"])) -# r.getter = lambda ert : ert.getAttribute("run_template") -# r.setter = lambda ert, value : ert.setAttribute("run_template", value) - - internalPanel.endPage() - configPanel.addRow(internalPanel) - - - configPanel.endPage() diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulations/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulations/CMakeLists.txt deleted file mode 100644 index 56a1241e5e..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulations/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_python_package( "Python ert_gui.pages.config.simulations" ${PYTHON_INSTALL_PREFIX}/ert_gui/pages/config/simulations "__init__.py;runpathpanel.py;runtemplatepanel.py" True) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulations/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulations/__init__.py deleted file mode 100644 index 79c95cf38a..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulations/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulations/runpathpanel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulations/runpathpanel.py deleted file mode 100644 index 63b8a99a16..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulations/runpathpanel.py +++ /dev/null @@ -1,175 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'runpathpanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -from ert.ert.enums import keep_runpath_type -from ert_gui.widgets.helpedwidget import HelpedWidget -from ert_gui.pages.run.legend import Legend - -class RunpathMemberList(QtGui.QListWidget): - """A list widget with custom items representing members""" - def __init__(self): - QtGui.QListWidget.__init__(self) - - self.setViewMode(QtGui.QListView.IconMode) - self.setMovement(QtGui.QListView.Static) - self.setResizeMode(QtGui.QListView.Adjust) - - self.setItemDelegate(RunpathMemberItemDelegate()) - self.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) - self.setSelectionRectVisible(False) - - self.setSortingEnabled(True) - self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) - - -class RunpathMemberItem(QtGui.QListWidgetItem): - """Items for the custom SimulationList""" - def __init__(self, member, runpath_state): - self.runpath_state = runpath_state - self.member = member - QtGui.QListWidgetItem.__init__(self) - self.setData(QtCore.Qt.DisplayRole, (member, runpath_state)) - - def __ge__(self, other): - return self.member >= other.member - - def __lt__(self, other): - return not self >= other - - def setState(self, state): - self.runpath_state = state - self.setData(QtCore.Qt.DisplayRole, (self.member, self.runpath_state)) - - -class RunpathMemberItemDelegate(QtGui.QStyledItemDelegate): - """The delegate that renders the custom RunpathMemberItems""" - - default = QtGui.QColor(255, 255, 240) - delete = QtGui.QColor(255, 200, 200) - keep = QtGui.QColor(200, 255, 200) - unknown = QtGui.QColor(255, 200, 64) - - size = QtCore.QSize(32, 18) - - def __init__(self): - QtGui.QStyledItemDelegate.__init__(self) - - def paint(self, painter, option, index): - """Renders the item""" - painter.save() - painter.setRenderHint(QtGui.QPainter.Antialiasing) - - data = index.data(QtCore.Qt.DisplayRole) - - if data is None: - data = (0, keep_runpath_type.DEFAULT_KEEP) - else: - data = data.toPyObject() - - if data[1] == keep_runpath_type.DEFAULT_KEEP: - color = self.default - elif data[1] == keep_runpath_type.EXPLICIT_KEEP: - color = self.keep - elif data[1] == keep_runpath_type.EXPLICIT_DELETE: - color = self.delete - else: - color = self.unknown - - painter.setPen(color) - rect = QtCore.QRect(option.rect) - rect.setX(rect.x() + 1) - rect.setY(rect.y() + 1) - rect.setWidth(rect.width() - 2) - rect.setHeight(rect.height() - 2) - painter.fillRect(rect, color) - - painter.setPen(QtCore.Qt.black) - - painter.setRenderHint(QtGui.QPainter.Antialiasing, False) - painter.drawRect(rect) - - if option.state & QtGui.QStyle.State_Selected: - painter.fillRect(option.rect, QtGui.QColor(255, 255, 255, 150)) - - painter.drawText(rect, QtCore.Qt.AlignCenter + QtCore.Qt.AlignVCenter, str(data[0])) - - painter.restore() - - def sizeHint(self, option, index): - """Returns the size of the item""" - return self.size - - -class RunpathMemberPanel(HelpedWidget): - """A dialog that shows the progress of a simulation""" - def __init__(self, parent=None, widgetLabel="", helpLabel=""): - HelpedWidget.__init__(self, widgetLabel=widgetLabel, helpLabel=helpLabel) - - layout = QtGui.QVBoxLayout() - self.runpath_member_list = RunpathMemberList() - self.runpath_member_list.contextMenuEvent = self._contextMenu - layout.addWidget(self.runpath_member_list) - #self.addWidget(self.runpath_member_list) - #self.connect(self.runpath_member_list, QtCore.SIGNAL('itemSelectionChanged()'), self.ctrl.selectSimulation) - - legendLayout = QtGui.QHBoxLayout() - legendLayout.addLayout(Legend("Default", RunpathMemberItemDelegate.default)) - legendLayout.addLayout(Legend("Keep", RunpathMemberItemDelegate.keep)) - legendLayout.addLayout(Legend("Delete", RunpathMemberItemDelegate.delete)) - layout.addLayout(legendLayout) - self.addLayout(layout) - - self.addHelpButton() - - - def _createAction(self, name, func, parent=None): - """Create an action for the right click menu""" - action = QtGui.QAction(name, parent) - action.connect(action, QtCore.SIGNAL("triggered()"), func) - return action - - def _contextMenu(self, event): - """Create a right click menu for the simulation view.""" - menu = QtGui.QMenu(self.runpath_member_list) - selectAll = self._createAction("Select all", self.runpath_member_list.selectAll) - unselectAll = self._createAction("Unselect all", self.runpath_member_list.clearSelection) - defaultSelected = self._createAction("Default", lambda : self.setState(keep_runpath_type.DEFAULT_KEEP)) - keepSelected = self._createAction("Keep", lambda : self.setState(keep_runpath_type.EXPLICIT_KEEP)) - deleteSelected = self._createAction("Delete", lambda : self.setState(keep_runpath_type.EXPLICIT_DELETE)) - - menu.addAction(defaultSelected) - menu.addAction(keepSelected) - menu.addAction(deleteSelected) - menu.addSeparator() - menu.addAction(selectAll) - menu.addAction(unselectAll) - menu.exec_(event.globalPos()) - - def fetchContent(self): - data = self.getFromModel() - self.runpath_member_list.clear() - - for item in data: - self.runpath_member_list.addItem(RunpathMemberItem(item[0], item[1])) - - def setState(self, state): - items = self.runpath_member_list.selectedItems() - for item in items: - item.setState(state) - - self.updateContent(items) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulations/runtemplatepanel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulations/runtemplatepanel.py deleted file mode 100644 index 98b263b37d..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/simulations/runtemplatepanel.py +++ /dev/null @@ -1,213 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'runtemplatepanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from ert_gui.widgets.helpedwidget import HelpedWidget -from ert_gui.widgets.searchablelist import SearchableList -from PyQt4 import QtGui, QtCore -from ert_gui.widgets.pathchooser import PathChooser -from ert_gui.widgets.validateddialog import ValidatedDialog -import ert_gui.widgets.util -import os -from ert_gui.widgets.util import ValidationInfo -from ert_gui.pages.config.jobs.jobsdialog import EditJobDialog -from ert_gui.widgets.stringbox import StringBox -from ert_gui.widgets.helpedwidget import ContentModel - -class RunTemplatePanel(HelpedWidget): - """ - Widget for adding, removing and editing run templates. - """ - - def __init__(self, parent=None): - HelpedWidget.__init__(self, parent, "", "config/simulation/run_template") - - self.run_template = RunTemplate("undefined", "", "", "") - - self.createWidgets(parent) - - self.emptyPanel = ert_gui.widgets.util.createEmptyPanel() - - self.pagesWidget = QtGui.QStackedWidget() - self.pagesWidget.addWidget(self.emptyPanel) - self.pagesWidget.addWidget(self.run_template_panel) - self.addWidget(self.pagesWidget) - - self.addHelpButton() - - def createWidgets(self, parent): - self.searchableList = SearchableList(parent, list_height=150, list_width=150, ignore_case=True) - self.addWidget(self.searchableList) - self.connect(self.searchableList, QtCore.SIGNAL('currentItemChanged(QListWidgetItem, QListWidgetItem)'), - self.changeParameter) - self.connect(self.searchableList, QtCore.SIGNAL('addItem(QListWidgetItem)'), self.addItem) - self.connect(self.searchableList, QtCore.SIGNAL('removeItem(QListWidgetItem)'), self.removeItem) - - - self.run_template_panel = ert_gui.widgets.util.createEmptyPanel() - - layout = QtGui.QFormLayout() - layout.setLabelAlignment(QtCore.Qt.AlignRight) - - self.run_template_file = PathChooser(self, "", "config/simulation/run_template_file", show_files=True) - self.run_template_file.initialize = ContentModel.emptyInitializer - self.run_template_file.setter = self.setTemplateFile - self.run_template_file.getter = lambda model: self.run_template.template_file - - self.run_template_target = PathChooser(self, "", "config/simulation/run_template_target", show_files=True) - self.run_template_target.initialize = ContentModel.emptyInitializer - self.run_template_target.setter = self.setTargetFile - self.run_template_target.getter = lambda model: self.run_template.target_file - - self.run_template_args = StringBox(self, "", "config/simulation/run_template_arguments") - self.run_template_args.initialize = ContentModel.emptyInitializer - self.run_template_args.setter = self.setArguments - self.run_template_args.getter = lambda model: self.run_template.arguments - - layout.addRow("Template file:", self.run_template_file) - layout.addRow("Target file:", self.run_template_target) - layout.addRow("Arguments:", self.run_template_args) - - layout.addRow(ert_gui.widgets.util.createSpace(20)) - - self.run_template_panel.setLayout(layout) - - def setArguments(self, model, arguments): - self.run_template.setArguments(arguments) - self.runTemplateChanged() - - def setTemplateFile(self, model, template_file): - self.run_template.setTemplateFile(template_file) - self.runTemplateChanged() - - def setTargetFile(self, model, target_file): - self.run_template.setTargetFile(target_file) - self.runTemplateChanged() - - - def fetchContent(self): - """ - Retrieves data from the model and inserts it into the widget. - List of tuples: (name, template_file, target_file, arguments) - """ - data = self.getFromModel() - - self.searchableList.list.clear() - for item in data: - jobitem = QtGui.QListWidgetItem() - jobitem.setText(item[0]) - run_template = RunTemplate(item[0], item[1], item[2], item[3]) - - jobitem.setData(QtCore.Qt.UserRole, run_template) - jobitem.setToolTip(item[0]) - self.searchableList.list.addItem(jobitem) - - def setRunTemplate(self, run_template): - """Set the current visible run template""" - self.run_template = run_template - self.run_template_args.fetchContent() - self.run_template_file.fetchContent() - self.run_template_target.fetchContent() - - def changeParameter(self, current, previous): - """Switch between run templates. Selection from the list""" - if current is None: - self.pagesWidget.setCurrentWidget(self.emptyPanel) - else: - self.pagesWidget.setCurrentWidget(self.run_template_panel) - self.setRunTemplate(current.data(QtCore.Qt.UserRole).toPyObject()) - - def runTemplateChanged(self): - """ - Called whenever the run template is changed. (adding, removing) - The data submitted to the updateContent() (from ContentModel) is a list of tuples (name, template_file, target_file, arguments) - """ - items = self.searchableList.getItems() - currentRow = self.searchableList.list.currentRow() - run_templates = [] - for item in items: - r_t = item.data(QtCore.Qt.UserRole).toPyObject() - run_template_tuple = (r_t.name, r_t.template_file, r_t.target_file, r_t.arguments) - run_templates.append(run_template_tuple) - - self.updateContent(run_templates) - self.fetchContent() - self.searchableList.list.setCurrentRow(currentRow) - - def addToList(self, list, name): - """Adds a new run template to the list""" - param = QtGui.QListWidgetItem() - param.setText(name) - - new_job = RunTemplate(name) - param.setData(QtCore.Qt.UserRole, new_job) - - list.addItem(param) - list.setCurrentItem(param) - return param - - def addItem(self, list): - """Called by the add button to insert a new run template""" - uniqueNames = [] - for index in range(list.count()): - uniqueNames.append(str(list.item(index).text())) - - pd = ValidatedDialog(self, "New run template", "Enter name of new run template:", uniqueNames) - if pd.exec_(): - self.addToList(list, pd.getName()) - self.runTemplateChanged() - - def removeItem(self, list): - """Called by the remove button to remove a selected job""" - currentRow = list.currentRow() - - if currentRow >= 0: - title = "Delete run template?" - msg = "Are you sure you want to delete the run template?" - btns = QtGui.QMessageBox.Yes | QtGui.QMessageBox.No - doDelete = QtGui.QMessageBox.question(self, title, msg, btns) - - if doDelete == QtGui.QMessageBox.Yes: - list.takeItem(currentRow) - self.runTemplateChanged() - -class RunTemplate: - """Stores the name, arguments and help text of a run template.""" - - def __init__(self, name, template_file="", target_file="", arguments=""): - self.name = name - self.setArguments(arguments) - self.setTargetFile(target_file) - self.setTemplateFile(template_file) - - def setArguments(self, args): - if args is None: - args = "" - self.arguments = args - - def setTemplateFile(self, template_file): - if template_file is None: - template_file = "" - self.template_file = template_file - - def setTargetFile(self, target_file): - if target_file is None: - target_file = "" - self.target_file = target_file - - - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/systemenv.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/systemenv.py deleted file mode 100644 index e4ee7873f5..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/config/systemenv.py +++ /dev/null @@ -1,176 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'systemenv.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -#---------------------------------------------------------------------------------------------- -# System tab -# ---------------------------------------------------------------------------------------------- -from ert_gui.widgets.pathchooser import PathChooser -from ert_gui.widgets.configpanel import ConfigPanel -from ert_gui.widgets.tablewidgets import KeywordTable, KeywordList -from PyQt4 import QtGui, QtCore -from jobs.jobspanel import JobsPanel, Job -import os -import ert_gui.widgets.spinnerwidgets -from ert_gui.widgets.activelabel import ActiveLabel -from ert.job_queue.ext_job import ExtJob - -def createSystemPage(configPanel, parent): - configPanel.startPage("System") - - # Should call enkf_main_get_site_config_file() to get the name of - # the site configuration file; this should only be a label - not - # user editable. - r = configPanel.addRow(ActiveLabel(None, "Site Config", "", "Not specified.")) - r.initialize = lambda ert : ert.main.get_site_config_file - r.getter = lambda ert : ert.main.get_site_config_file - r.modelConnect("casesUpdated()", r.fetchContent) - - - - r = configPanel.addRow(PathChooser(parent, "Job script", "config/systemenv/job_script", True)) - r.initialize = lambda ert : ert.main.site_config.get_job_script - r.getter = lambda ert : ert.main.site_config.get_job_script - r.setter = lambda ert, value : ert.main.site_config.set_job_script( str(value)) - - internalPanel = ConfigPanel(parent) - internalPanel.startPage("setenv") - - r = internalPanel.addRow(KeywordTable(parent, "", "config/systemenv/setenv")) - r.initialize = lambda ert : ert.getHash(ert.main.site_config.get_env_hash) - r.getter = lambda ert : ert.getHash(ert.main.site_config.get_env_hash) - - def setenv(ert, value): - ert.main.site_config.clear_env - for env in value: - ert.main.site_config.setenv( env[0], env[1]) - - r.setter = setenv - - internalPanel.endPage() - - internalPanel.startPage("Update path") - - r = internalPanel.addRow(KeywordTable(parent, "", "config/systemenv/update_path")) - - def get_update_path(ert): - paths = ert.main.site_config.get_path_variables - values = ert.main.site_config.get_path_values - - return [[p, v] for p, v in zip(paths, values)] - - r.getter = get_update_path - r.initialize = get_update_path - - def update_pathvar(ert, value): - ert.main.site_config.clear_pathvar - - for pathvar in value: - ert.main.site_config.update_pathvar( pathvar[0], pathvar[1]) - - r.setter = update_pathvar - - internalPanel.endPage() - - - internalPanel.startPage("Jobs") - - r = internalPanel.addRow(JobsPanel(parent)) - - def get_jobs(ert): - jl = ert.main.site_config.get_installed_jobs - h = jl.get_jobs - stringlist = jl.alloc_list - jobs = ert.getHash(h, return_type="c_void_p") - - private_jobs = [] - for v in stringlist: - job = jl.get_job(v) - path = job.get_config_file - if job.is_private: - private_jobs.append(Job(v, path)) - #for k, v in jobs: - # job = jl.get_job(v) - # path = job.get_config_file - # if v.is_private: - # private_jobs.append(Job(k, path)) - - return private_jobs - - def update_job(ert, value): - jl = ert.main.site_config.get_installed_jobs - - if os.path.exists(value.path): - license = ert.main.site_config.get_license_root_path - job = ert.job_queue.ext_job_fscanf_alloc(value.name, license, True, value.path) - jl.add_job(value.name, job) - else: - job = jl.get_job(value.name) - job.set_config_file(value.path) - - - def add_job(ert, value): - jl = ert.main.site_config.get_installed_jobs - if not jl.has_job(value.name): - license = ert.main.site_config.get_license_root_path - if os.path.exists(value.path): - job = ert.job_queue.ext_job_fscanf_alloc(value.name, license, True, value.path) - jl.add_job(value.name, job) - else: - job = ert.job_queue.ext_job_alloc(value.name, license, True) - job.set_config_file(value.path) - jl.add_job(value.name, job) - return True - - return False - - def remove_job(ert, value): - jl = ert.main.site_config.get_installed_jobs - success = jl.del_job(value.name) - - if not success: - QtGui.QMessageBox.question(parent, "Failed", "Unable to delete job!", QtGui.QMessageBox.Ok) - return False - return True - - - r.getter = get_jobs - r.initialize = get_jobs - r.setter = update_job - r.insert = add_job - r.remove = remove_job - - - - internalPanel.endPage() - configPanel.addRow(internalPanel) - - r = configPanel.addRow(PathChooser(parent, "Log file", "config/systemenv/log_file", True)) - r.initialize = lambda ert: ert.main.logh.get_filename - r.getter = lambda ert : ert.main.logh.get_filename - r.setter = lambda ert, value : ert.main.logh.reopen(value) - - r = configPanel.addRow(ert_gui.widgets.spinnerwidgets.IntegerSpinner(parent, "Log level", "config/systemenv/log_level", 0, 1000)) - r.initialize = lambda ert : ert.main.logh.get_level - r.getter = lambda ert : ert.main.logh.get_level - r.setter = lambda ert, value : ert.main.logh.set_level( value) - - configPanel.endPage() - - - - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/configuration_panel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/configuration_panel.py new file mode 100644 index 0000000000..128e182aa0 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/pages/configuration_panel.py @@ -0,0 +1,29 @@ +from ert_gui.models.connectors.init import CaseSelectorModel +from ert_gui.models.connectors.queue_system.queue_system_selector import QueueSystemSelector +from ert_gui.pages.case_init_configuration import CaseInitializationConfigurationPanel +from ert_gui.pages.queue_system_configuration import QueueSystemConfigurationPanel +from ert_gui.widgets.combo_choice import ComboChoice +from ert_gui.widgets.row_panel import RowPanel + + + +class ConfigurationPanel(RowPanel): + + def __init__(self): + RowPanel.__init__(self, "Configuration") + + self.addLabeledSeparator("Case initialization") + case_combo = ComboChoice(CaseSelectorModel(), "Current case", "init/current_case_selection") + case_configurator = CaseInitializationConfigurationPanel() + self.addRow(case_combo, case_configurator) + + self.addLabeledSeparator("Queue System") + + queue_system_selector = QueueSystemSelector() + queue_system_combo = ComboChoice(queue_system_selector, "Queue system", "config/queue_system/queue_system") + queue_system_configurator = QueueSystemConfigurationPanel() + self.addRow(queue_system_combo, queue_system_configurator) + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/init/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/pages/init/CMakeLists.txt deleted file mode 100644 index f1b0339f60..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/init/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_python_package( "Python ert_gui.pages.init" ${PYTHON_INSTALL_PREFIX}/ert_gui/pages/init "__init__.py;initandcopy.py;initpanel.py" True) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/init/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/init/__init__.py deleted file mode 100644 index 79c95cf38a..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/init/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/init/initandcopy.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/init/initandcopy.py deleted file mode 100644 index 6573307996..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/init/initandcopy.py +++ /dev/null @@ -1,377 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'initandcopy.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from ert_gui.widgets.helpedwidget import HelpedWidget -from PyQt4 import QtGui, QtCore -from ert_gui.widgets.util import resourceIcon, ListCheckPanel, ValidatedTimestepCombo, getItemsFromList -from ert.ert.enums import ert_state_enum -from ert.util.stringlist import StringList -from ctypes import * -from ert.util.tvector import BoolVector - -class ParametersAndMembers(HelpedWidget): - - listOfParameters = [] - listOfDynamicParameters = [] - maxTimeStep = 11 - - - def __init__(self, parent = None): - HelpedWidget.__init__(self, parent) - - radioLayout = self.createRadioButtons() - listLayout = self.createParameterMemberPanel() - stLayout = self.createSourceTargetLayout() - actionLayout = self.createActionButton() - - layout = QtGui.QVBoxLayout() - layout.addLayout(radioLayout) - layout.addSpacing(5) - layout.addLayout(listLayout) - layout.addSpacing(5) - layout.addLayout(stLayout) - layout.addSpacing(5) - layout.addLayout(actionLayout) - - self.addLayout(layout) - - self.initialized = False - self.modelConnect("casesUpdated()", self.fetchContent) - self.modelConnect("ensembleResized()", self.fetchContent) - self.modelConnect("ensembleUpdated()", self.fetchContent) - - self.toggleScratch.toggle() - - - def toggleCompleteEnsembleState(self, checkState): - self.parametersList.setSelectionEnabled(not checkState) - - if checkState: - self.parametersList.selectAll() - - - def toggleActionState(self, action="Initialize", showCopyParameters = False, selectSource = False, selectTarget = False): - self.sourceLabel.setEnabled(selectSource) - self.sourceCase.setEnabled(selectSource) - self.sourceType.setEnabled(selectSource) - self.sourceReportStep.setEnabled(selectSource) - self.sourceCompleteEnsembleCheck.setEnabled(showCopyParameters) - - if not selectSource: - self.sourceReportStep.setCurrentIndex(0) - - self.targetLabel.setEnabled(selectTarget) - self.targetCaseLabel.setEnabled(selectTarget) - self.targetType.setEnabled(selectTarget) - self.targetReportStep.setEnabled(selectTarget) - - - if not selectTarget: - self.targetReportStep.setCurrentIndex(0) - - self.actionButton.setText(action) - - - self.parametersList.clear() - self.parametersList.addItems(self.listOfParameters) - - self.parametersList.setEnabled(True) - self.parametersList.checkAll.setEnabled(True) - self.parametersList.uncheckAll.setEnabled(True) - - - if showCopyParameters: - self.parametersList.addItems(self.listOfDynamicParameters) - self.toggleCompleteEnsembleState(self.sourceCompleteEnsembleCheck.isChecked()) - - self.parametersList.selectAll() - self.membersList.selectAll() - - - def initializeCaseFromScratch(self, parameters, members): - ert = self.getModel() - - stringlist = StringList(parameters) - - for member in members: - m = int(member.strip()) - ert.main.initialize_from_scratch(stringlist, m , m) - - stringlist.__del__ - - - def initializeCaseFromCase(self, selected_parameters, selected_members): - ert = self.getModel() - - selected_parameters = [str(parameter) for parameter in selected_parameters] - selected_members = [int(member.strip()) for member in selected_members] - - source_case = str(self.sourceCase.currentText()) - source_report_step = self.sourceReportStep.getSelectedValue() - source_state = ert_state_enum.resolveName(str(self.sourceType.currentText())).value() - member_mask = BoolVector.active_mask(str(selected_members).strip('[]')) - ranking_key = None - node_list = StringList(selected_parameters) - - ert.main.initialize_from_existing__( source_case, - source_report_step, - source_state, - member_mask, - ranking_key, - node_list) - - node_list.__del__ - - def copyEnsemble(self, selected_parameters, selected_members): - ert = self.getModel() - - selected_parameters = [str(parameter) for parameter in selected_parameters] - selected_members = [int(member.strip()) for member in selected_members] - - source_case = str(self.sourceCase.currentText()) - source_report_step = self.sourceReportStep.getSelectedValue() - source_state = ert_state_enum.resolveName(str(self.sourceType.currentText())).value() - - target_case = str(self.targetCaseLabel.text()) - target_report_step = self.targetReportStep.getSelectedValue() - target_state = ert_state_enum.resolveName(str(self.targetType.currentText())).value() - - member_mask = BoolVector.active_mask(str(selected_members).strip('[]')) - ranking_key = None - node_list = StringList(selected_parameters) - - ert.main.copy_ensemble( source_case, - source_report_step, - source_state, - target_case, - target_report_step, - target_state, - member_mask, - ranking_key, - node_list) - - node_list.__del__ - - def initializeOrCopy(self): - selected_parameters = getItemsFromList(self.parametersList) - selected_members = getItemsFromList(self.membersList) - - if len(selected_parameters) == 0 or len(selected_members) == 0: - QtGui.QMessageBox.warning(self, "Missing data", "At least one parameter and one member must be selected!") - return - - if self.toggleScratch.isChecked(): - self.initializeCaseFromScratch(selected_parameters, selected_members) - elif self.toggleInitCopy.isChecked(): - self.initializeCaseFromCase(selected_parameters, selected_members) - else: - self.copyEnsemble(selected_parameters, selected_members) - - - def fetchContent(self): - data = self.getFromModel() - - self.parametersList.clear() - self.membersList.clear() - self.sourceCase.clear() - - self.listOfParameters = data["parameters"] - self.listOfDynamicParameters = data["dynamic_parameters"] - - - for member in data["members"]: - self.membersList.addItem("%03d" % (member)) - #self.membersList.addItem(str(member)) - - for case in data["cases"]: - if not case == data["current_case"]: - self.sourceCase.addItem(case) - - self.maxTimeStep = data["history_length"] - - self.sourceReportStep.setHistoryLength(self.maxTimeStep) - self.targetReportStep.setHistoryLength(self.maxTimeStep) - - self.targetCaseLabel.setText(data["current_case"]) - - if self.toggleScratch.isChecked(): - self.toggleScratch.emit(QtCore.SIGNAL("toggled(bool)"), True) - elif self.toggleInitCopy.isChecked(): - self.toggleInitCopy.emit(QtCore.SIGNAL("toggled(bool)"), True) - else: - self.toggleCopy.emit(QtCore.SIGNAL("toggled(bool)"), True) - - - def initialize(self, ert): - self.initialized = True - - - def getter(self, ert): - if not self.initialized: - self.initialize(ert) - - #enums from enkf_types.h - PARAMETER = 1 - DYNAMIC_STATE = 2 - parameters = ert.main.ensemble_config.alloc_keylist_from_var_type( PARAMETER ) - - dynamicParameters = ert.main.ensemble_config.alloc_keylist_from_var_type( DYNAMIC_STATE ) - - members = ert.main.ens_size - - fs = ert.main.get_fs - currentCase = ert.main.get_current_fs - - list = ert.main.alloc_caselist - historyLength = ert.main.get_history_length - - return {"parameters" : parameters, - "dynamic_parameters" : dynamicParameters, - "members" : range(members), - "current_case" : currentCase, - "cases" : list, - "history_length" : historyLength} - - - def setter(self, ert, value): - """The setting of these values are activated by a separate button.""" - pass - - - def createCheckPanel(self, list): - return ListCheckPanel(list) - - - def createRadioButtons(self): - radioLayout = QtGui.QVBoxLayout() - radioLayout.setSpacing(2) - self.toggleScratch = QtGui.QRadioButton("Initialize from scratch") - radioLayout.addWidget(self.toggleScratch) - self.toggleInitCopy = QtGui.QRadioButton("Initialize from existing case") - radioLayout.addWidget(self.toggleInitCopy) - self.toggleCopy = QtGui.QRadioButton("Copy from existing case") - radioLayout.addWidget(self.toggleCopy) - - self.connect(self.toggleScratch, QtCore.SIGNAL('toggled(bool)'), lambda : self.toggleActionState()) - self.connect(self.toggleInitCopy, QtCore.SIGNAL('toggled(bool)'), lambda : self.toggleActionState(selectSource = True)) - self.connect(self.toggleCopy, QtCore.SIGNAL('toggled(bool)'), lambda : self.toggleActionState(action = "Copy", selectSource=True, showCopyParameters=True, selectTarget=True)) - - return radioLayout - - - def createParameterMemberPanel(self): - self.parametersList = QtGui.QListWidget(self) - self.parametersList.setSelectionMode(QtGui.QAbstractItemView.MultiSelection) - self.membersList = QtGui.QListWidget(self) - self.membersList.setSelectionMode(QtGui.QAbstractItemView.MultiSelection) - - #--- members iconview code --- - self.membersList.setViewMode(QtGui.QListView.IconMode) - self.membersList.setMovement(QtGui.QListView.Static) - self.membersList.setResizeMode(QtGui.QListView.Adjust) - #self.membersList.setUniformItemSizes(True) - self.membersList.setGridSize(QtCore.QSize(32, 16)) - self.membersList.setSelectionRectVisible(False) - #----------------------------- - - parameterLayout = QtGui.QVBoxLayout() - parametersCheckPanel = self.createCheckPanel(self.parametersList) - parametersCheckPanel.insertWidget(0, QtGui.QLabel("Parameters")) - parameterLayout.addLayout(parametersCheckPanel) - parameterLayout.addWidget(self.parametersList) - - memberLayout = QtGui.QVBoxLayout() - membersCheckPanel = self.createCheckPanel(self.membersList) - membersCheckPanel.insertWidget(0, QtGui.QLabel("Members")) - memberLayout.addLayout(membersCheckPanel) - memberLayout.addWidget(self.membersList) - - listLayout = QtGui.QHBoxLayout() - listLayout.addLayout(parameterLayout) - listLayout.addLayout(memberLayout) - - return listLayout - - - def createActionButton(self): - self.actionButton = QtGui.QPushButton("Initialize") - - self.connect(self.actionButton, QtCore.SIGNAL('clicked()'), self.initializeOrCopy) - - actionLayout = QtGui.QHBoxLayout() - actionLayout.addStretch(1) - actionLayout.addWidget(self.actionButton) - actionLayout.addStretch(1) - - return actionLayout - - - def createSourceTargetLayout(self): - self.createSourceTargetWidgets() - - stLayout = QtGui.QGridLayout() - stLayout.setColumnStretch(8, 1) - stLayout.addWidget(QtGui.QLabel("Case"), 0, 1) - stLayout.addWidget(QtGui.QLabel("State"), 0, 3) - stLayout.addWidget(QtGui.QLabel("Timestep"), 0, 5) - self.sourceLabel = QtGui.QLabel("Source:") - stLayout.addWidget(self.sourceLabel, 1, 0) - stLayout.addWidget(self.sourceCase, 1, 1) - stLayout.addWidget(self.sourceType, 1, 3) - stLayout.addWidget(self.sourceReportStep, 1, 5) - stLayout.addWidget(self.sourceCompleteEnsembleCheck, 1, 7) - - self.targetCaseLabel = QtGui.QLabel("none?") - font = self.targetCaseLabel.font() - font.setWeight(QtGui.QFont.Bold) - self.targetCaseLabel.setFont(font) - - self.targetLabel = QtGui.QLabel("Target:") - - stLayout.addWidget(self.targetLabel, 2, 0) - stLayout.addWidget(self.targetCaseLabel, 2, 1) - stLayout.addWidget(self.targetType, 2, 3) - stLayout.addWidget(self.targetReportStep, 2, 5) - - return stLayout - - - def createSourceTargetWidgets(self): - self.sourceCase = QtGui.QComboBox(self) - self.sourceCase.setMaximumWidth(150) - self.sourceCase.setMinimumWidth(150) - self.sourceCase.setToolTip("Select source case") - self.sourceType = QtGui.QComboBox(self) - self.sourceType.setMaximumWidth(100) - self.sourceType.setToolTip("Select source state") - for state in ert_state_enum.INITIALIZATION_STATES: - self.sourceType.addItem(str(state)) - - self.sourceReportStep = ValidatedTimestepCombo(self) - self.sourceCompleteEnsembleCheck = QtGui.QCheckBox("Complete Ensemble") - self.sourceCompleteEnsembleCheck.setChecked(True) - - self.connect(self.sourceCompleteEnsembleCheck, QtCore.SIGNAL('stateChanged(int)'), - lambda state : self.toggleCompleteEnsembleState(state == QtCore.Qt.Checked)) - - self.targetType = QtGui.QComboBox(self) - self.targetType.setMaximumWidth(100) - self.targetType.setToolTip("Select target state") - for state in ert_state_enum.INITIALIZATION_STATES: - self.targetType.addItem(str(state)) - - self.targetReportStep = ValidatedTimestepCombo(self) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/init/initpanel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/init/initpanel.py deleted file mode 100644 index c7d892b6c3..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/init/initpanel.py +++ /dev/null @@ -1,125 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'initpanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -from ert_gui.widgets.tablewidgets import KeywordList -from ert_gui.widgets.validateddialog import ValidatedDialog -import ert.ert.ertwrapper as ertwrapper -from ert_gui.widgets.combochoice import ComboChoice -from ert.enkf.enkf_fs import EnkfFs - -from ert_gui.widgets.helpedwidget import HelpedWidget -from ert_gui.widgets.util import resourceIcon, createSeparator, may_take_a_long_time - -from initandcopy import * - - -class InitPanel(QtGui.QFrame): - - def __init__(self, parent): - QtGui.QFrame.__init__(self, parent) - self.setFrameShape(QtGui.QFrame.Panel) - self.setFrameShadow(QtGui.QFrame.Raised) - - initPanelLayout = QtGui.QVBoxLayout() - self.setLayout(initPanelLayout) - - casePanel = QtGui.QFormLayout() - - - def get_case_list(ert): - fs = ert.main.get_fs - list = ert.main.alloc_caselist - return list - - self.get_case_list = get_case_list # convenience: used by several functions - - - casePanel.addRow("Current case:", self.createCurrentCaseCombo()) - casePanel.addRow("Cases:", self.createCaseList()) - - - parametersPanelLayout = QtGui.QHBoxLayout() - parametersPanelLayout.addWidget(ParametersAndMembers(self)) - - initPanelLayout.addLayout(casePanel) - initPanelLayout.addWidget(createSeparator()) - initPanelLayout.addLayout(parametersPanelLayout) - - def casesUpdated(self): - """Emit to all listeners that the a new case has been added or the current case has changed""" - self.currentCase.modelEmit("casesUpdated()") - - def createCaseList(self): - """Creates a list that enables the creation of new cases. Removal has been disabled.""" - cases = KeywordList(self, "", "init/case_list") - - cases.newKeywordPopup = lambda list : ValidatedDialog(cases, "New case", "Enter name of new case:", list).showAndTell() - cases.addRemoveWidget.enableRemoveButton(False) #todo: add support for removal - cases.list.setMaximumHeight(150) - - - def create_case(ert, cases): - fs = ert.main.get_fs - - for case in cases: - if not ert.main.fs_exists(case): - ert.main.select_fs(case) - break - - self.currentCase.updateList(self.get_case_list(ert)) - self.currentCase.fetchContent() - self.casesUpdated() - - cases.getter = self.get_case_list - cases.initialize = self.get_case_list - cases.setter = create_case - - return cases - - - def createCurrentCaseCombo(self): - """Creates the combo that enables selection of the current case""" - self.currentCase = ComboChoice(self, ["none"], help="init/current_case_selection") - self.currentCase.combo.setMinimumWidth(150) - - def initialize_cases(ert): - self.currentCase.updateList(self.get_case_list(ert)) - - self.currentCase.initialize = initialize_cases - - def get_current_case(ert): - fs = ert.main.get_fs - tmp = self.get_case_list(ert) - currentCase = ert.main.get_current_fs - print "The selected case is: " + currentCase - return currentCase - - self.currentCase.getter = get_current_case - - @may_take_a_long_time - def select_case(ert, case): - case = str(case) - if not case == "": - ert.main.user_select_fs( case ) - self.casesUpdated() - - self.currentCase.setter = select_case - - return self.currentCase - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/message_center.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/message_center.py new file mode 100644 index 0000000000..520b8d734d --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/pages/message_center.py @@ -0,0 +1,30 @@ + +class MessageCenter(object): + __instance = None + + def __new__(cls): + """ @rtype: MessageCenter """ + if cls.__instance is None: + cls.__instance = super(MessageCenter, cls).__new__(cls) + cls.__instance.__help_message_listeners = [] + cls.__instance.__warning_message_listeners = [] + + return cls.__instance + + def addHelpMessageListeners(self, listener): + self.__help_message_listeners.append(listener) + + def addWarningMessageListeners(self, listener): + self.__warning_message_listeners.append(listener) + + def setHelpMessageLink(self, help_link): + for listener in self.__help_message_listeners: + listener.setHelpMessageLink(help_link) + + def setWarning(self, reference, warning): + if warning is None: + warning = "" + + for listener in self.__warning_message_listeners: + listener.setWarning(reference, warning) + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/CMakeLists.txt deleted file mode 100644 index 137c02c8b7..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_python_package( "Python ert_gui.pages.plot" ${PYTHON_INSTALL_PREFIX}/ert_gui/pages/plot "__init__.py;fetcher.py;plotconfig.py;plotfigure.py;plotpanel.py;plotsettings.py;plotview.py;zoomslider.py;ensemblefetcher.py;plotdata.py;plotgenerator.py;plotrenderer.py;plotsettingsxml.py;rftfetcher.py" True) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/__init__.py deleted file mode 100644 index 79c95cf38a..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/ensemblefetcher.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/ensemblefetcher.py deleted file mode 100644 index 0e98043037..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/ensemblefetcher.py +++ /dev/null @@ -1,402 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'ensemblefetcher.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - - -from fetcher import PlotDataFetcherHandler -from ert_gui.pages.config.parameters.parametermodels import FieldModel, SummaryModel, KeywordModel, DataModel -import ert.ert.ertwrapper as ertwrapper -import ert.ert.enums as enums -from PyQt4.QtGui import QWidget, QFormLayout, QSpinBox, QComboBox -from PyQt4.QtCore import SIGNAL -from ert.ert.erttypes import time_t, time_vector -import numpy -from ert.util.tvector import DoubleVector -import datetime -class EnsembleFetcher(PlotDataFetcherHandler): - """A data fetcher for ensemble parameters.""" - - def __init__(self): - PlotDataFetcherHandler.__init__(self) - - self.field_configuration = FieldConfigurationWidget() - self.summary_configuration = SummaryConfigurationWidget() - self.keyword_configuration = KeywordConfigurationWidget() - self.data_configuration = DataConfigurationWidget() - - def initialize(self, ert): - self.initialized = True - - def emitter(): - self.emit(SIGNAL('dataChanged()')) - self.connect(self.field_configuration, SIGNAL('configurationChanged()'), emitter) - self.connect(self.summary_configuration, SIGNAL('configurationChanged()'), emitter) - self.connect(self.keyword_configuration, SIGNAL('configurationChanged()'), emitter) - self.connect(self.data_configuration, SIGNAL('configurationChanged()'), emitter) - - - - def isHandlerFor(self, ert, key): - return ert.main.ensemble_config.has_key( key) - - def fetch(self, ert, key, parameter, data, comparison_fs): - data.x_data_type = "time" - fs = ert.main.get_fs - config_node = ert.main.ensemble_config.get_node(key) - node = config_node.alloc_node - comp_node = config_node.alloc_node - num_realizations = ert.main.ens_size - var_type_set = False - user_data = parameter.getUserData() - if user_data is None: - return False - - key_index = None - if user_data.has_key('key_index'): - key_index = user_data['key_index'] - - if parameter.getType() == FieldModel.TYPE: - var_type = enums.enkf_var_type.PARAMETER - var_type_set = True - field_position = user_data['field_position'] - field_config = config_node.field_model - if field_config.ijk_active(field_position[0] - 1, field_position[1] - 1, field_position[2] - 1): - key_index = "%i,%i,%i" % (field_position[0], field_position[1], field_position[2]) - data.setKeyIndexIsIndex(True) - else: - return False - - elif parameter.getType() == DataModel.TYPE: - var_type = enums.enkf_var_type.PARAMETER - var_type_set = True - data_index = user_data['data_index'] - key_index = "KEY:%d" % data_index - data.setKeyIndexIsIndex(True) - - if not var_type_set: - var_type = enums.enkf_var_type.DYNAMIC_RESULT - - - data.setKeyIndex(key_index) - state_list = [user_data['state']] - if state_list[0] == enums.ert_state_enum.BOTH: - state_list = [enums.ert_state_enum.FORECAST, enums.ert_state_enum.ANALYZED] - - for member in range(0, num_realizations): - data.x_data[member] = [] - data.y_data[member] = [] - x_time = data.x_data[member] - y = data.y_data[member] - - if not comparison_fs is None: - data.x_comp_data[member] = [] - data.y_comp_data[member] = [] - x_comp_time = data.x_comp_data[member] - y_comp = data.y_comp_data[member] - - stop_time = ert.main.get_history_length - - for state in state_list: - start_time = 0 - if config_node.get_impl_type == SummaryModel.TYPE: - start_time = 1 - for step in range(start_time, stop_time): - time_map = fs.get_time_map - sim_time_as_c_int = time_map.iget(step) - sim_time_as_time_t = time_t(sim_time_as_c_int) - sim_time_as_ordinal = sim_time_as_time_t.datetime().toordinal() - valid = ertwrapper.c_double() - value = node.user_get(fs, key_index, step, member, state.value(), ertwrapper.byref(valid)) - if value == True: - data.checkMaxMin(sim_time_as_time_t) - data.checkMaxMinY(valid.value) - x_time.append(sim_time_as_ordinal) - y.append(valid.value) - #else: - #print "Not valid: ", key, member, step, key_index, value, state.value() - - if not comparison_fs is None: - time_map = comparison_fs.get_time_map - sim_time_as_c_int = time_map.iget(step) - sim_time_as_time_t = time_t(sim_time_as_c_int) - sim_time_as_ordinal = sim_time_as_time_t.datetime().toordinal() - valid = ertwrapper.c_double() - value = node.user_get(comparison_fs, key, step, member, state.value(), ertwrapper.byref(valid)) - if value == 1: - data.checkMaxMin(sim_time_as_time_t) - data.checkMaxMinY(valid.value) - x_comp_time.append(sim_time_as_ordinal) - y_comp.append(valid.value) - #else: - # print "Not valid: ", key, member, step, key_index - - - data.x_data[member] = numpy.array(x_time)#[t.datetime() for t in x_time]) - data.y_data[member] = numpy.array(y) - - if not comparison_fs is None: - data.x_comp_data[member] = numpy.array(x_comp_time)#[t.datetime() for t in x_comp_time]) - data.y_comp_data[member] = numpy.array(y_comp) - - - self._getObservations(ert, key, key_index, data) - - self._getRefCase(ert, key, data) - - #node.__del__ - #comp_node.__del__ - - data.inverted_y_axis = False - - def _getObservations(self, ert, key, key_index, data): - if not key_index is None: - user_key = "%s:%s" % (key, key_index) - else: - user_key = key - - obs_count = ert.main.get_observation_count(user_key) - if obs_count > 0: - obs_x = (time_t * obs_count)() - obs_y = (ertwrapper.c_double * obs_count)() - obs_std = (ertwrapper.c_double * obs_count)() - ert.main.get_observations(user_key, obs_count, obs_x, obs_y, obs_std) - - data.obs_x = numpy.array([t.datetime() for t in obs_x]) - data.obs_y = numpy.array(obs_y) - data.obs_std_y = numpy.array(obs_std) - data.obs_std_x = None - - data.checkMaxMin(max(obs_x)) - data.checkMaxMin(min(obs_x)) - - data.checkMaxMinY(max(obs_y)) - data.checkMaxMinY(min(obs_y)) - - - def _getRefCase(self, ert, key, data): - ecl_config = ert.main.ecl_config - ecl_sum = ecl_config.get_refcase - - if(ecl_sum.has_key(key)): - ki = ecl_sum.get_general_var_index(key) - x_data = ecl_sum.alloc_time_vector(True) - y_data = ecl_sum.alloc_data_vector(ki, True) - - data.refcase_x = [] - data.refcase_y = [] - first = True - for x in x_data: - if not first: - data.refcase_x.append(x) - #data.checkMaxMin(x) - else: - first = False #skip first element because of eclipse behavior - - first = True - for y in y_data: - if not first: - data.refcase_y.append(y) - data.checkMaxMinY(y) - else: - first = False #skip first element because of eclipse behavior - - data.refcase_x = numpy.array([t.datetime() for t in data.refcase_x]) - data.refcase_y = numpy.array(data.refcase_y) - - def configure(self, parameter, context_data): - self.parameter = parameter - - cw = self.getConfigurationWidget(context_data) - if not cw is None: - cw.setParameter(parameter) - - def getConfigurationWidget(self, context_data): - if self.parameter.getType() == SummaryModel.TYPE: - return self.summary_configuration - elif self.parameter.getType() == KeywordModel.TYPE: - key_index_list = context_data.getKeyIndexList(self.parameter.getName()) - self.keyword_configuration.setKeyIndexList(key_index_list) - return self.keyword_configuration - elif self.parameter.getType() == FieldModel.TYPE: - bounds = context_data.field_bounds - self.field_configuration.setFieldBounds(*bounds) - return self.field_configuration - elif self.parameter.getType() == DataModel.TYPE: - index = context_data.gen_data_size - self.data_configuration.setIndexBounds(index) - return self.data_configuration - else: - return None - - -#--------------------------------------------------------- -# The following widgets are used to configure the -# different parameter types. -#--------------------------------------------------------- - -class ConfigurationWidget(QWidget): - """An abstract configuration widget.""" - def __init__(self): - QWidget.__init__(self) - self.layout = QFormLayout() - self.layout.setRowWrapPolicy(QFormLayout.WrapLongRows) - - self.stateCombo = QComboBox() - - for state in enums.ert_state_enum.values(): - self.stateCombo.addItem(state.name) - - self.stateCombo.setCurrentIndex(0) - - self.layout.addRow("State:", self.stateCombo) - - self.setLayout(self.layout) - - self.connect(self.stateCombo, SIGNAL('currentIndexChanged(QString)'), self.applyConfiguration) - - def addRow(self, label, widget): - """Add another item to this widget.""" - self.layout.addRow(label, widget) - - def setParameter(self, parameter): - """Set the parameter to configure.""" - self.parameter = parameter - self.applyConfiguration(False) - - def getState(self): - """State is common for all parameters.""" - selectedName = str(self.stateCombo.currentText()) - return enums.ert_state_enum.resolveName(selectedName) - - def emitConfigurationChanged(self, emit=True): - """Emitted when a sub widget changes the state of the parameter.""" - if emit: - self.emit(SIGNAL('configurationChanged()')) - - def applyConfiguration(self, emit=True): - """Override! Set the user_data of self.paramater and optionally: emitConfigurationChanged()""" - pass - - -class SummaryConfigurationWidget(ConfigurationWidget): - def __init__(self): - ConfigurationWidget.__init__(self) - - - def applyConfiguration(self, emit=True): - user_data = {'state': self.getState()} - self.parameter.setUserData(user_data) - self.emitConfigurationChanged(emit) - - -class FieldConfigurationWidget(ConfigurationWidget): - def __init__(self): - ConfigurationWidget.__init__(self) - - self.keyIndexI = QSpinBox() - self.keyIndexI.setMinimum(1) - - self.addRow("i:", self.keyIndexI) - - self.keyIndexJ = QSpinBox() - self.keyIndexJ.setMinimum(1) - self.addRow("j:", self.keyIndexJ) - - self.keyIndexK = QSpinBox() - self.keyIndexK.setMinimum(1) - self.addRow("k:", self.keyIndexK) - - self.setFieldBounds(1, 1, 1) - - self.connect(self.keyIndexI, SIGNAL('valueChanged(int)'), self.applyConfiguration) - self.connect(self.keyIndexJ, SIGNAL('valueChanged(int)'), self.applyConfiguration) - self.connect(self.keyIndexK, SIGNAL('valueChanged(int)'), self.applyConfiguration) - - def setFieldBounds(self, i, j, k): - self.keyIndexI.setMaximum(i) - self.keyIndexJ.setMaximum(j) - self.keyIndexK.setMaximum(k) - - def getFieldPosition(self): - return (self.keyIndexI.value(), self.keyIndexJ.value(), self.keyIndexK.value()) - - def setParameter(self, parameter): - self.parameter = parameter - self.applyConfiguration(False) - - def applyConfiguration(self, emit=True): - user_data = {'state': self.getState(), 'field_position': self.getFieldPosition()} - self.parameter.setUserData(user_data) - self.emitConfigurationChanged(emit) - - -class KeywordConfigurationWidget(ConfigurationWidget): - def __init__(self): - ConfigurationWidget.__init__(self) - self.keyIndexCombo = QComboBox() - self.addRow("Key index:", self.keyIndexCombo) - - self.connect(self.keyIndexCombo, SIGNAL('currentIndexChanged(QString)'), self.applyConfiguration) - - def setKeyIndexList(self, list): - self.disconnect(self.keyIndexCombo, SIGNAL('currentIndexChanged(QString)'), self.applyConfiguration) - self.keyIndexCombo.clear() - self.keyIndexCombo.addItems(list) - self.connect(self.keyIndexCombo, SIGNAL('currentIndexChanged(QString)'), self.applyConfiguration) - - def setParameter(self, parameter): - self.parameter = parameter - self.applyConfiguration(False) - - def applyConfiguration(self, emit=True): - user_data = {'state': self.getState(), 'key_index' : self.getKeyIndex()} - self.parameter.setUserData(user_data) - self.emitConfigurationChanged(emit) - - def getKeyIndex(self): - return str(self.keyIndexCombo.currentText()) - -class DataConfigurationWidget(ConfigurationWidget): - def __init__(self): - ConfigurationWidget.__init__(self) - - self.keyIndex = QSpinBox() - self.keyIndex.setMinimum(0) - - self.addRow("index:", self.keyIndex) - - self.setIndexBounds(0) - - self.connect(self.keyIndex, SIGNAL('valueChanged(int)'), self.applyConfiguration) - - def setIndexBounds(self, i): - self.keyIndex.setMaximum(i) - - def getIndex(self): - return self.keyIndex.value() - - def setParameter(self, parameter): - self.parameter = parameter - self.applyConfiguration(False) - - def applyConfiguration(self, emit=True): - user_data = {'state': self.getState(), 'data_index': self.getIndex()} - self.parameter.setUserData(user_data) - self.emitConfigurationChanged(emit) - - - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/fetcher.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/fetcher.py deleted file mode 100644 index 4dba0464b4..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/fetcher.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'fetcher.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4.QtCore import QObject - -class PlotDataFetcherHandler(QObject): - """An interface for data fetchers.""" - - def __init__(self): - QObject.__init__(self) - - def isHandlerFor(self, ert, key): - """Retrun True if this handler can handle key.""" - return False - - def initialize(self, ert): - """Prototype functions and types.""" - pass - - def fetch(self, ert, key, parameter, data, comparison_fs): - """ - Fetch data from ert by key. Key has already been tested with isHandlerFor() - Parameter contains configuration data. data is the target. - comparison_fs is the fs to the case which the plotter should use for comparison plot data - """ - pass - - def getConfigurationWidget(self, context_data): - """Return a widget to configure this handler.""" - pass - - def configure(self, parameter, context_data): - """ - Set the current parameter to configure. - Should always be called before getConfigurationWidget(). - """ - pass \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotconfig.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotconfig.py deleted file mode 100644 index 3e6f843d2c..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotconfig.py +++ /dev/null @@ -1,259 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'plotconfig.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4.QtCore import QObject, QSize, pyqtSignal -from PyQt4.Qt import SIGNAL -from PyQt4.QtGui import QFormLayout, QFrame, QComboBox, QHBoxLayout, QDoubleSpinBox, QWidget, QPainter, QColor, QColorDialog -from PyQt4.QtGui import QCheckBox, QDialog - -class PlotConfig(object): - """ - Plot config represents settings information relating to plot lines. - All values are available as properties. - """ - - def __init__(self, name, linestyle="-", marker="", color=(0.0, 0.0, 0.0), alpha=0.75, zorder=1, picker=None, visible=True): - self._name = name - self._linestyle = linestyle - self._marker = marker - self._color = color - self._alpha = alpha - self._is_visible = visible - self._z_order = zorder - self._picker = picker - - self.signal_handler = QObject() - - def notify(self): - """Tell all listeners that something has changed. Automatically called by setters.""" - #self.signal_handler.emit(plotConfigChanged) - self.signal_handler.emit(SIGNAL('plotConfigChanged(PlotConfig)'), self) - - def get_name(self): - return self._name - - name = property(get_name, doc="The name of this plot.") - - def hasStyle(self): - return not self.style == "" - - def get_style(self): - return (str(self._marker) + str(self._linestyle)).strip() - - style = property(get_style, doc="Returns the combined style of line style and marker style.") - - def setLinestyle(self, linestyle): - self._linestyle = linestyle - self.notify() - - def getLinestyle(self): - return self._linestyle - - linestyle = property(getLinestyle, setLinestyle, doc="Line style") - - def setMarker(self, marker): - self._marker = marker - self.notify() - - def getMarker(self): - return self._marker - - marker = property(getMarker, setMarker, doc="Marker style") - - def setAlpha(self, alpha): - self._alpha = alpha - self.notify() - - def getAlpha(self): - return self._alpha - - alpha = property(getAlpha, setAlpha, doc="Transparency of the line. 1 = Opaque ... 0 transparent.") - - def setColor(self, color): - self._color = color - self.notify() - - def getColor(self): - return self._color - - color = property(getColor, setColor, doc="Color of the line.") - - - def set_is_visible(self, is_visible): - self._is_visible = is_visible - self.notify() - - def is_visible(self): - return self._is_visible - - is_visible = property(is_visible, set_is_visible, doc="Hide or show the plotline.") - - def set_z_order(self, z_order): - self._z_order = z_order - self.notify() - - def get_z_order(self): - return self._z_order - - z_order = property(get_z_order, set_z_order, doc="Z drawing order. 10 = top ... 1 = bottom.") - - def setPicker(self, picker): - self._picker = picker - self.notify() - - def getPicker(self): - return self._picker - - picker = property(getPicker, setPicker, doc="Picker radius") - - -class PlotConfigPanel(QFrame): - """A panel to interact with PlotConfig instances.""" - plot_marker_styles = ["", ".", ",", "o", "*", "s", "+", "x", "p", "h", "H", "D", "d"] - plot_line_styles = ["", "-", "--", "-.", ":"] - - changed = pyqtSignal(object) - - def __init__(self, plot_config): - QFrame.__init__(self) - self.plot_config = plot_config - self.changed.connect( self._fetchValues ) - layout = QFormLayout() - layout.setRowWrapPolicy(QFormLayout.WrapLongRows) - - self.chk_visible = QCheckBox() - layout.addRow("Visible:", self.chk_visible) - self.connect(self.chk_visible, SIGNAL('stateChanged(int)'), self._setVisibleState) - - self.plot_linestyle = QComboBox() - self.plot_linestyle.addItems(self.plot_line_styles) - self.connect(self.plot_linestyle, SIGNAL("currentIndexChanged(QString)"), self._setLineStyle) - layout.addRow("Line style:", self.plot_linestyle) - - self.plot_marker_style = QComboBox() - self.plot_marker_style.addItems(self.plot_marker_styles) - self.connect(self.plot_marker_style, SIGNAL("currentIndexChanged(QString)"), self._setMarker) - layout.addRow("Marker style:", self.plot_marker_style) - - - - self.alpha_spinner = QDoubleSpinBox(self) - self.alpha_spinner.setMinimum(0.0) - self.alpha_spinner.setMaximum(1.0) - self.alpha_spinner.setDecimals(3) - self.alpha_spinner.setSingleStep(0.01) - - self.connect(self.alpha_spinner, SIGNAL('valueChanged(double)'), self._setAlpha) - layout.addRow("Blend factor:", self.alpha_spinner) - - self.color_picker = ColorPicker(plot_config) - layout.addRow("Color:", self.color_picker) - - self.setLayout(layout) - self._fetchValues(plot_config) - - def _fetchValues(self, plot_config): - """Fetch values from a PlotConfig and insert into the panel.""" - self.plot_config = plot_config - - #block signals to avoid updating the incoming plot_config - - state = self.plot_linestyle.blockSignals(True) - linestyle_index = self.plot_line_styles.index(self.plot_config.linestyle) - self.plot_linestyle.setCurrentIndex(linestyle_index) - self.plot_linestyle.blockSignals(state) - - state = self.plot_marker_style.blockSignals(True) - marker_index = self.plot_marker_styles.index(self.plot_config.marker) - self.plot_marker_style.setCurrentIndex(marker_index) - self.plot_marker_style.blockSignals(state) - - state = self.alpha_spinner.blockSignals(True) - self.alpha_spinner.setValue(self.plot_config.alpha) - self.alpha_spinner.blockSignals(state) - - state = self.chk_visible.blockSignals(True) - self.chk_visible.setChecked(self.plot_config.is_visible) - self.chk_visible.blockSignals(state) - - self.color_picker.update() - - #------------------------------------------- - # update plot config from widgets - #------------------------------------------- - def _setLineStyle(self, linestyle): - self.plot_config.linestyle = linestyle - - def _setMarker(self, marker): - self.plot_config.marker = marker - - def _setAlpha(self, alpha): - self.plot_config.alpha = alpha - - def _setVisibleState(self, state): - self.plot_config.is_visible = state == 2 - - - -class ColorPicker(QWidget): - """A widget that shows a colored box and pops up a color dialog.""" - - def __init__(self, plot_config): - QWidget.__init__(self) - - self.plot_config = plot_config - self.color_dialog = QColorDialog() - size = 20 - self.setMaximumSize(QSize(size, size)) - self.setMinimumSize(QSize(size, size)) - self.setToolTip("Click to change color!") - - def paintEvent(self, paintevent): - """Paints the box""" - painter = QPainter(self) - - rect = self.contentsRect() - rect.setWidth(rect.width() - 1) - rect.setHeight(rect.height() - 1) - painter.drawRect(rect) - - rect.setX(rect.x() + 1) - rect.setY(rect.y() + 1) - painter.fillRect(rect, self._getColor()) - - def _setColor(self, color): - """Set the color of this picker.""" - self.plot_config.color = (color.redF(), color.greenF(), color.blueF()) - self.update() - - def _getColor(self): - """Return the color of this picker as QColor.""" - color = self.plot_config.color - return QColor(int(color[0] * 255), int(color[1] * 255), int(color[2] * 255)) - - def mouseDoubleClickEvent(self, event): - self.color_dialog.setCurrentColor(self._getColor()) - status = self.color_dialog.exec_() - if status == QDialog.Accepted: - self._setColor(self.color_dialog.selectedColor()) - - def mousePressEvent(self, event): - self.color_dialog.setCurrentColor(self._getColor()) - status = self.color_dialog.exec_() - if status == QDialog.Accepted: - self._setColor(self.color_dialog.selectedColor()) - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotdata.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotdata.py deleted file mode 100644 index 9d43a79ee5..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotdata.py +++ /dev/null @@ -1,331 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'plotdata.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from ert.ert.erttypes import time_t -from ert_gui.widgets.helpedwidget import ContentModel -from ert_gui.widgets.util import print_timing, resourceIcon -from ert_gui.pages.config.parameters.parametermodels import DataModel, KeywordModel, FieldModel, SummaryModel -from ert_gui.pages.config.parameters.parameterpanel import Parameter -import ert.ert.enums as enums -import sys -from ert.ert.enums import obs_impl_type - -from ensemblefetcher import EnsembleFetcher -from rftfetcher import RFTFetcher -from PyQt4.QtGui import QFrame -from PyQt4.QtCore import SIGNAL, QObject -import ert_gui.widgets as widgets - - - - -class PlotDataFetcher(ContentModel, QObject): - - def __init__(self): - ContentModel.__init__(self) - QObject.__init__(self) - self.parameter = None - - # the order of these handlers depend on ERT's way of keeping track of the keys - self.handlers = [RFTFetcher(), EnsembleFetcher()] - self.current_handler = None - self.empty_panel = QFrame() - - self.fs_for_comparison_plots = None - self.comparison_fs_name = "None" - self.data = None - - def initialize(self, ert): - for handler in self.handlers: - handler.initialize(ert) - self.connect(handler, SIGNAL('dataChanged()'), self.__dataChanged) - - - - - #@print_timing - @widgets.util.may_take_a_long_time - def getter(self, ert): - data = PlotData() - if not self.parameter is None: - key = self.parameter.getName() - data.setName(key) - - for handler in self.handlers: - if handler.isHandlerFor(ert, key): - handler.fetch(ert, key, self.parameter, data, self.fs_for_comparison_plots) - self.current_handler = handler - break - - return data - - - def __dataChanged(self): - self.fetchContent() - self.emit(SIGNAL('dataChanged()')) - - def fetchContent(self): - self.data = self.getFromModel() - - def setParameter(self, parameter, context_data): - self.findHandler(parameter.getName()) - if not self.current_handler is None: - self.parameter = parameter - self.current_handler.configure(parameter, context_data) - - def getParameter(self): - return self.parameter - - def getConfigurationWidget(self, context_data): - if self.current_handler is None: - return self.empty_panel - else: - cw = self.current_handler.getConfigurationWidget(context_data) - if cw is None: - cw = self.empty_panel - return cw - - def findHandler(self, key): - ert = self.getModel() - self.current_handler = None - for handler in self.handlers: - if handler.isHandlerFor(ert, key): #todo: what about multiple hits? - self.current_handler = handler - break - - def updateComparisonFS(self, new_fs): - if not new_fs == self.comparison_fs_name: - ert = self.getModel() - - if self.fs_for_comparison_plots: - fs_for_comparison_plots.__del__ - self.fs_for_comparison_plots = None - self.comparison_fs_name = "None" - - if not new_fs == "None": - self.fs_for_comparison_plots = ert.main.get_alt_fs(new_fs, false, true) - self.comparison_fs_name = new_fs - - self.__dataChanged() - - - -class PlotData: - def __init__(self, name="undefined"): - self.name = name - self.key_index = None - - self.x_data = {} - self.y_data = {} - - self.x_comp_data = {} - self.y_comp_data = {} - - self.obs_x = None - self.obs_y = None - self.obs_std_x = None - self.obs_std_y = None - - self.refcase_x = None - self.refcase_y = None - - - self.x_min = None - self.x_max = None - - self.y_min = None - self.y_max = None - - self.y_data_type = "number" - self.x_data_type = "time" - - self.inverted_y_axis = False - - self.valid = True - self.key_index_is_index = False - - def checkMaxMin(self, value): - if self.x_min is None or self.x_max is None: - self.x_min = value - self.x_max = value - - self.x_min = min(value, self.x_min) - self.x_max = max(value, self.x_max) - - def checkMaxMinY(self, value): - if self.y_min is None or self.y_max is None: - self.y_min = value - self.y_max = value - - self.y_min = min(value, self.y_min) - self.y_max = max(value, self.y_max) - - def getName(self): - return self.name - - def setName(self, name): - self.name = name - - def setKeyIndex(self, key_index): - self.key_index = key_index - - def getKeyIndex(self): - return self.key_index - - def getXDataType(self): - return self.x_data_type - - def getYDataType(self): - return self.y_data_type - - def hasInvertedYAxis(self): - return self.inverted_y_axis - - def getTitle(self): - name = self.getName() - key_index = self.getKeyIndex() - - title = name - if not key_index is None: - title = "%s (%s)" % (name, key_index) - - return title - - def isValid(self): - return self.valid - - def setValid(self, valid): - self.valid = valid - - def setKeyIndexIsIndex(self, bool): - self.key_index_is_index = bool - - def getSaveName(self): - if self.key_index_is_index or self.getKeyIndex() is None: - return self.getName() - else: - return ("%s.%s" % (self.getName(), self.getKeyIndex())) - - - -class PlotContextDataFetcher(ContentModel): - - - def __init__(self): - ContentModel.__init__(self) - self.observation_icon = resourceIcon("observation") - - def initialize(self, ert): - self.modelConnect("casesUpdated()", self.fetchContent) - - - #@print_timing - def getter(self, ert): - data = PlotContextData() - - keys = ert.main.ensemble_config.alloc_keylist - data.keys = keys - data.parameters = [] - - for key in keys: - config_node = ert.main.ensemble_config.get_node( key) - type = config_node.get_impl_type - node_ref = config_node.get_ref - - if type == SummaryModel.TYPE: - p = Parameter(key, SummaryModel.TYPE) - data.parameters.append(p) - - elif type == FieldModel.TYPE: - p = Parameter(key, FieldModel.TYPE) - data.parameters.append(p) - - if data.field_bounds is None: - x = config_node.field_model.get_nx - y = config_node.field_model.get_ny - z = config_node.field_model.get_nz - data.field_bounds = (x,y,z) - - elif type == DataModel.TYPE: - data.parameters.append(Parameter(key, DataModel.TYPE)) - data.gen_data_size = config_node.data_model.get_initial_size - - elif type == KeywordModel.TYPE: - p = Parameter(key, KeywordModel.TYPE) - data.parameters.append(p) - s = config_node.keyword_model.alloc_name_list - data.key_index_list[key] = s - - data.errorbar_max = ert.main.plot_config.get_errorbar_max - - fs = ert.main.get_fs - current_case = ert.main.get_current_fs - - data.plot_config_path = ert.main.plot_config.get_path - data.plot_path = ert.main.plot_config.get_path + "/" + current_case - - enkf_obs = ert.main.get_obs - key_list = enkf_obs.alloc_typed_keylist( obs_impl_type.FIELD_OBS.value()) - - for obs in key_list: - p = Parameter(obs, obs_impl_type.FIELD_OBS, self.observation_icon) - data.parameters.append(p) - - - - case_list = ert.main.alloc_caselist - - data.current_case = current_case - - - for case in case_list: - data.case_list.append(case) - - return data - - def fetchContent(self): - self.data = self.getFromModel() - - -class PlotContextData: - def __init__(self): - self.keys = None - self.parameters = None - self.key_index_list = {} - self.errorbar_max = 0 - self.plot_path = "" - self.plot_config_path = "" - self.field_bounds = None - self.gen_data_size = 0 - self.case_list = ["None"] - self.current_case = None - - def getKeyIndexList(self, key): - if self.key_index_list.has_key(key): - return self.key_index_list[key] - else: - return [] - - def getComparableCases(self): - cases = [] - - for case in self.case_list: - if not case == self.current_case: - cases.append(case) - - return cases - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotfigure.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotfigure.py deleted file mode 100644 index 9221f08117..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotfigure.py +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'plotfigure.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from matplotlib.figure import Figure -import matplotlib.lines -import matplotlib.text - -import numpy -import ert.ert.erttypes as erttypes -import plotsettings -from plotrenderer import DefaultPlotRenderer - -class PlotFigure: - """A simple wrapper for a matplotlib Figure. Associated with a specified renderer.""" - def __init__(self): - self.fig = Figure(dpi=100) - self.axes = self.fig.add_subplot(111) - self.fig.subplots_adjust(left=0.15) - self.axes.set_xlim() - self.plot_renderer = DefaultPlotRenderer() - - def getFigure(self): - """Return the matplotlib figure.""" - return self.fig - - def drawPlot(self, plot_data, plot_settings): - """Draw a plot based on the specified data and settings.""" - self.axes.cla() - - self.plot_renderer.drawPlot(self.axes, plot_data, plot_settings) - - if plot_data.getXDataType() == "time": - self.fig.autofmt_xdate() - - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotgenerator.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotgenerator.py deleted file mode 100644 index 8c6e7d0aab..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotgenerator.py +++ /dev/null @@ -1,172 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'plotgenerator.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -import os -from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas -from PyQt4.QtGui import QFrame, QSizePolicy, QVBoxLayout, QCursor, QDialog, QDialogButtonBox -from plotfigure import PlotFigure -from PyQt4.QtCore import Qt, QPoint, QSize, SIGNAL -from PyQt4.QtGui import QProgressBar, QApplication -import threading -from plotsettingsxml import PlotSettingsLoader -from plotsettings import PlotSettings -from plotdata import PlotContextDataFetcher, PlotDataFetcher -from ert_gui.pages.config.parameters.parametermodels import SummaryModel, KeywordModel -import ert.ert.enums as enums - -class PlotGenerator(QFrame): - - def __init__(self, plot_path, plot_config_path): - QFrame.__init__(self) - self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) - - self.plot_figure = PlotFigure() - self.canvas = FigureCanvas(self.plot_figure.getFigure()) - self.canvas.setParent(self) - self.canvas.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) - - size = QSize(297*2, 210*2) # A4 aspectratio - self.canvas.setMaximumSize(size) - self.canvas.setMinimumSize(size) - self.setMaximumSize(size) - self.setMinimumSize(size) - - self.popup = Popup(self) - self.plot_config_loader = PlotSettingsLoader() - self.plot_settings = PlotSettings() - self.plot_settings.setPlotPath(plot_path) - self.plot_settings.setPlotConfigPath(plot_config_path) - self.connect(self.popup, SIGNAL('updateProgress(int)'), self.updateProgress) - - - self.plot_context_data_fetcher = PlotContextDataFetcher() - self.plot_context_data_fetcher.initialize(self.plot_context_data_fetcher.getModel()) - self.plot_data_fetcher = PlotDataFetcher() - self.plot_data_fetcher.initialize(self.plot_data_fetcher.getModel()) - - def updateProgress(self, progress = 1): - value = self.popup.progress_bar.value() - self.popup.progress_bar.setValue(value + progress) - - def saveAll(self): - self.popup.show() - - context_data = self.plot_context_data_fetcher.getFromModel() - - save_list = [] - count = 0 - for parameter in context_data.parameters: - pt = parameter.type - - if pt == SummaryModel.TYPE or pt == KeywordModel.TYPE or pt == enums.obs_impl_type.FIELD_OBS: - save_list.append(parameter) - parameter.setUserData({'state' : enums.ert_state_enum.FORECAST}) - - if pt == KeywordModel.TYPE: - choices = context_data.key_index_list[parameter.name] - parameter.getUserData()['key_index_choices'] = choices - count += len(choices) - else: - count += 1 - - - self.popup.progress_bar.setMaximum(count) - - for parameter in save_list: - if parameter.type == KeywordModel.TYPE: - for choice in parameter.getUserData()['key_index_choices']: - self.plot_data_fetcher.setParameter(parameter, context_data) - parameter.getUserData()['key_index'] = choice # because setParameter overwrites this value - self.plot_data_fetcher.fetchContent() - self.savePlot(self.plot_data_fetcher.data) - else: - self.plot_data_fetcher.setParameter(parameter, context_data) - self.plot_data_fetcher.fetchContent() - self.savePlot(self.plot_data_fetcher.data) - - self.popup.ok_button.setEnabled(True) - - def save(self, plot_data): - self.popup.show() - - self.popup.progress_bar.setMaximum(1) - - self.savePlot(plot_data) - self.popup.ok_button.setEnabled(True) - - - def savePlot(self, plot_data): - generated_plot = self.generatePlot(plot_data) - if generated_plot: - self.savePlotToFile(plot_data.getSaveName()) - self.popup.emit(SIGNAL('updateProgress(int)'), 1) - - def generatePlot(self, plot_data): - name = plot_data.getSaveName() - load_success = self.plot_config_loader.load(name, self.plot_settings) - - if load_success: - self.plot_figure.drawPlot(plot_data, self.plot_settings) - self.canvas.draw() - - return load_success - - def savePlotToFile(self, filename): - """Save the plot visible in the figure.""" - plot_path = self.plot_settings.getPlotPath() - if not os.path.exists(plot_path): - os.makedirs(plot_path) - - path = plot_path + "/" + filename - self.plot_figure.getFigure().savefig(path + ".png", dpi=400, format="png") - self.plot_figure.getFigure().savefig(path + ".pdf", dpi=400, format="pdf") - - -class Popup(QDialog): - def __init__(self, widget, parent = None): - QDialog.__init__(self, parent) - self.setModal(True) - self.setWindowTitle("Plot save progress") - - layout = QVBoxLayout() - layout.addWidget(widget) - - self.progress_bar = QProgressBar() - self.progress_bar.setMinimum(0) - self.progress_bar.setMaximum(1) - self.progress_bar.setValue(0) - layout.addWidget(self.progress_bar) - - buttons = QDialogButtonBox(QDialogButtonBox.Ok, Qt.Horizontal, self) - layout.addWidget(buttons) - - self.setLayout(layout) - - self.connect(buttons, SIGNAL('accepted()'), self.accept) - - self.ok_button = buttons.button(QDialogButtonBox.Ok) - self.ok_button.setEnabled(False) - - def closeEvent(self, event): - """Ignore clicking of the x in the top right corner""" - event.ignore() - - def keyPressEvent(self, event): - """Ignore ESC keystrokes""" - if not event.key() == Qt.Key_Escape: - QDialog.keyPressEvent(self, event) - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotpanel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotpanel.py deleted file mode 100644 index 8f7fade950..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotpanel.py +++ /dev/null @@ -1,440 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'plotpanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -from ert_gui.pages.config.parameters.parameterpanel import Parameter -from ert_gui.pages.plot.plotview import PlotView -import ert_gui.pages.config.parameters.parameterpanel -import ert_gui.widgets.helpedwidget -from ert_gui.widgets.helpedwidget import ContentModel -from ert_gui.pages.config.parameters.parametermodels import DataModel, FieldModel, KeywordModel, SummaryModel -from ert_gui.pages.plot.plotdata import PlotContextDataFetcher, PlotDataFetcher, enums -import ert_gui.widgets.util -import datetime -import time -import matplotlib.dates -from zoomslider import ZoomSlider -from ert_gui.widgets.configpanel import ConfigPanel -from PyQt4.Qt import SIGNAL -from PyQt4.QtCore import QDate, Qt, QPoint , pyqtSignal -from plotconfig import PlotConfigPanel -from PyQt4.QtGui import QTabWidget, QFormLayout, QFrame, QVBoxLayout, QHBoxLayout, QCheckBox, QPushButton, QToolButton, QMainWindow -from PyQt4.QtGui import QCalendarWidget -import plotsettings -import ert.ert.erttypes as erttypes - -class PlotPanel(QtGui.QWidget): - - changed = pyqtSignal() - - def __init__(self): - QtGui.QWidget.__init__(self) - - plotLayout = QtGui.QHBoxLayout() - - self.plot = PlotView() - - parameterLayout = QtGui.QVBoxLayout() - self.plotList = QtGui.QListWidget(self) - self.plotList.setMaximumWidth(150) - self.plotList.setMinimumWidth(150) - - self.plotDataPanel = PlotParameterConfigurationPanel(self, 150) - parameterLayout.addWidget(self.plotList) - parameterLayout.addWidget(self.plotDataPanel) - - self.connect(self.plotList, QtCore.SIGNAL('currentItemChanged(QListWidgetItem *, QListWidgetItem *)'), - self.select) - ContentModel.modelConnect('initialized()', self.updateList) - - #todo: listen to ensemble changes! - - - self.plotDataFetcher = PlotDataFetcher() - self.connect(self.plotDataFetcher, QtCore.SIGNAL('dataChanged()'), self.drawPlot) - self.plotContextDataFetcher = PlotContextDataFetcher() - - plot_view_layout = QtGui.QGridLayout() - - plot_view_layout.addWidget(self.plot, 0, 0, 1, 1) - - self.h_zoom_slider = ZoomSlider() - self.connect(self.h_zoom_slider, QtCore.SIGNAL('zoomValueChanged(float, float)'), self.plot.setXZoomFactors) - - self.v_zoom_slider = ZoomSlider(horizontal=False) - self.connect(self.v_zoom_slider, QtCore.SIGNAL('zoomValueChanged(float, float)'), self.plot.setYZoomFactors) - - plot_view_layout.addWidget(self.h_zoom_slider, 1, 0, 1, 1) - plot_view_layout.addWidget(self.v_zoom_slider, 0, 1, 1, 1) - - plotLayout.addLayout(parameterLayout) - plotLayout.addLayout(plot_view_layout) - - self.plotViewSettings = PlotViewSettingsPanel(plotView=self.plot, width=250) - self.connect(self.plotViewSettings, QtCore.SIGNAL('comparisonCaseSelected(QString)'), self.plotDataFetcher.updateComparisonFS) - plotLayout.addWidget(self.plotViewSettings) - - self.setLayout(plotLayout) - - self.changed.connect( self.fetchSettings ) - #self.connect(self.plot.plot_settings, QtCore.SIGNAL('plotSettingsChanged(PlotSettings)'), self.fetchSettings) - ContentModel.modelConnect('casesUpdated()', self.updateList) - - - def drawPlot(self): - self.plot.setData(self.plotDataFetcher.data) - - def fetchSettings(self, plot_settings): - if self.plotDataFetcher.data: - data = self.plotDataFetcher.data - x_min = plot_settings.getMinXLimit(data.x_min, data.getXDataType()) - x_max = plot_settings.getMaxXLimit(data.x_max, data.getXDataType()) - y_min = plot_settings.getMinYLimit(data.y_min, data.getYDataType()) - y_max = plot_settings.getMaxYLimit(data.y_max, data.getYDataType()) - - state = self.h_zoom_slider.blockSignals(True) - self.h_zoom_slider.setMinValue(plot_settings.getMinXZoom()) - self.h_zoom_slider.setMaxValue(plot_settings.getMaxXZoom()) - self.h_zoom_slider.blockSignals(state) - - state = self.v_zoom_slider.blockSignals(True) - self.v_zoom_slider.setMinValue(plot_settings.getMinYZoom()) - self.v_zoom_slider.setMaxValue(plot_settings.getMaxYZoom()) - self.v_zoom_slider.blockSignals(state) - - if isinstance(x_min, erttypes.time_t): - x_min = x_min.value - - if isinstance(x_max, erttypes.time_t): - x_max = x_max.value - - #todo: time data on y-axis - - state = plot_settings.blockSignals(True) - - self.plotViewSettings.setDataTypes(data.getXDataType(), data.getYDataType()) - self.plotViewSettings.setLimits(x_min, x_max, y_min, y_max) - self.plotViewSettings.setLimitStates(*plot_settings.getLimitStates()) - self.plotViewSettings.plotSelectionChanged(plot_settings.getSelectedMembers()) - - plot_settings.blockSignals(state) - - self.plot.drawPlot() - - @ert_gui.widgets.util.may_take_a_long_time - def select(self, current, previous): - if current: - self.plotDataFetcher.setParameter(current, self.plotContextDataFetcher.data) - cw = self.plotDataFetcher.getConfigurationWidget(self.plotContextDataFetcher.data) - self.plotDataPanel.setConfigurationWidget(cw) - self.plotDataFetcher.fetchContent() - self.drawPlot() - - def updateList(self): - self.plotContextDataFetcher.fetchContent() - self.plotList.clear() - for parameter in self.plotContextDataFetcher.data.parameters: - self.plotList.addItem(parameter) - - self.plotList.sortItems() - - self.plot.setPlotPath(self.plotContextDataFetcher.data.plot_path) - self.plot.setPlotConfigPath(self.plotContextDataFetcher.data.plot_config_path) - - self.plotViewSettings.setCases(self.plotContextDataFetcher.data.getComparableCases()) - - -class PlotViewSettingsPanel(QtGui.QFrame): - - def __init__(self, parent=None, plotView=None, width=100): - QtGui.QFrame.__init__(self, parent) - self.setFrameShape(QtGui.QFrame.StyledPanel) - self.setFrameShadow(QtGui.QFrame.Plain) - self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) - - self.setMinimumWidth(width) - self.setMaximumWidth(width) - - self.plotView = plotView - - layout = QtGui.QVBoxLayout() - - plot_configs = self.plotView.getPlotConfigList() - tabbed_panel = QTabWidget() - tabbed_panel.setTabPosition(QTabWidget.West) - for plot_config in plot_configs: - config_panel = PlotConfigPanel(plot_config) - tabbed_panel.addTab(config_panel, plot_config.name) - self.connect(config_panel, SIGNAL('plotConfigChanged()'), self.plotView.drawPlot) - - layout.addWidget(tabbed_panel) - - tabbed_panel = QTabWidget() - tabbed_panel.setTabPosition(QTabWidget.West) - - tabbed_panel.addTab(self.createMemberSelectionPanel(), "Members") - tabbed_panel.addTab(self.createPlotRangePanel(), "Plot") - tabbed_panel.addTab(self.createButtonLayout(), "Production") - tabbed_panel.setMaximumHeight(250) - - layout.addWidget(tabbed_panel) - - self.setLayout(layout) - - def setDataTypes(self, x_data_type, y_data_type): - self.x_min.showDate(x_data_type == "time") - self.x_max.showDate(x_data_type == "time") - self.y_min.showDate(y_data_type == "time") - self.y_max.showDate(y_data_type == "time") - - - def setLimits(self, x_min, x_max, y_min, y_max): - self.x_min.setValue(x_min) - self.x_max.setValue(x_max) - self.y_min.setValue(y_min) - self.y_max.setValue(y_max) - - def setLimitStates(self, x_min_state, x_max_state, y_min_state, y_max_state): - self.x_min.setChecked(x_min_state) - self.x_max.setChecked(x_max_state) - self.y_min.setChecked(y_min_state) - self.y_max.setChecked(y_max_state) - - def createPlotRangePanel(self): - frame = QFrame() - #frame.setMaximumHeight(150) - #frame.setFrameShape(QFrame.StyledPanel) - #frame.setFrameShadow(QFrame.Plain) - - layout = QFormLayout() - - self.x_min = DisableableSpinner(self.plotView.setMinXLimit) - self.x_max = DisableableSpinner(self.plotView.setMaxXLimit) - - layout.addRow("X min:", self.x_min) - layout.addRow("X max:", self.x_max) - - self.y_min = DisableableSpinner(self.plotView.setMinYLimit) - self.y_max = DisableableSpinner(self.plotView.setMaxYLimit) - - layout.addRow("Y min:", self.y_min) - layout.addRow("Y max:", self.y_max) - - - layout.addWidget(ert_gui.widgets.util.createSeparator()) - - self.plot_compare_to_case = QtGui.QComboBox() - self.plot_compare_to_case.setToolTip("Select case to compare members against.") - - - self.connect(self.plot_compare_to_case, SIGNAL("currentIndexChanged(QString)"), self.select_case) - layout.addRow("Case:", self.plot_compare_to_case) - - frame.setLayout(layout) - return frame - - def select_case(self, case): - self.emit(SIGNAL('comparisonCaseSelected(String)'), str(case)) - - def createButtonLayout(self): - frame = QFrame() - #frame.setMaximumHeight(150) - #frame.setFrameShape(QFrame.StyledPanel) - #frame.setFrameShadow(QFrame.Plain) - - button_layout = QHBoxLayout() - - self.import_button = QtGui.QPushButton() - self.import_button.setIcon(ert_gui.widgets.util.resourceIcon("plugin")) - self.import_button.setIconSize(QtCore.QSize(16, 16)) - self.import_button.setToolTip("Copy settings from another plot.") - - self.save_button = QtGui.QPushButton() - self.save_button.setIcon(ert_gui.widgets.util.resourceIcon("disk")) - self.save_button.setIconSize(QtCore.QSize(16, 16)) - self.save_button.setToolTip("Save a plot.") - - self.save_many_button = QtGui.QPushButton() - self.save_many_button.setIcon(ert_gui.widgets.util.resourceIcon("save_plots")) - self.save_many_button.setIconSize(QtCore.QSize(16, 16)) - self.save_many_button.setToolTip("Save all configured plots.") - - button_layout.addWidget(self.import_button) - button_layout.addWidget(self.save_button) - button_layout.addWidget(self.save_many_button) - - self.connect(self.save_button, QtCore.SIGNAL('clicked()'), self.plotView.save) - self.connect(self.save_many_button, QtCore.SIGNAL('clicked()'), self.plotView.saveAll) - self.connect(self.import_button, QtCore.SIGNAL('clicked()'), self.plotView.copyPlotSettings) - - vertical_layout = QVBoxLayout() - vertical_layout.addLayout(button_layout) - vertical_layout.addStretch(1) - frame.setLayout(vertical_layout) - - return frame - - def createMemberSelectionPanel(self): - frame = QFrame() - #frame.setMinimumHeight(100) - #frame.setMaximumHeight(100) - #frame.setFrameShape(QFrame.StyledPanel) - #frame.setFrameShadow(QFrame.Plain) - - layout = QVBoxLayout() - - self.selected_member_label = QtGui.QLabel() - self.selected_member_label.setWordWrap(True) - - layout.addWidget(QtGui.QLabel("Selected members:")) - layout.addWidget(self.selected_member_label) - - layout.addStretch(1) - - self.clear_button = QtGui.QPushButton() - self.clear_button.setText("Clear selection") - layout.addWidget(self.clear_button) - self.connect(self.clear_button, QtCore.SIGNAL('clicked()'), self.plotView.clearSelection) - - layout.addStretch(1) - frame.setLayout(layout) - - return frame - - def plotSelectionChanged(self, selected_members): - if isinstance(selected_members, plotsettings.PlotSettings): - selected_members = selected_members.getSelectedMembers() - text = "" - for member in selected_members: - text = text + " " + str(member) - self.selected_member_label.setText(text) - - def setCases(self, cases): - state = self.plot_compare_to_case.blockSignals(True) - self.plot_compare_to_case.clear() - self.plot_compare_to_case.addItems(cases) - self.plot_compare_to_case.blockSignals(state) - self.select_case("None") - -class DisableableSpinner(QFrame): - - def __init__(self, func): - QFrame.__init__(self) - self.func = func - - layout = QHBoxLayout() - layout.setMargin(0) - - self.check = QCheckBox() - - self.spinner = QtGui.QDoubleSpinBox() - self.spinner.setSingleStep(1) - self.spinner.setDisabled(True) - self.spinner.setMinimum(-10000000000) - self.spinner.setMaximum(10000000000) - self.spinner.setMaximumWidth(100) - self.connect(self.spinner, QtCore.SIGNAL('valueChanged(double)'), self.update) - - self.date_spinner = QtGui.QDateEdit() - self.date_spinner.setDisabled(True) - self.date_spinner.setDisplayFormat("dd/MM-yyyy") - self.date_spinner.setMaximumWidth(100) - self.date_spinner.setCalendarPopup(True) - self.connect(self.date_spinner, QtCore.SIGNAL('dateChanged(QDate)'), self.update) - - self.connect(self.check, SIGNAL('stateChanged(int)'), self.disabler) - - layout.addWidget(self.check) - layout.addWidget(self.spinner) - layout.addWidget(self.date_spinner) - - - self.setLayout(layout) - - self.showDate(False) - - def update(self, value): - if self.show_date: - seconds = self.qDateToSeconds(value) - self.func(seconds) - else: - self.func(value) - - def disabler(self, state): - disabled = not state == 2 - self.spinner.setDisabled(disabled) - self.date_spinner.setDisabled(disabled) - - if not disabled: - if self.show_date: - seconds = self.qDateToSeconds(self.date_spinner.date()) - self.func(seconds) - else: - self.func(self.spinner.value()) - else: - self.func(None) - - def setChecked(self, state): - self.check.setChecked(state) - - def setValue(self, value): - if not value is None: - if self.show_date: - state = self.date_spinner.blockSignals(True) - self.date_spinner.setDate(self.qDateFromSeconds(value)) - self.date_spinner.blockSignals(state) - else: - state = self.spinner.blockSignals(True) - self.spinner.setValue(value) - self.spinner.blockSignals(state) - - def showDate(self, bool): - self.show_date = bool - self.spinner.setHidden(bool) - self.date_spinner.setHidden(not bool) - - def qDateFromSeconds(self, seconds): - t = time.localtime(seconds) - return QDate(*t[0:3]) - - def qDateToSeconds(self, qdate): - date = qdate.toPyDate() - seconds = int(time.mktime(date.timetuple())) - return seconds - - -class PlotParameterConfigurationPanel(QtGui.QFrame): - def __init__(self, parent=None, width=100): - QtGui.QFrame.__init__(self, parent) - self.setFrameShape(QtGui.QFrame.StyledPanel) - self.setFrameShadow(QtGui.QFrame.Plain) - self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) - - self.setMinimumWidth(width) - self.setMaximumWidth(width) - self.setMaximumHeight(200) - - self.layout = QtGui.QStackedLayout() - self.setLayout(self.layout) - - def setConfigurationWidget(self, widget): - if self.layout.indexOf(widget) == -1: - self.layout.addWidget(widget) - self.layout.setCurrentWidget(widget) - - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotrenderer.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotrenderer.py deleted file mode 100644 index 41f43338fd..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotrenderer.py +++ /dev/null @@ -1,233 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'plotrenderer.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from matplotlib.dates import AutoDateLocator, datetime, matplotlib -import ert.ert.erttypes as erttypes - -class PlotRenderer: - """An abstract plotter that plots data""" - - def drawPlot(self, axes, data, plot_settings): - """ - Override this method in a subclass to create your own plot renderer. - Call PlotRenderer.drawPlot(...) as your last function call. - """ - self._updateLimitsAndZoom(axes, plot_settings, data) - - def _updateLimitsAndZoom(self, axes, plot_settings, data): - """ - Sets the figure so that it shows the correct limits. - This is dependent on limits AND zoom factor. - """ - self._setXViewFactors(axes, plot_settings, data) - self._setYViewFactors(axes, plot_settings, data) - - def __convertDate(self, ert_time): - """Convert normal dates to matplotlib dates.""" - if ert_time is None: - ert_time = erttypes.time_t(0) - - if isinstance(ert_time, datetime.date): - return matplotlib.dates.date2num(ert_time) - else: - return matplotlib.dates.date2num(ert_time.datetime()) - - def _setXViewFactors(self, axes, plot_settings, data): - xminf = plot_settings.getMinXZoom() - xmaxf = plot_settings.getMaxXZoom() - - x_min = plot_settings.getMinXLimit(data.x_min, data.getXDataType()) - x_max = plot_settings.getMaxXLimit(data.x_max, data.getXDataType()) - - if data.getXDataType() == "time": - x_min = self.__convertDate(x_min) - x_max = self.__convertDate(x_max) - - if not x_min is None and not x_max is None: - range = x_max - x_min - axes.set_xlim(x_min + xminf * range - range*0.0, x_min + xmaxf * range + range*0.0) - - def _setYViewFactors(self, axes, plot_settings, data): - yminf = plot_settings.getMinYZoom() - ymaxf = plot_settings.getMaxYZoom() - - y_min = plot_settings.getMinYLimit(data.y_min, data.getYDataType()) - y_max = plot_settings.getMaxYLimit(data.y_max, data.getYDataType()) - - - if not y_min is None and not y_max is None: - range = y_max - y_min - axes.set_ylim(y_min + yminf * range - range*0.0, y_min + ymaxf * range + range*0.0) - - def plot(self, axes, plot_config, x, y): - """Plots a line where x and y are numbers.""" - line = axes.plot(x, - y, - plot_config.style, - color=plot_config.color, - alpha=plot_config.alpha, - zorder=plot_config.z_order, - picker = plot_config.picker, - visible = plot_config.is_visible and plot_config.hasStyle()) - - return line[0] - - def plot_date(self, axes, plot_config, x, y): - """Plots a line where x are dates and y are numbers.""" - line = axes.plot_date(x, - y, - plot_config.style, - color=plot_config.color, - alpha=plot_config.alpha, - zorder=plot_config.z_order, - picker = plot_config.picker, - visible = plot_config.is_visible and plot_config.hasStyle()) - - return line[0] - - def plot_errorbar(self, axes, plot_config, x, y, std_x, std_y): - """Plots errorbars.""" - axes.errorbar(x, - y, - yerr = std_y, - xerr = std_x, - fmt=None, - ecolor=plot_config.color, - alpha=plot_config.alpha, - zorder=plot_config.z_order, - visible = plot_config.is_visible) - - -class DefaultPlotRenderer(PlotRenderer): - def drawPlot(self, axes, data, plot_settings): - axes.set_title(data.getTitle()) - - if data.hasInvertedYAxis() and not axes.yaxis_inverted(): - axes.invert_yaxis() - elif not data.hasInvertedYAxis() and axes.yaxis_inverted(): - axes.invert_yaxis() - - - annotations = plot_settings.getAnnotations() - for annotation in annotations: - coord = (annotation.x, annotation.y) - xytext = None - if not annotation.xt is None and not annotation.yt is None: - xytext = (annotation.xt, annotation.yt) - arrow = dict(arrowstyle="->") - label = str(annotation.label) - annotation_artist = axes.annotate(label, coord, xytext=xytext, xycoords='data', textcoords='data', arrowprops=arrow, picker=1) - annotation.setUserData(annotation_artist) - - self._plotMembers(axes, data, plot_settings) - self._plotComparisonData(axes, data, plot_settings) - - if not data.obs_x is None and not data.obs_y is None: - self._plotObservations(axes, data, plot_settings) - - if not data.obs_std_x is None or not data.obs_std_y is None: - self._plotError(axes, data, plot_settings) - - if not data.refcase_x is None and not data.refcase_y is None and plot_settings.refcase_plot_config.is_visible: - self._plotRefCase(axes, data, plot_settings) - - if data.getXDataType() == "time": - yearsFmt = matplotlib.dates.DateFormatter('%b \'%Y') - axes.xaxis.set_major_formatter(yearsFmt) -# labels = axes.get_xticklabels() -# for label in labels: -# label.set_rotation(30) - - - number_formatter = matplotlib.ticker.ScalarFormatter(useOffset=False) - number_formatter.set_scientific(True) - axes.yaxis.set_major_formatter(number_formatter) - - PlotRenderer.drawPlot(self, axes, data, plot_settings) - - - - def _plotMembers(self, axes, data, plot_settings): - selected_members = plot_settings.getSelectedMembers() - for member in data.x_data.keys(): - x = data.x_data[member] - y = data.y_data[member] - if member in selected_members: - plot_config = plot_settings.selected_plot_config - else: - plot_config = plot_settings.plot_config - if data.getXDataType() == "time": - line = self.plot_date(axes, plot_config, x, y) - else: - line = self.plot(axes, plot_config, x, y) - line.set_gid(member) # to more easily identify the line later (i.e.: picking) - - def _plotComparisonData(self, axes, data, plot_settings): - #selected_members = plot_settings.getSelectedMembers() - for member in data.x_comp_data.keys(): - x = data.x_comp_data[member] - y = data.y_comp_data[member] - #if member in selected_members: - # plot_config = plot_settings.selected_plot_config - #else: - plot_config = plot_settings.comparison_plot_config - if data.getXDataType() == "time": - line = self.plot_date(axes, plot_config, x, y) - else: - line = self.plot(axes, plot_config, x, y) - line.set_gid(member + 10000) # to more easily identify the line later (i.e.: picking) - - - def _plotError(self, axes, data, plot_settings): - x = data.obs_x - y = data.obs_y - x_std = data.obs_std_x - y_std = data.obs_std_y - - if plot_settings.std_plot_config.is_visible: - if data.getXDataType() == "time": - if not y_std is None: - self.plot_date(axes, plot_settings.std_plot_config, x, y - y_std) - self.plot_date(axes, plot_settings.std_plot_config, x, y + y_std) - elif not x_std is None: - self.plot_date(axes, plot_settings.std_plot_config, x - x_std, y) - self.plot_date(axes, plot_settings.std_plot_config, x + x_std, y) - else: - if not y_std is None: - self.plot(axes, plot_settings.std_plot_config, x, y - y_std) - self.plot(axes, plot_settings.std_plot_config, x, y + y_std) - elif not x_std is None: - self.plot(axes, plot_settings.std_plot_config, x - x_std, y) - self.plot(axes, plot_settings.std_plot_config, x + x_std, y) - - if plot_settings.errorbar_plot_config.is_visible: - self.plot_errorbar(axes, plot_settings.errorbar_plot_config, x, y, x_std, y_std) - - def _plotObservations(self, axes, data, plot_settings): - x = data.obs_x - y = data.obs_y - - if data.getXDataType() == "time": - self.plot_date(axes, plot_settings.observation_plot_config, x, y) - else: - self.plot(axes, plot_settings.observation_plot_config, x, y) - - def _plotRefCase(self, axes, data, plot_settings): - x = data.refcase_x - y = data.refcase_y - if data.getXDataType() == "time": - self.plot_date(axes, plot_settings.refcase_plot_config, x, y) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotsettings.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotsettings.py deleted file mode 100644 index 01d1fcb878..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotsettings.py +++ /dev/null @@ -1,308 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'plotsettings.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from plotconfig import PlotConfig -import matplotlib -from ert.ert.erttypes import time_t -import datetime -from PyQt4.QtCore import QObject, SIGNAL, pyqtSignal - -class PlotSettings(QObject): - """ - PlotSettings are the settings used for plotting. - Such as color, transparency, x and y limits, annotations. - """ - - plot_color = (55/255.0, 126/255.0, 200/255.0) # bluish - selected_color = (152/255.0, 78/255.0, 163/255.0) # purple - history_color = (255/255.0, 0/255.0, 0/255.0) # red - refcase_color = (0/255.0, 200/255.0, 0/255.0) # green - comparison_color = (199/255.0, 63/255.0, 0/255.0) # orange - - changed = pyqtSignal(object) - - def __init__(self): - QObject.__init__(self) - - self._xminf = 0.0 - self._xmaxf = 1.0 - self._x_limits = (None, None) - - self._yminf = 0.0 - self._ymaxf = 1.0 - self._y_limits = (None, None) - - self._plot_path = "." - self._plot_config_path = "." - - self.observation_plot_config = PlotConfig("Observation", color = self.history_color, zorder=10) - self.refcase_plot_config = PlotConfig("Refcase", visible=False, color = self.refcase_color, zorder=10) - self.std_plot_config = PlotConfig("Error", linestyle=":", visible=False, color = self.history_color, zorder=10) - self.plot_config = PlotConfig("Members", color = self.plot_color, alpha=0.125, zorder=2, picker=2) - self.selected_plot_config = PlotConfig("Selected members", color = self.selected_color, alpha=0.5, zorder=8, - picker=2) - self.errorbar_plot_config = PlotConfig("Errorbars", visible=False, color = self.history_color, alpha=0.5, - zorder=10) - self.comparison_plot_config = PlotConfig("Comparison", color = self.comparison_color, alpha=0.125, zorder=1, visible=True, linestyle="-") - - self._plot_configs = [self.plot_config, - self.selected_plot_config, - self.refcase_plot_config, - self.observation_plot_config, - self.std_plot_config, - self.errorbar_plot_config, - self.comparison_plot_config] - - for pc in self._plot_configs: - self.changed.connect( self.notify ) - - self._plot_config_dict = {} - for pc in self._plot_configs: - self._plot_config_dict[pc.name] = pc - - self._selected_members = [] - - self._annotations = [] - - def notify(self, *args): - """Tell listeners that the settings has changed. Automatically called by all setters.""" - self.emit(SIGNAL('plotSettingsChanged(PlotSettings)'), self) - - def getPlotConfigList(self): - """Get a list of PlotConfig instances.""" - return self._plot_configs - - def getPlotConfigDict(self): - """Get a dictionary of PlotConfig instances.""" - return self._plot_config_dict - - def getLimitsTuple(self): - """Get the limits as a tuple: (x_min, x_max, y_min, y_max)""" - return (self._x_limits[0], self._x_limits[1], self._y_limits[0], self._y_limits[1]) - - def getZoomTuple(self): - """Get the zoom factors as a tuple: (x_min, x_max, y_min, y_max)""" - return (self._xminf, self._xmaxf, self._yminf, self._ymaxf) - - def selectMember(self, member): - """Set a member as selected.""" - if not member in self._selected_members: - self._selected_members.append(int(member)) - self.notify() - - def unselectMember(self, member): - """Set a member as unselected.""" - member = int(member) - if member in self._selected_members: - self._selected_members.remove(member) - self.notify() - - def clearMemberSelection(self): - """Clear the list of selected members.""" - self._selected_members = [] - self.notify() - - def getSelectedMembers(self): - """Returns the list of selected members.""" - return self._selected_members - - def setMinYLimit(self, value): - """Set the lower limit of the Y axis. Can be set to None.""" - if not value == self._y_limits[0]: - self._y_limits = (value, self._y_limits[1]) - self.notify() - - def getMinYLimit(self, y_min, data_type=""): - """Return the lower limit of the Y Axis. Returns y_min if the internal value is None.""" - if self._y_limits[0] is None: - return y_min - else: - return self._y_limits[0] - - def setMaxYLimit(self, value): - """Set the upper limit of the Y axis. Can be set to None.""" - if not value == self._y_limits[1]: - self._y_limits = (self._y_limits[0], value) - self.notify() - - def getMaxYLimit(self, y_max, data_type=""): - """Return the upper limit of the Y Axis. Returns y_max if the internal value is None.""" - if self._y_limits[1] is None: - return y_max - else: - return self._y_limits[1] - - def setMinXLimit(self, value): - """Set the lower limit of the X axis. Can be set to None.""" - if not value == self._x_limits[0]: - self._x_limits = (value, self._x_limits[1]) - self.notify() - - def getMinXLimit(self, x_min, data_type): - """Returns the provided x_min value if the internal x_min value is None. Converts dates to numbers""" - if self._x_limits[0] is None: - x_limit = x_min - else: - x_limit = self._x_limits[0] - - if not x_limit is None and data_type == "time" and not isinstance(x_limit, time_t): - x_limit = time_t(long(round(x_limit))) - - return x_limit - - def setMaxXLimit(self, value): - """Set the upper limit of the X axis. Can be set to None.""" - if not value == self._x_limits[1]: - self._x_limits = (self._x_limits[0], value) - self.notify() - - def getMaxXLimit(self, x_max, data_type): - """Returns the provided x_max value if the internal x_max value is None. Converts dates to numbers""" - if self._x_limits[1] is None: - x_limit = x_max - else: - x_limit = self._x_limits[1] - - if not x_limit is None and data_type == "time" and not isinstance(x_limit, time_t): - x_limit = time_t(long(round(x_limit))) - - return x_limit - - def getLimitStates(self): - """ - Returns a tuple of True/False values. - (not x_min is None, not x_max is None, not y_min is None, not y_max is None) - """ - x_min_state = not self._x_limits[0] is None - x_max_state = not self._x_limits[1] is None - y_min_state = not self._y_limits[0] is None - y_max_state = not self._y_limits[1] is None - return (x_min_state, x_max_state, y_min_state, y_max_state) - - def setPlotPath(self, plot_path): - """Set the path to store plot images in.""" - if not plot_path == self._plot_path: - self._plot_path = plot_path - self.notify() - - def setPlotConfigPath(self, plot_config_path): - """Set the path to store plot settings files in.""" - if not plot_config_path == self._plot_config_path: - self._plot_config_path = plot_config_path - self.notify() - - def getPlotPath(self): - """The path to store plot images in.""" - return self._plot_path - - def getPlotConfigPath(self): - """The path to store plot settings in.""" - return self._plot_config_path - - def setMinXZoom(self, value): - """Set the x_min zoom factor. [0,1]""" - if not self._xminf == value: - self._xminf = value - self.notify() - - def setMaxXZoom(self, value): - """Set the x_max zoom factor. [0,1]""" - if not self._xmaxf == value: - self._xmaxf = value - self.notify() - - def setMinYZoom(self, value): - """Set the y_min zoom factor. [0,1]""" - if not self._yminf == value: - self._yminf = value - self.notify() - - def setMaxYZoom(self, value): - """Set the y_max zoom factor. [0,1]""" - if not self._ymaxf == value: - self._ymaxf = value - self.notify() - - def getMinXZoom(self): - """Returns the x_min zoom factor.""" - return self._xminf - - def getMaxXZoom(self): - """Returns the x_max zoom factor.""" - return self._xmaxf - - def getMinYZoom(self): - """Returns the y_min zoom factor.""" - return self._yminf - - def getMaxYZoom(self): - """Returns the y_max zoom factor.""" - return self._ymaxf - - def getAnnotations(self): - """Return a list of annotations.""" - return self._annotations - - def clearAnnotations(self): - """Remove all annotations.""" - if len(self._annotations) > 0: - self._annotations = [] - self.notify() - - def addAnnotation(self, label, x, y, xt, yt): - """ - Add an annotation. x, y, xt, yt are in data coordinates. - If any axis represents time. Use matplotlib time values. - (Float days since 2000.01.01, starting from 1) - Returns the annotation as a PlotAnnotation object. - """ - annotation = PlotAnnotation(label, x, y, xt, yt) - self._annotations.append(annotation) - self.notify() - return annotation - - def removeAnnotation(self, annotation): - """Remove an annotation. Expects PlotAnnotation instance.""" - if annotation in self._annotations: - self._annotations.remove(annotation) - self.notify() - - -class PlotAnnotation: - """An annotation representation.""" - def __init__(self, label, x, y, xt, yt): - self.label = label - self.x = x - self.y = y - self.xt = xt - self.yt = yt - - def setUserData(self, user_data): - """Usually used to store the matplotlib artist corresponding to this annotation.""" - self._user_data = user_data - - def getUserData(self): - """Usually the matplotlib artist corresponding to this annotation.""" - return self._user_data - - - - - - - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotsettingsxml.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotsettingsxml.py deleted file mode 100644 index 2feaba71ff..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotsettingsxml.py +++ /dev/null @@ -1,389 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'plotsettingsxml.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -import xml.dom.minidom -import os - -class PlotSettingsSaver: - """Save a PlotSettings instance to a xml-file.""" - def save(self, name, plot_settings): - """Save plot configuration to a file with the specified name as filename.""" - self.doc = xml.dom.minidom.Document() - - self.root_element = self.doc.createElement("plot_configuration") - self.root_element.setAttribute("name", name) - self.doc.appendChild(self.root_element) - - plot_configs = plot_settings.getPlotConfigList() - - for plot_config in plot_configs: - self.__addPlotConfig(plot_config) - - self.__addLimits(plot_settings.getLimitsTuple(), plot_settings.getZoomTuple()) - self.__addSelectedMembers(plot_settings.getSelectedMembers()) - - self.__addAnnotations(plot_settings.getAnnotations()) - - path = "%s/config" % plot_settings.getPlotConfigPath() - if not os.path.exists( path ): - os.mkdir( path ) - - file_object = open("%s/%s.xml" % (path, name), "w") - file_object.write(self.doc.toprettyxml()) - file_object.close() - - def __addPlotConfig(self, plot_config): - """Add a plot config to the xml""" - pc_element = self.doc.createElement("plot_config") - self.root_element.appendChild(pc_element) - pc_element.setAttribute("name", str(plot_config.name)) - pc_element.setAttribute("visible", str(plot_config.is_visible)) - pc_element.setAttribute("z_order", str(plot_config.z_order)) - pc_element.setAttribute("picker", str(plot_config.picker)) - - color = plot_config.color - alpha = plot_config.alpha - - color_element = self.doc.createElement("color") - pc_element.appendChild(color_element) - - color_element.setAttribute("alpha", str(alpha)) - color_element.setAttribute("red", str(color[0])) - color_element.setAttribute("green", str(color[1])) - color_element.setAttribute("blue", str(color[2])) - - style_element = self.doc.createElement("style") - pc_element.appendChild(style_element) - - style_element.setAttribute("line", str(plot_config.linestyle)) - style_element.setAttribute("marker", str(plot_config.marker)) - - - def __addComment(self, element, comment): - comment_element = self.doc.createComment(comment) - element.appendChild(comment_element) - - def __addComments(self, limits_element): - comment1 = "When limit values represent a date, the date is stored "\ - "as the number of seconds since 1/1-1970." - self.__addComment(limits_element, comment1) - - - comment2 = "Setting a limit value to None means that the program should "\ - "use the corresponding value from the dataset as limits." - self.__addComment(limits_element, comment2) - - def __addLimits(self, limits, zoom): - """Add limits and zoom to the xml""" - element = self.doc.createElement("limits_and_zoom") - self.root_element.appendChild(element) - - limits_element = self.doc.createElement("limits") - - self.__addComments(limits_element) - - element.appendChild(limits_element) - limits_element.setAttribute("x_min", str(limits[0])) - limits_element.setAttribute("x_max", str(limits[1])) - limits_element.setAttribute("y_min", str(limits[2])) - limits_element.setAttribute("y_max", str(limits[3])) - - zoom_element = self.doc.createElement("zoom") - element.appendChild(zoom_element) - zoom_element.setAttribute("x_min", str(zoom[0])) - zoom_element.setAttribute("x_max", str(zoom[1])) - zoom_element.setAttribute("y_min", str(zoom[2])) - zoom_element.setAttribute("y_max", str(zoom[3])) - - def __addSelectedMembers(self, selected_members): - """Add list of selected members to the xml""" - element = self.doc.createElement("selected_members") - self.root_element.appendChild(element) - - for selected_member in selected_members: - member = self.doc.createElement("member") - element.appendChild(member) - member.setAttribute("id", str(selected_member)) - - def __addAnnotations(self, annotations): - """Add list of annotations to the xml""" - element = self.doc.createElement("annotations") - self.root_element.appendChild(element) - - comment = "If any of the axis represents time the format is matplotlib specific: "\ - "A date is a floating point number which represent time in days since 0001-01-01 UTC, plus 1. "\ - "For example, 0001-01-01, 06:00 is 1.25, not 0.25" - self.__addComment(element, comment) - - for annotation in annotations: - annotation_element = self.doc.createElement("annotation") - element.appendChild(annotation_element) - annotation_element.setAttribute("label", str(annotation.label)) - annotation_element.setAttribute("x", str(annotation.x)) - annotation_element.setAttribute("y", str(annotation.y)) - annotation_element.setAttribute("xt", str(annotation.xt)) - annotation_element.setAttribute("yt", str(annotation.yt)) - - -class PlotSettingsLoader: - """Load or copy data from a PlotSettings xml-file.""" - def __init__(self): - self.skip_plot_settings = False - self.skip_limits_and_zoom = False - self.skip_selected_members = False - self.skip_annotations = False - - def skipPlotSettings(self, bool=True): - """Tell the loader to skip plot configs.""" - self.skip_plot_settings = bool - - def skipLimitsAndZoom(self, bool=True): - """Tell the loader to skip limits and zoom factors.""" - self.skip_limits_and_zoom = bool - - def skipSelectedMembers(self, bool=True): - """Tell the loader to skip selected members.""" - self.skip_selected_members = bool - - def skipAnnotations(self, bool=True): - """Tell the loader to skip annotations.""" - self.skip_annotations = bool - - def copy(self, plot_settings): - """Pops up a dialog where the user can choose another settings file to copy settings from.""" - pscd = PlotSettingsCopyDialog(plot_settings) - success = pscd.exec_() - if success: - self.skipPlotSettings(not pscd.shouldCopyPlotSettings()) - self.skipLimitsAndZoom(not pscd.shouldCopyRangeLimits()) - self.skipSelectedMembers(not pscd.shouldCopySelectedMembers()) - self.skipAnnotations(not pscd.shouldCopyAnnotations()) - self.load(pscd.getName(), plot_settings) - - - def load(self, name, plot_settings): - """Load settings into the provided settings file from a plot settings file with the specified name.""" - filename = "%s/config/%s.xml" % (plot_settings.getPlotConfigPath(), name) - - if os.path.exists(filename): - self.doc = xml.dom.minidom.parse(filename) - - block_state = plot_settings.blockSignals(True) # we only want one emit from plot_settings so we only get one redraw - - if not self.skip_plot_settings: - self.__loadPlotConfigs(plot_settings) - - if not self.skip_limits_and_zoom: - self.__loadLimitsAndZoom(plot_settings) - - if not self.skip_selected_members: - self.__loadSelectedMembers(plot_settings) - - if not self.skip_annotations: - self.__loadAnnotations(plot_settings) - - plot_settings.blockSignals(block_state) - plot_settings.notify() - return True - else: - return False - - def __loadPlotConfigs(self, plot_settings): - plot_config_dict = plot_settings.getPlotConfigDict() - xml_plot_configs = self.doc.getElementsByTagName("plot_config") - - for xml_plot_config in xml_plot_configs: - name = xml_plot_config.getAttribute("name") - plot_config = plot_config_dict[name] - visible = xml_plot_config.getAttribute("visible") - z_order = xml_plot_config.getAttribute("z_order") - picker = xml_plot_config.getAttribute("picker") - - plot_config.is_visible = visible.lower() == "true" - plot_config.z_order = int(z_order) - - if picker.lower() == "none": - plot_config.picker = None - else: - plot_config.picker = int(picker) - - xml_color = xml_plot_config.getElementsByTagName("color")[0] - - a = xml_color.getAttribute("alpha") - r = xml_color.getAttribute("red") - g = xml_color.getAttribute("green") - b = xml_color.getAttribute("blue") - - plot_config.alpha = float(a) - plot_config.color = (float(r), float(g), float(b)) - - xml_style = xml_plot_config.getElementsByTagName("style")[0] - - linestyle = xml_style.getAttribute("line") - marker = xml_style.getAttribute("marker") - - plot_config.linestyle = linestyle - plot_config.marker = marker - - - def floatify(self, f): - if f.lower() == "none": - return None - else: - return float(f) - - def __loadLimitsAndZoom(self, plot_settings): - xml_limits_and_zoom = self.doc.getElementsByTagName("limits_and_zoom")[0] - - xml_limits = xml_limits_and_zoom.getElementsByTagName("limits")[0] - x_min = xml_limits.getAttribute("x_min") - x_max = xml_limits.getAttribute("x_max") - y_min = xml_limits.getAttribute("y_min") - y_max = xml_limits.getAttribute("y_max") - - plot_settings.setMinXLimit(self.floatify(x_min)) - plot_settings.setMaxXLimit(self.floatify(x_max)) - plot_settings.setMinYLimit(self.floatify(y_min)) - plot_settings.setMaxYLimit(self.floatify(y_max)) - - xml_zoom = xml_limits_and_zoom.getElementsByTagName("zoom")[0] - - x_min = xml_zoom.getAttribute("x_min") - x_max = xml_zoom.getAttribute("x_max") - y_min = xml_zoom.getAttribute("y_min") - y_max = xml_zoom.getAttribute("y_max") - - plot_settings.setMinXZoom(self.floatify(x_min)) - plot_settings.setMaxXZoom(self.floatify(x_max)) - plot_settings.setMinYZoom(self.floatify(y_min)) - plot_settings.setMaxYZoom(self.floatify(y_max)) - - def __loadSelectedMembers(self, plot_settings): - xml_selected_members = self.doc.getElementsByTagName("selected_members")[0] - - xml_members = xml_selected_members.getElementsByTagName("member") - - plot_settings.clearMemberSelection() - for member in xml_members: - m = member.getAttribute("id") - plot_settings.selectMember(int(m)) - - def __loadAnnotations(self, plot_settings): - xml_annotations_element = self.doc.getElementsByTagName("annotations")[0] - - xml_annotations = xml_annotations_element.getElementsByTagName("annotation") - - plot_settings.clearAnnotations() - for annotation in xml_annotations: - label = annotation.getAttribute("label") - x = annotation.getAttribute("x") - y = annotation.getAttribute("y") - xt = annotation.getAttribute("xt") - yt = annotation.getAttribute("yt") - - plot_settings.addAnnotation(label, self.floatify(x), self.floatify(y), self.floatify(xt), self.floatify(yt)) - - -from PyQt4.QtGui import QDialog, QFormLayout, QLabel, QDialogButtonBox, QComboBox, QCheckBox -from PyQt4.QtCore import Qt, SIGNAL -from ert_gui.widgets.util import createSpace - -class PlotSettingsCopyDialog(QDialog): - """A dialog for selecting what settings to copy from another settings file.""" - def __init__(self, plot_settings, parent = None): - QDialog.__init__(self, parent) - - self.setModal(True) - self.setWindowTitle("Copy plot settings") - self.setMinimumWidth(250) - self.setMinimumHeight(150) - - layout = QFormLayout() - - self.settings_list = QComboBox() - - files = self.listSettings(plot_settings.getPlotConfigPath() + "/config") - - for file in files: - index = file.find(".xml") - name = file[0:index] - self.settings_list.addItem(name) - - self.check_plot_settings = QCheckBox() - self.check_plot_settings.setChecked(True) - self.check_range_limits = QCheckBox() - self.check_range_limits.setChecked(True) - self.check_selected_members = QCheckBox() - self.check_selected_members.setChecked(True) - self.check_annotations = QCheckBox() - self.check_annotations.setChecked(True) - - layout.addRow(createSpace(10)) - layout.addRow("Copy from:", self.settings_list) - layout.addRow("Plot settings:", self.check_plot_settings) - layout.addRow("Range limits:", self.check_range_limits) - layout.addRow("Selected members:", self.check_selected_members) - layout.addRow("Annotations:", self.check_annotations) - - layout.addRow(createSpace(10)) - - buttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self) - - layout.addRow(buttons) - - self.connect(buttons, SIGNAL('accepted()'), self.accept) - self.connect(buttons, SIGNAL('rejected()'), self.reject) - - self.setLayout(layout) - - def getName(self): - """Return the name of the source.""" - return str(self.settings_list.currentText()).strip() - - def shouldCopyPlotSettings(self): - return self.check_plot_settings.isChecked() - - def shouldCopyRangeLimits(self): - return self.check_range_limits.isChecked() - - def shouldCopySelectedMembers(self): - return self.check_selected_members.isChecked() - - def shouldCopyAnnotations(self): - return self.check_annotations.isChecked() - - def listSettings(self, path): - """Returns a list of settings filenames.""" - files = os.listdir(path) - return sorted(filter(self.xmlFilter, files)) - - def xmlFilter(self, file): - """Filter .xml files from a list of filenames""" - return file.endswith(".xml") - - - - - - - - - - - - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotview.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotview.py deleted file mode 100644 index 5c1e12618a..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/plotview.py +++ /dev/null @@ -1,228 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'plotview.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas - -import datetime -import time -from ert.ert.erttypes import time_t - -from ert_gui.widgets.util import print_timing -from ert_gui.pages.plot.plotdata import PlotData -import ert_gui.widgets - -from PyQt4.QtCore import SIGNAL -import os - -from plotconfig import PlotConfig -from plotfigure import PlotFigure, matplotlib - -from PyQt4.QtGui import QFrame, QInputDialog, QSizePolicy -from plotsettingsxml import PlotSettingsSaver, PlotSettingsLoader -from plotsettings import PlotSettings -from plotsettingsxml import PlotSettingsCopyDialog -from plotgenerator import PlotGenerator - -class PlotView(QFrame): - """PlotView presents a matplotlib canvas with interaction possibilities. (picking and tooltip)""" - - def __init__(self): - """Create a PlotView instance""" - QFrame.__init__(self) - self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) - - # setup some default data values - self.data = PlotData() - self.data.x_data_type = "number" - self.data.setValid(False) - - self.plot_figure = PlotFigure() - self.plot_settings = PlotSettings() - - self.canvas = FigureCanvas(self.plot_figure.getFigure()) - self.canvas.setParent(self) - self.canvas.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) - - self.mouse_handler = MouseHandler(self) - - def toggleMember(self, line): - gid = int(line.get_gid()) - if gid in self.plot_settings.getSelectedMembers(): - self.plot_settings.unselectMember(gid) - else: - self.plot_settings.selectMember(gid) - - @ert_gui.widgets.util.may_take_a_long_time - def drawPlot(self): - self.plot_figure.drawPlot(self.data, self.plot_settings) - self.canvas.draw() - - def resizeEvent(self, event): - QFrame.resizeEvent(self, event) - self.canvas.resize(event.size().width(), event.size().height()) - - def loadSettings(self, name): - if self.data.isValid(): - plot_config_loader = PlotSettingsLoader() - if not plot_config_loader.load(name, self.plot_settings): - self.drawPlot() - - def saveSettings(self): - if self.data.isValid(): - plot_config_saver = PlotSettingsSaver() - plot_config_saver.save(self.data.getSaveName(), self.plot_settings) - - def setData(self, data): - self.saveSettings() - - self.data = data - - self.loadSettings(self.data.getSaveName()) - - - def setXZoomFactors(self, xminf, xmaxf): - self.plot_settings.setMinXZoom(xminf) - self.plot_settings.setMaxXZoom(xmaxf) - - def setYZoomFactors(self, yminf, ymaxf): - self.plot_settings.setMinYZoom(yminf) - self.plot_settings.setMaxYZoom(ymaxf) - - def save(self): - self.saveSettings() - - plot_generator = PlotGenerator(self.plot_settings.getPlotPath(), self.plot_settings.getPlotConfigPath()) - plot_generator.save(self.data) - - def saveAll(self): - self.saveSettings() - - plot_generator = PlotGenerator(self.plot_settings.getPlotPath(), self.plot_settings.getPlotConfigPath()) - plot_generator.saveAll() - - def copyPlotSettings(self): - plot_config_loader = PlotSettingsLoader() - plot_config_loader.copy(self.plot_settings) - - def setPlotPath(self, plot_path): - self.plot_settings.setPlotPath(plot_path) - - def setPlotConfigPath(self, path): - self.plot_settings.setPlotConfigPath(path) - - def _selectedMemberIdentifier(self, artist): - return artist.get_gid() in self.plot_settings.getSelectedMembers() - - def clearSelection(self): - selected_lines = self.plot_figure.fig.findobj(self._selectedMemberIdentifier) - for line in selected_lines: - self.plot_settings.unselectMember(line.get_gid()) - - - def displayToolTip(self, event): - if not self.data is None and not event.xdata is None and not event.ydata is None: - if self.data.getXDataType() == "time": - date = matplotlib.dates.num2date(event.xdata) - self.setToolTip("x: %s y: %04f" % (date.strftime("%d/%m-%Y"), event.ydata)) - else: - self.setToolTip("x: %04f y: %04f" % (event.xdata, event.ydata)) - else: - self.setToolTip("") - - def annotate(self, label, x, y, xt=None, yt=None): - self.plot_settings.addAnnotation(label, x, y, xt, yt) - - def removeAnnotation(self, annotation_artist): - annotations = self.plot_settings.getAnnotations() - for annotation in annotations: - if annotation.getUserData() == annotation_artist: - self.plot_settings.removeAnnotation(annotation) - - def moveAnnotation(self, annotation_artist, xt, yt): - annotations = self.plot_settings.getAnnotations() - for annotation in annotations: - if annotation.getUserData() == annotation_artist: - annotation.xt = xt - annotation.yt = yt - - annotation_artist.xytext = (xt, yt) - - def draw(self): - self.canvas.draw() - - def setMinYLimit(self, value): - self.plot_settings.setMinYLimit(value) - - def setMaxYLimit(self, value): - self.plot_settings.setMaxYLimit(value) - - def setMinXLimit(self, value): - self.plot_settings.setMinXLimit(value) - - def setMaxXLimit(self, value): - self.plot_settings.setMaxXLimit(value) - - def getPlotConfigList(self): - return self.plot_settings.getPlotConfigList() - -class MouseHandler: - - def __init__(self, plot_view): - self.plot_view = plot_view - - fig = plot_view.plot_figure.getFigure() - fig.canvas.mpl_connect('button_press_event', self.on_press) - fig.canvas.mpl_connect('button_release_event', self.on_release) - fig.canvas.mpl_connect('pick_event', self.on_pick) - fig.canvas.mpl_connect('motion_notify_event', self.motion_notify_event) - - self.button_position = None - self.artist = None - - def on_press(self, event): - if event.button == 3 and self.artist is None and not event.xdata is None and not event.ydata is None: - label, success = QInputDialog.getText(self.plot_view, "New label", "Enter label:") - - if success and not str(label).strip() == "": - self.plot_view.annotate(str(label), event.xdata, event.ydata) - self.plot_view.draw() - - def on_release(self, event): - self.button_position = None - self.artist = None - - def on_pick(self, event): - if isinstance(event.artist, matplotlib.lines.Line2D) and event.mouseevent.button == 1: - self.plot_view.toggleMember(event.artist) - elif isinstance(event.artist, matplotlib.text.Annotation) and event.mouseevent.button == 1: - self.artist = event.artist - self.button_position = (event.mouseevent.x, event.mouseevent.y) - return True - elif isinstance(event.artist, matplotlib.text.Annotation) and event.mouseevent.button == 3: - self.artist = event.artist - self.plot_view.removeAnnotation(self.artist) - self.plot_view.draw() - - def motion_notify_event(self, event): - if self.artist is None: - self.plot_view.displayToolTip(event) - elif isinstance(self.artist, matplotlib.text.Annotation): - if not event.xdata is None and not event.ydata is None: - self.plot_view.moveAnnotation(self.artist, event.xdata, event.ydata) - self.plot_view.draw() - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/rftfetcher.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/rftfetcher.py deleted file mode 100644 index de87e4860c..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/rftfetcher.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'rftfetcher.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from fetcher import PlotDataFetcherHandler -import ert.ert.ertwrapper as ertwrapper -import ert.ert.enums as enums -from ert.ert.enums import ert_state_enum, obs_impl_type -import numpy - -class RFTFetcher(PlotDataFetcherHandler): - - def __init__(self): - PlotDataFetcherHandler.__init__(self) - - def initialize(self, ert): - self.initialized = True - - def isHandlerFor(self, ert, key): - enkf_obs = ert.main.get_obs - key_list = enkf_obs.alloc_typed_keylist(obs_impl_type.GEN_OBS.value()) - return key in key_list - - def fetch(self, ert, key, parameter, data, comparison_fs): - enkf_obs = ert.main.get_obs - obs_vector = enkf_obs.get_vector(key) - - num_active = obs_vector.get_num_active - if num_active == 1: - report_step = obs_vector.get_active_report_step - elif num_active > 1: - history_length = ert.main.get_history_length - active = [] - for index in range(history_length): - if obs_vector.iget_active(index): - active.append(index) - print "Active:", active - report_step = active[0] #todo: enable selection from GUI - else: - return - - fs = ert.main.get_fs - state_kw = obs_vector.get_state_kw - - ens_size = ert.main.get_ensemble_size - - config_node = ert.main.ensemble_config.get_node(state_kw) - field_config = config_node.get_ref - block_obs = obs_vector.iget_node(report_step) - - obs_size = block_obs.get_size - grid = field_config.get_grid - - node = config_node.alloc_node - - y_obs = [] - x_obs = [] - x_std = [] - xpos = (ertwrapper.c_double)() - ypos = (ertwrapper.c_double)() - zpos = (ertwrapper.c_double)() - value = (ertwrapper.c_double)() - std = (ertwrapper.c_double)() - for index in range(obs_size): - grid.get_xyz3(block_obs.iget_i(index),block_obs.iget_j(index),block_obs.iget_k(index), xpos, ypos , zpos) - y_obs.append(zpos.value) - block_obs.iget(index, value, std) - x_obs.append(value.value) - x_std.append(std.value) - data.checkMaxMin(value.value + std.value) - data.checkMaxMin(value.value - std.value) - data.obs_y = numpy.array(y_obs) - data.obs_x = numpy.array(x_obs) - data.obs_std_x = numpy.array(x_std) - data.obs_std_y = None - var_type = enums.enkf_var_type.DYNAMIC_RESULT - - for member in range(ens_size): - if node.vector_storage: - if fs.has_vector(config_node, member, ert_state_enum.ANALYZED.value()): - fs.fread_vector(node, member, ert_state_enum.ANALYZED.value()) - elif fs.has_vector(config_node, member, ert_state_enum.FORECAST.value()): - fs.fread_vector(node, member, ert_state_enum.FORECAST.value()) - else: - print "No data found for member %d/%d." % (member, report_step) - continue - else: - if fs.has_node(config_node, var_type, report_step, member, ert_state_enum.ANALYZED.value()): - fs.fread_node(node, var_type, report_step, member, ert_state_enum.ANALYZED.value()) - elif fs.has_node(config_node, var_type, report_step, member, ert_state_enum.FORECAST.value()): - fs.fread_node(node, var_type, report_step, member, ert_state_enum.FORECAST.value()) - else: - print "No data found for member %d/%d." % (member, report_step) - continue - - data.x_data[member] = [] - data.y_data[member] = [] - x_data = data.x_data[member] - y_data = data.y_data[member] - - field = node.value_ptr - for index in range(obs_size): - value = field.ijk_get_double(i[index] , j[index] , k[index]) - x_data.append(value) - y_data.append(y_obs[index]) - data.checkMaxMin(value) - - data.x_data[member] = numpy.array(x_data) - data.y_data[member] = numpy.array(y_data) - - if not comparison_fs is None: - comp_node = config_node.alloc - for member in range(ens_size): - if comparison_fs.has_node(config_node, report_step, member, ert_state_enum.ANALYZED.value()): - comparison_fs.fread_node(comp_node, report_step, member, ert_state_enum.ANALYZED.value()) - elif comparison_fs.has_node(config_node, report_step, member, ert_state_enum.FORECAST.value()): - comparison_fs.fread_node(comp_node, report_step, member, ert_state_enum.FORECAST.value()) - else: - print "No data found for member %d/%d." % (member, report_step) - continue - - data.x_comp_data[member] = [] - data.y_comp_data[member] = [] - x_data = data.x_comp_data[member] - y_data = data.y_comp_data[member] - - field = ert.enkf.enkf_node_value_ptr(comp_node) - for index in range(obs_size): - value = field.ijk_get_double(block_obs.iget_i(index),block_obs.iget_j(index),block_obs.iget_k(index)) - x_data.append(value) - y_data.append(y_obs[index]) - data.checkMaxMin(value) - - data.x_comp_data[member] = numpy.array(x_data) - data.y_comp_data[member] = numpy.array(y_data) - - comp_node.free - - node.free - - data.x_data_type = "number" - data.inverted_y_axis = True - - def getConfigurationWidget(self, context_data): - return None - - def configure(self, parameter, context_data): - pass #nothing to configure, yet - - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/zoomslider.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/zoomslider.py deleted file mode 100644 index 72fd79558c..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/plot/zoomslider.py +++ /dev/null @@ -1,219 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'zoomslider.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4.QtGui import QFrame, QPainter, QColor -from PyQt4.QtCore import QRectF, SIGNAL -from PyQt4.Qt import QApplication, Qt - -class ZoomSlider(QFrame): - """ - Two way slider representing narrowing of a view. - The sliders coorespond to factors: a min value and a max value in the range [0, 1] - Emits zoomValueChanged(float, float) whenever the markers are adjusted. (float, float) -> (min, max) - """ - def __init__(self, parent=None, horizontal=True): - QFrame.__init__(self, parent) - - self.horizontal = horizontal - if horizontal: - self.setFrameShape(QFrame.HLine) - self.setMinimumHeight(21) - self.tilt = 90 - else: - self.setFrameShape(QFrame.VLine) - self.setMinimumWidth(21) - self.tilt = 180 - - self.setFrameShadow(QFrame.Sunken) - self.setMidLineWidth(3) - - self.setMouseTracking(True) - - self.size = 12 - - self.min_value = 0.0 - self.max_value = 1.0 - - self.setDefaultColors() - self.button = Qt.NoButton - self.selected_marker = 'none' - - - def paintEvent(self, paint_event): - QFrame.paintEvent(self, paint_event) - painter = QPainter(self) - painter.setRenderHint(QPainter.Antialiasing) - - w = self.width() - h = self.height() - - if self.horizontal: - self.min_marker = QRectF(w * self.min_value, 4, self.size, self.size) - self.max_marker = QRectF(w * self.max_value - self.size - 1, 4, self.size, self.size) - else: - self.min_marker = QRectF(4, h - h * self.min_value - self.size - 1, self.size, self.size) - self.max_marker = QRectF(4, h - h * self.max_value, self.size, self.size) - - pen = painter.pen() - pen.setWidth(0) - pen.setColor(QApplication.palette().background().color().dark()) - painter.setPen(pen) - - painter.setBrush(self.min_marker_brush) - painter.drawPie(self.min_marker, self.tilt * 16, 180 * 16) - - painter.setBrush(self.max_marker_brush) - painter.drawPie(self.max_marker, self.tilt * 16, -180 * 16) - - def resizeEvent (self, resize_event): - QFrame.resizeEvent(self, resize_event) - - - def _getMinTestMarker(self): - """Returns the "real" marker bounds. Adjusted for the missing part of an arc.""" - if self.horizontal: - return QRectF(self.min_marker.left(), - self.min_marker.top(), - self.min_marker.width() / 2.0, - self.min_marker.height()) - else: - return QRectF(self.min_marker.left(), - self.min_marker.top() + self.min_marker.height() / 2.0, - self.min_marker.width(), - self.min_marker.height() / 2.0) - - def _getMaxTestMarker(self): - """Returns the "real" marker bounds. Adjusted for the missing part of an arc.""" - if self.horizontal: - return QRectF(self.max_marker.left() + self.max_marker.width() / 2.0, - self.max_marker.top(), - self.max_marker.width() / 2.0, - self.max_marker.height()) - - else: - return QRectF(self.max_marker.left(), - self.max_marker.top(), - self.max_marker.width(), - self.max_marker.height() / 2.0) - - def mouseMoveEvent (self, mouse_event): - """Dragging or highlighting the markers.""" - self.setDefaultColors() - - min_test_marker = self._getMinTestMarker() - - if min_test_marker.contains(mouse_event.x(), mouse_event.y()) or self.selected_marker == 'min': - self.min_marker_brush = self.getDefaultHighlightColor() - - if self.selected_marker == 'min': - if self.horizontal: - value = mouse_event.x() / float(self.width()) - else: - value = (self.height() - mouse_event.y()) / float(self.height()) - - self.setMinValue(value, False) - - max_test_marker = self._getMaxTestMarker() - - if max_test_marker.contains(mouse_event.x(), mouse_event.y()) or self.selected_marker == 'max': - self.max_marker_brush = self.getDefaultHighlightColor() - - if self.selected_marker == 'max': - if self.horizontal: - value = mouse_event.x() / float(self.width()) - else: - value = (self.height() - mouse_event.y()) / float(self.height()) - - self.setMaxValue(value, False) - - self.update() - - - def mousePressEvent (self, mouse_event): - """Selecting a marker.""" - if mouse_event.button() == Qt.LeftButton: - min_test_marker = self._getMinTestMarker() - - if min_test_marker.contains(mouse_event.x(), mouse_event.y()): - self.selected_marker = 'min' - - max_test_marker = self._getMaxTestMarker() - - if max_test_marker.contains(mouse_event.x(), mouse_event.y()): - self.selected_marker = 'max' - - - def mouseReleaseEvent (self, mouse_event): - self.selected_marker = 'none' - - def leaveEvent (self, event): - self.setDefaultColors() - - def getDefaultMarkerColor(self): - return QApplication.palette().background().color().light(175) - - def getDefaultHighlightColor(self): - return QApplication.palette().highlight().color() - - def setDefaultColors(self): - self.min_marker_brush = self.getDefaultMarkerColor() - self.max_marker_brush = self.getDefaultMarkerColor() - self.update() - - def setMaxValue(self, max_value, update=True): - """The the position of the max marker.""" - if self.horizontal: - m = float(self.width()) - else: - m = float(self.height()) - - marker_offset = (self.size + 1) / m - - if not self.max_value == max_value: - self.max_value = max_value - if self.max_value - marker_offset <= self.min_value: - self.max_value = self.min_value + marker_offset - if self.max_value > 1.0: - self.max_value = 1 - - - self.emit(SIGNAL('zoomValueChanged(float, float)'), self.min_value, self.max_value) - - if update: - self.update() - - def setMinValue(self, min_value, update=True): - """The the position of the min marker.""" - if self.horizontal: - m = float(self.width()) - else: - m = float(self.height()) - - marker_offset = (self.size + 1) / m - - if not self.min_value == min_value: - self.min_value = min_value - if self.min_value + marker_offset >= self.max_value: - self.min_value = self.max_value - marker_offset - if self.min_value < 0.0: - self.min_value = 0.0 - - - self.emit(SIGNAL('zoomValueChanged(float, float)'), self.min_value, self.max_value) - - if update: - self.update() diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/popup_dialog.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/popup_dialog.py new file mode 100644 index 0000000000..88f290375d --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/pages/popup_dialog.py @@ -0,0 +1,62 @@ +from PyQt4.QtCore import Qt, SIGNAL, pyqtSlot, SLOT +from PyQt4.QtGui import QWidget, QDialog, QVBoxLayout, QLayout, QPushButton + + +class PopupDialog(QDialog): + + def __init__(self, title, panel, parent=None): + QDialog.__init__(self, parent) + + self.__initialized = False + self.__position = None + self.__geometry = None + self.__button = QPushButton("Button") + self.__button.setCheckable(True) + + self.setWindowTitle(title) + self.setModal(False) + self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) + + + layout = QVBoxLayout() + layout.setMargin(0) + layout.setSizeConstraint(QLayout.SetFixedSize) # not resizable!!! + layout.addWidget(panel) + self.setLayout(layout) + + self.connect(self, SIGNAL("accepted()"), self.closeDialog) + self.connect(self, SIGNAL("rejected()"), self.closeDialog) + + self.connect(self.__button, SIGNAL("toggled(bool)"), self, SLOT("buttonToggle(bool)")) + + def showDialog(self): + self.show() + + if self.__initialized: + self.move(self.__position) + self.setGeometry(self.__geometry) + + self.raise_() + self.activateWindow() + + if not self.__button.isChecked(): + self.__button.setChecked(True) + + def closeDialog(self): + self.__position = self.pos() + self.__geometry = self.geometry() + self.__initialized = True + self.setVisible(False) + + if self.__button.isChecked(): + self.__button.setChecked(False) + + def getButton(self): + return self.__button + + @pyqtSlot(bool) + def buttonToggle(self, toggle): + if toggle: + self.showDialog() + else: + self.closeDialog() diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/queue_system_configuration.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/queue_system_configuration.py new file mode 100644 index 0000000000..966ef9760f --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/pages/queue_system_configuration.py @@ -0,0 +1,37 @@ +from ert_gui.models.connectors.queue_system import LsfMaxRunning, LsfQueue, LsfRequest, LocalMaxRunning, RshMaxRunning, RshCommand, RshHostListModel +from ert_gui.widgets.integer_spinner import IntegerSpinner +from ert_gui.widgets.keyword_table import KeywordTable +from ert_gui.widgets.path_chooser import PathChooser +from ert_gui.widgets.row_panel import RowPanel +from ert_gui.widgets.string_box import StringBox + + +class QueueSystemConfigurationPanel(RowPanel): + + def __init__(self): + RowPanel.__init__(self, "Queue System") + + # self.startTabs("LSF") + self.addLabeledSeparator("LSF") + self.addRow(StringBox(LsfQueue(), "LSF Queue", "config/queue_system/lsf_queue")) + self.addRow(IntegerSpinner(LsfMaxRunning(), "Max running", "config/queue_system/max_running_lsf")) + self.addRow(StringBox(LsfRequest(), "Resources", "config/queue_system/lsf_resources")) + self.addSpace(10) + + # self.addTab("RSH") + self.addLabeledSeparator("RSH") + self.addRow(PathChooser(RshCommand(), "Command", "config/queue_system/rsh_command")) + self.addRow(IntegerSpinner(RshMaxRunning(), "Max running", "config/queue_system/max_running_rsh")) + + keyword_table = KeywordTable(RshHostListModel(), "Host List", "config/queue_system/rsh_host_list") + keyword_table.setColumnHeaders(keyword_name="Host", value_name="Number of Jobs") + self.addRow(keyword_table) + self.addSpace(10) + + # self.addTab("LOCAL") + self.addLabeledSeparator("Local") + self.addRow(IntegerSpinner(LocalMaxRunning(), "Max running", "config/queue_system/max_running_local")) + self.addSpace(20) + + # self.endTabs() + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/CMakeLists.txt deleted file mode 100644 index 4594781ddb..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_python_package( "Python ert_gui.pages.run" ${PYTHON_INSTALL_PREFIX}/ert_gui/pages/run "__init__.py;runpanel.py;simulation.py;simulationsdialog.py;legend.py" True) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/__init__.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/__init__.py deleted file mode 100644 index 79c95cf38a..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/legend.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/legend.py deleted file mode 100644 index c135eafe45..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/legend.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'legend.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore - -class LegendMarker(QtGui.QWidget): - """A widget that shows a colored box""" - def __init__(self, color, parent = None): - QtGui.QWidget.__init__(self, parent) - - self.setMaximumSize(QtCore.QSize(12, 12)) - self.setMinimumSize(QtCore.QSize(12, 12)) - - self.color = color - - def paintEvent(self, paintevent): - """Paints the box""" - painter = QtGui.QPainter(self) - - rect = self.contentsRect() - rect.setWidth(rect.width() - 1) - rect.setHeight(rect.height() - 1) - painter.drawRect(rect) - - rect.setX(rect.x() + 1) - rect.setY(rect.y() + 1) - painter.fillRect(rect, self.color) - -class Legend(QtGui.QHBoxLayout): - """Combines a LegendMarker with a label""" - def __init__(self, legend, color, parent=None): - QtGui.QHBoxLayout.__init__(self, parent) - - legendMarker = LegendMarker(color, parent) - self.addWidget(legendMarker) - self.addWidget(QtGui.QLabel(legend)) - legendMarker.setToolTip(legend) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/runpanel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/runpanel.py deleted file mode 100644 index 30e1f923bd..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/runpanel.py +++ /dev/null @@ -1,246 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'runpanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore - -from ert_gui.widgets.helpedwidget import HelpedWidget, ContentModel -from ert_gui.widgets.util import resourceIcon, ListCheckPanel, ValidatedTimestepCombo, createSpace, getItemsFromList, frange -import threading -import time -#import widgets -import math -from ert_gui.widgets.cogwheel import Cogwheel -from simulation import SimulationList, SimulationItemDelegate, SimulationItem, Simulation -from legend import Legend -from simulationsdialog import SimulationsDialog - -class RunWidget(HelpedWidget): - """A widget that shows simulation parameters and the possibility to start the simulation""" - run_mode_type = {"ENKF_ASSIMILATION" : 1, "ENSEMBLE_EXPERIMENT" : 2, "ENSEMBLE_PREDICTION" : 3, "INIT_ONLY" : 4, "SMOOTHER" : 5} - state_enum = {"UNDEFINED" : 0, "SERIALIZED" : 1, "FORECAST" : 2, "ANALYZED" : 4, "BOTH" : 6} - - def __init__(self, parent=None): - HelpedWidget.__init__(self, parent, widgetLabel="", helpLabel="") # - - self.addLayout(self.createPanel(parent)) - - self.modelConnect("ensembleResized()", self.fetchContent) - self.modelConnect("runpathChanged()", self.fetchContent) - self.rbAssimilation.toggle() - #self.rbExperiment.toggle() - #self.rbSmoother.toggle() - - def createPanel(self, parent): - """Creates the panel with the simulation parameters.""" - self.membersList = QtGui.QListWidget(self) - self.membersList.setSelectionMode(QtGui.QAbstractItemView.MultiSelection) - - self.membersList.setViewMode(QtGui.QListView.IconMode) - self.membersList.setMovement(QtGui.QListView.Static) - self.membersList.setResizeMode(QtGui.QListView.Adjust) - self.membersList.setGridSize(QtCore.QSize(32, 16)) - self.membersList.setSelectionRectVisible(False) - - memberLayout = QtGui.QFormLayout() - memberLayout.setLabelAlignment(QtCore.Qt.AlignRight) - - self.runpathLabel = QtGui.QLabel("") - font = self.runpathLabel.font() - font.setWeight(QtGui.QFont.Bold) - self.runpathLabel.setFont(font) - - memberLayout.addRow("Runpath:", self.runpathLabel) - - membersCheckPanel = ListCheckPanel(self.membersList) - #membersCheckPanel.insertWidget(0, QtGui.QLabel("Members")) - - self.simulateFrom = ValidatedTimestepCombo(parent, fromLabel="Start", toLabel="End of history") - self.simulateTo = ValidatedTimestepCombo(parent, fromLabel="End of history", toLabel="End of prediction") - - self.startState = QtGui.QComboBox(self) - self.startState.setMaximumWidth(100) - self.startState.setToolTip("Select state") - self.startState.addItem("Analyzed") - self.startState.addItem("Forecast") - - startLayout = QtGui.QHBoxLayout() - startLayout.addWidget(self.simulateFrom) - startLayout.addWidget(self.startState) - - memberLayout.addRow("Run simulation from: ", startLayout) - memberLayout.addRow("Run simulation to: ", self.simulateTo) - memberLayout.addRow("Mode: ", self.createRadioButtons()) - memberLayout.addRow(membersCheckPanel) - memberLayout.addRow("Members:", self.membersList) - - self.actionButton = QtGui.QPushButton("Run simulations") - - self.connect(self.actionButton, QtCore.SIGNAL('clicked()'), self.run) - - actionLayout = QtGui.QHBoxLayout() - actionLayout.addStretch(1) - actionLayout.addWidget(self.actionButton) - actionLayout.addStretch(1) - - memberLayout.addRow(createSpace(10)) - memberLayout.addRow(actionLayout) - - self.setRunpath("...") - - return memberLayout - - - def run(self): - """Do pre run checks and start the simulation. A new dialog will be shown with simulation information.""" - ert = self.getModel() - selectedMembers = getItemsFromList(self.membersList) - - selectedMembers = [int(member) for member in selectedMembers] - - if len(selectedMembers) == 0: - QtGui.QMessageBox.warning(self, "Missing data", "At least one member must be selected!") - return - - if not ert.main.is_initialized: - QtGui.QMessageBox.warning(self, "Case not initialized", "The case must be initialized before simulation can start!") - return - - - simFrom = self.simulateFrom.getSelectedValue() - simTo = self.simulateTo.getSelectedValue() - - if self.rbAssimilation.isChecked(): - mode = self.run_mode_type["ENKF_ASSIMILATION"] - if self.rbExperiment.isChecked(): - if simTo == -1: # -1 == End - mode = self.run_mode_type["ENSEMBLE_PREDICTION"] - else: - mode = self.run_mode_type["ENSEMBLE_EXPERIMENT"] - if self.rbSmoother.isChecked(): - mode = self.run_mode_type["SMOOTHER"] - - state = self.state_enum["ANALYZED"] - if self.startState.currentText() == "Forecast" and not simFrom == 0: - state = self.state_enum["FORECAST"] - - init_step_parameter = simFrom - - #if mode == run_mode_type["ENKF_ASSIMILATION"]: - # init_step_parameter = simFrom - #elif mode == run_mode_type["ENSEMBLE_EXPERIMENT"]: - # init_step_parameter = 0 - #else: - # init_step_parameter = self.historyLength - - jobsdialog = SimulationsDialog(self) - jobsdialog.start(ert = ert, - memberCount = self.membersList.count(), - selectedMembers = selectedMembers, - simFrom = simFrom, - simTo = simTo, - mode = mode, - state = state, - init_step_parameter = init_step_parameter) - - - def setRunpath(self, runpath): - """Update the label widget with a new runpath""" - self.runpathLabel.setText(runpath) - - def fetchContent(self): - """Fetch updated data from ERT""" - data = self.getFromModel() - - self.historyLength = data["history_length"] - - self.membersList.clear() - - for member in data["members"]: - self.membersList.addItem("%03d" % (member)) - #self.membersList.addItem(str(member)) - - self.setRunpath(data["runpath"]) - - self.simulateFrom.setHistoryLength(self.historyLength) - self.simulateTo.setFromValue(self.historyLength) - self.simulateTo.setToValue(-1) - self.simulateTo.setMinTimeStep(0) - self.simulateTo.setMaxTimeStep(self.historyLength) - - self.membersList.selectAll() - - - - def getter(self, ert): - """Fetch data from EnKF. Such as number of realizations, runpath and number of timesteps.""" - members = ert.main.ens_size - historyLength = ert.main.get_history_length - runpath = ert.main.model_config.get_runpath_as_char - - return {"members" : range(members), "history_length" : historyLength, "runpath" : runpath} - - - def rbToggle(self): - """Activated when a toggle is selected. Enables/disables member selection.""" - if self.rbAssimilation.isChecked(): - self.membersList.setSelectionEnabled(False) - self.membersList.selectAll() - else: - self.membersList.setSelectionEnabled(True) - - def createRadioButtons(self): - """Create a toggle between assimilation and experiment.""" - radioLayout = QtGui.QVBoxLayout() - radioLayout.setSpacing(3) - self.rbExperiment = QtGui.QRadioButton("Ensemble experiment") - radioLayout.addWidget(self.rbExperiment) - self.rbAssimilation = QtGui.QRadioButton("EnKF assimilation") - radioLayout.addWidget(self.rbAssimilation) - self.rbSmoother = QtGui.QRadioButton("Smoother") - radioLayout.addWidget(self.rbSmoother) - - - self.connect(self.rbAssimilation , QtCore.SIGNAL('toggled(bool)'), lambda : self.rbToggle()) - self.connect(self.rbExperiment , QtCore.SIGNAL('toggled(bool)'), lambda : self.rbToggle()) - self.connect(self.rbSmoother , QtCore.SIGNAL('toggled(bool)'), lambda : self.rbToggle()) - - return radioLayout - - -class RunPanel(QtGui.QFrame): - """A panel that represents data relateed to starting simulation.""" - def __init__(self, parent): - QtGui.QFrame.__init__(self, parent) - self.setFrameShape(QtGui.QFrame.Panel) - self.setFrameShadow(QtGui.QFrame.Raised) - - panelLayout = QtGui.QVBoxLayout() - self.setLayout(panelLayout) - - # button = QtGui.QPushButton("Refetch") - # self.connect(button, QtCore.SIGNAL('clicked()'), ContentModel.updateObservers) - # panelLayout.addWidget(button) - - panelLayout.addWidget(RunWidget()) - - - - - - - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/simulation.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/simulation.py deleted file mode 100644 index c9fa8ce5b2..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/simulation.py +++ /dev/null @@ -1,585 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'simulation.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from __future__ import division -from PyQt4 import QtGui, QtCore -from ert_gui.widgets.util import resourceIcon, resourceStateIcon, shortTime -import time -from ert.ert.enums import ert_job_status_type - - -class SimulationList(QtGui.QListWidget): - """A list widget with custom items representing simulation jobs""" - def __init__(self): - QtGui.QListWidget.__init__(self) - - self.setViewMode(QtGui.QListView.IconMode) - self.setMovement(QtGui.QListView.Static) - self.setResizeMode(QtGui.QListView.Adjust) - - self.setItemDelegate(SimulationItemDelegate()) - self.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) - self.setSelectionRectVisible(False) - - self.setSortingEnabled(True) - self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) - - -class SimulationItem(QtGui.QListWidgetItem): - """Items for the custom SimulationList""" - def __init__(self, simulation): - self.simulation = simulation - QtGui.QListWidgetItem.__init__(self, type=9901) - self.setData(QtCore.Qt.DisplayRole, self.simulation) - - def __ge__(self, other): - return self.simulation >= other.simulation - - def __lt__(self, other): - return not self >= other - - -class SimulationItemDelegate(QtGui.QStyledItemDelegate): - """The delegate that renders the custom SimulationListItems""" - waiting = QtGui.QColor(164 , 164 , 255) - pending = QtGui.QColor(164 , 200 , 255) - running = QtGui.QColor(200 , 255 , 200) - failed = QtGui.QColor(255 , 200 , 200) - - userkilled = QtGui.QColor(255, 255, 200) - finished = QtGui.QColor(200, 200, 200) - notactive = QtGui.QColor(255, 255, 255) - unknown = running # Loading + the intermidate states. - - #Cool orange color: QtGui.QColor(255, 200, 128) - - size = QtCore.QSize(32, 18) - - def __init__(self): - QtGui.QStyledItemDelegate.__init__(self) - - def paint(self, painter, option, index): - """Renders the item""" - painter.save() - painter.setRenderHint(QtGui.QPainter.Antialiasing) - - data = index.data(QtCore.Qt.DisplayRole) - - if data is None: - data = Simulation("0") - data.status = 0 - else: - data = data.toPyObject() - - if data.isWaiting(): - color = self.waiting - elif data.isPending(): - color = self.pending - elif data.isRunning(): - color = self.running - elif data.finishedSuccessfully(): - color = self.finished - elif data.hasFailed(): - color = self.failed - elif data.notActive(): - color = self.notactive - elif data.isUserKilled(): - color = self.userkilled - else: - color = self.unknown - - painter.setPen(color) - rect = QtCore.QRect(option.rect) - rect.setX(rect.x() + 1) - rect.setY(rect.y() + 1) - rect.setWidth(rect.width() - 2) - rect.setHeight(rect.height() - 2) - painter.fillRect(rect, color) - - painter.setPen(QtCore.Qt.black) - - painter.setRenderHint(QtGui.QPainter.Antialiasing, False) - painter.drawRect(rect) - - if option.state & QtGui.QStyle.State_Selected: - painter.fillRect(option.rect, QtGui.QColor(255, 255, 255, 150)) - - painter.drawText(rect, QtCore.Qt.AlignCenter + QtCore.Qt.AlignVCenter, str(data.name)) - - painter.restore() - - def sizeHint(self, option, index): - """Returns the size of the item""" - return self.size - - -class SimulationPanel(QtGui.QStackedWidget): - """ - A panel that shows information and enables interaction with jobs. - Three different views: no selected jobs, one selected job and multiple selected jobs. - """ - - def __init__(self, parent=None): - QtGui.QStackedWidget.__init__(self, parent) - self.setFrameShape(QtGui.QFrame.Panel) - self.setFrameShadow(QtGui.QFrame.Raised) - - self.setMinimumWidth(200) - self.setMaximumWidth(200) - - self.ctrl = SimulationPanelController(self) - - self.createNoSelectionsPanel() - self.createSingleSelectionsPanel() - self.createManySelectionsPanel() - - self.addWidget(self.noSimulationsPanel) - self.addWidget(self.singleSimulationsPanel) - self.addWidget(self.manySimulationsPanel) - - - def createButtons(self): - """Create kill, restart and resample and restart buttons""" - self.killButton = QtGui.QToolButton(self) - self.killButton.setIcon(resourceIcon("cross")) - self.killButton.setToolTip("Kill job") - self.connect(self.killButton, QtCore.SIGNAL('clicked()'), self.ctrl.kill) - - self.restartButton = QtGui.QToolButton(self) - self.restartButton.setIcon(resourceIcon("refresh")) - self.restartButton.setToolTip("Restart job") - self.connect(self.restartButton, QtCore.SIGNAL('clicked()'), lambda : self.ctrl.restart(False)) - - self.rrButton = QtGui.QToolButton(self) - self.rrButton.setIcon(resourceIcon("refresh_resample")) - self.rrButton.setToolTip("Resample and restart job") - self.connect(self.rrButton, QtCore.SIGNAL('clicked()'), lambda : self.ctrl.restart(True)) - - buttonLayout = QtGui.QHBoxLayout() - buttonLayout.addWidget(self.killButton) - buttonLayout.addWidget(self.restartButton) - buttonLayout.addWidget(self.rrButton) - - return buttonLayout - - def createButtonedLayout(self, layout, prestretch=True): - """A centered layout for buttons""" - btnlayout = QtGui.QVBoxLayout() - btnlayout.addLayout(layout) - - if prestretch: - btnlayout.addStretch(1) - - btnlayout.addLayout(self.createButtons()) - return btnlayout - - - def createManySelectionsPanel(self): - """The panel for multiple selected jobs""" - self.manySimulationsPanel = QtGui.QWidget() - - layout = QtGui.QVBoxLayout() - label = QtGui.QLabel("Selected jobs:") - label.setAlignment(QtCore.Qt.AlignHCenter) - layout.addWidget(label) - - self.selectedSimulationsLabel = QtGui.QLabel() - self.selectedSimulationsLabel.setWordWrap(True) - font = self.selectedSimulationsLabel.font() - font.setWeight(QtGui.QFont.Bold) - self.selectedSimulationsLabel.setFont(font) - - scrolledLabel = QtGui.QScrollArea() - scrolledLabel.setWidget(self.selectedSimulationsLabel) - scrolledLabel.setWidgetResizable(True) - layout.addWidget(scrolledLabel) - - self.manySimulationsPanel.setLayout(self.createButtonedLayout(layout, False)) - - def createSingleSelectionsPanel(self): - """The panel for a single selected job""" - self.singleSimulationsPanel = QtGui.QWidget() - - layout = QtGui.QFormLayout() - layout.setLabelAlignment(QtCore.Qt.AlignRight) - self.jobLabel = QtGui.QLabel() - self.submitLabel = QtGui.QLabel() - self.startLabel = QtGui.QLabel() - self.finishLabel = QtGui.QLabel() - self.waitingLabel = QtGui.QLabel() - self.runningLabel = QtGui.QLabel() - self.stateLabel = QtGui.QLabel() - - layout.addRow("Job #:", self.jobLabel) - layout.addRow("Submitted:", self.submitLabel) - layout.addRow("Started:", self.startLabel) - layout.addRow("Finished:", self.finishLabel) - layout.addRow("Waiting:", self.runningLabel) - layout.addRow("Running:", self.waitingLabel) - layout.addRow("State:", self.stateLabel) - - self.singleSimulationsPanel.setLayout(self.createButtonedLayout(layout)) - - - def createNoSelectionsPanel(self): - """The panel for no selected jobs. Enables pausing and killing the entire simulation""" - self.noSimulationsPanel = QtGui.QWidget() - - layout = QtGui.QVBoxLayout() - label = QtGui.QLabel("Pause queue after currently running jobs are finished:") - label.setWordWrap(True) - layout.addWidget(label) - - self.pauseButton = QtGui.QToolButton(self) - self.pauseButton.setIcon(resourceIcon("pause")) - self.pauseButton.setCheckable(True) - self.connect(self.pauseButton, QtCore.SIGNAL('clicked()'), lambda : self.ctrl.pause(self.pauseButton.isChecked())) - - - buttonLayout = QtGui.QHBoxLayout() - buttonLayout.addStretch(1) - buttonLayout.addWidget(self.pauseButton) - buttonLayout.addStretch(1) - layout.addLayout(buttonLayout) - - label = QtGui.QLabel("Remove all jobs from the queue:") - label.setWordWrap(True) - layout.addWidget(label) - - self.killAllButton = QtGui.QToolButton(self) - self.killAllButton.setIcon(resourceIcon("cancel")) - self.connect(self.killAllButton, QtCore.SIGNAL('clicked()'), self.ctrl.killAll) - - buttonLayout = QtGui.QHBoxLayout() - buttonLayout.addStretch(1) - buttonLayout.addWidget(self.killAllButton) - buttonLayout.addStretch(1) - - layout.addLayout(buttonLayout) - - self.noSimulationsPanel.setLayout(layout) - - - - def setSimulations(self, selection=None): - """Set the list of selected jobs""" - if selection is None: selection = [] - self.ctrl.setSimulations(selection) - -# def markText(self, a, b): -# if b.isRunning(): -# c = SimulationItemDelegate.running -# elif b.isWaiting(): -# c = SimulationItemDelegate.waiting -# else: -# c = QtGui.QColor(255, 255, 255, 0) -# -# color = "rgb(%d, %d, %d)" % (c.red(), c.green(), c.blue()) -# -# b = "" + str(b) + "" -# -# if not a == "": -# return a + " " + b -# else: -# return b - - def setModel(self, ert): - """Set the reference to ERT (ertwrapper instance)""" - self.ctrl.setModel(ert) - - def setSimulationStatistics(self, statistics): - """Set the associated simulation statistics""" - self.ctrl.setSimulationStatistics(statistics) - - -class SimulationPanelController: - """Controller code for the simulation panel""" - def __init__(self, view): - self.view = view - self.initialized = False - self.selectedSimulations = [] - self.view.connect(self.view, QtCore.SIGNAL('simulationsUpdated()'), self.showSelectedSimulations) - - - def initialize(self, ert): - if not self.initialized: - self.initialized = True - - def setModel(self, ert): - """Set the reference to ERT (ertwrapper instance)""" - self.initialize(ert) - self.ert = ert - - def kill(self): - """Kills the selected simulations.""" - for simulation in self.selectedSimulations: - state = self.ert.main.iget_state(simulation.name) - status = state.get_run_status - - #if status == Simulation.RUNNING: - state.kill_simulation - - def restart(self, resample): - """Restarts the selected simulations. May also resample.""" - for simulation in self.selectedSimulations: - state = self.ert.main.iget_state(simulation.name) - status = state.get_run_status - - #if status == Simulation.USER_KILLED: - state.resubmit_simulation(resample) - - def pause(self, pause): - """Pause the job queue after the currently running jobs are finished.""" - job_queue = self.ert.main.site_config.get_job_queue() - - if pause: - self.statistics.stop() - job_queue.set_pause_on - else: - self.statistics.startTiming() - job_queue.set_pause_off - - def killAll(self): - """Kills all simulations""" - killAll = QtGui.QMessageBox.question(self.view, "Remove all jobs?", "Are you sure you want to remove all jobs from the queue?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No) - - if killAll == QtGui.QMessageBox.Yes: - job_queue = self.ert.main.site_config.get_job_queue( ) - job_queue.user_exit( ) - - - def showSelectedSimulations(self): - """Update information relating to a single job""" - if len(self.selectedSimulations) >= 2: - members = reduce(lambda a, b: str(a) + " " + str(b), sorted(self.selectedSimulations)) - self.view.selectedSimulationsLabel.setText(members) - elif len(self.selectedSimulations) == 1: - sim = self.selectedSimulations[0] - self.view.jobLabel.setText(str(sim.name)) - self.view.submitLabel.setText(shortTime(sim.submitTime)) - self.view.startLabel.setText(shortTime(sim.startTime)) - self.view.finishLabel.setText(shortTime(sim.finishedTime)) - - if sim.startTime == -1: - runningTime = "-" - elif sim.finishedTime > -1: - runningTime = sim.finishedTime - sim.startTime - else: - runningTime = int(time.time()) - sim.startTime - - - if sim.submitTime == -1: - waitingTime = "-" - elif sim.startTime > -1: - waitingTime = sim.startTime - sim.submitTime - else: - waitingTime = int(time.time()) - sim.submitTime - - self.view.runningLabel.setText(str(waitingTime) + " secs") - self.view.waitingLabel.setText(str(runningTime) + " secs") - - status = sim.status.name[10:] - self.view.stateLabel.setText(status) - - - def setSimulations(self, selection=None): - """Change the view according to the selection. No, single or multiple jobs.""" - if selection is None: selection = [] - self.selectedSimulations = selection - - if len(selection) >= 2: - self.view.setCurrentWidget(self.view.manySimulationsPanel) - elif len(selection) == 1: - self.view.setCurrentWidget(self.view.singleSimulationsPanel) - else: - self.view.setCurrentWidget(self.view.noSimulationsPanel) - - self.showSelectedSimulations() - - def setSimulationStatistics(self, statistics): - """Set the associated statistics""" - self.statistics = statistics - - -class Simulation: - """Container for state information for a single simulation.""" - - def __init__(self, name, statistics=None): - self.name = name - self.status = ert_job_status_type.NOT_ACTIVE - self.statuslog = [] - self.statistics = statistics - - self.resetTime() - - def checkStatus(self, type): - """Check the internal status against an ERT enum""" - return self.status == type - - def isWaiting(self): - """Is the job waiting?""" - return self.checkStatus(ert_job_status_type.WAITING) or self.checkStatus(ert_job_status_type.SUBMITTED) - - def isPending(self): - """Is the job PENDING in the LSF queue?""" - return self.checkStatus(ert_job_status_type.PENDING) - - def isRunning(self): - """Is the job running?""" - return self.checkStatus(ert_job_status_type.RUNNING) - - def hasFailed(self): - """Has the job failed?""" - return self.checkStatus(ert_job_status_type.FAILED) - - def notActive(self): - """Is the job active?""" - return self.checkStatus(ert_job_status_type.NOT_ACTIVE) - - def finishedSuccessfully(self): - """Has the job finished?""" - return self.checkStatus(ert_job_status_type.SUCCESS) - - def isUserKilled(self): - """Has the job been killed by the user?""" - return self.checkStatus(ert_job_status_type.USER_KILLED) or self.checkStatus(ert_job_status_type.USER_EXIT) - - - def setStatus(self, status): - """Update the status of this job""" - if len(self.statuslog) == 0 or not self.statuslog[len(self.statuslog) - 1] == status: - self.statuslog.append(status) - - if status == ert_job_status_type.SUCCESS: - self.setFinishedTime(int(time.time())) - - self.status = status - - def setStartTime(self, secs): - """Set the time the job started""" - self.startTime = secs - - def setSubmitTime(self, secs): - """Set the time the job was submitted to LSF""" - self.submitTime = secs - if self.submitTime > self.finishedTime: - self.finishedTime = -1 - - def setFinishedTime(self, secs): - """Set the time the job finished""" - self.finishedTime = secs - - if not self.statistics is None: - self.statistics.addTime(self.submitTime, self.startTime, self.finishedTime) - - def printTime(self, secs): - if not secs == -1: - print time.localtime(secs) - - def resetTime(self): - """Reset job timing""" - self.startTime = -1 - self.submitTime = -1 - self.finishedTime = -1 - - def __str__(self): - return str(self.name) - - def __ge__(self, other): - return self.name >= other.name - - def __lt__(self, other): - return not self >= other - - -class SimulationStatistics: - """A class that tracks statistics for Simulations (running time, waiting time, estimates, etc...)""" - - - def __init__(self, name="default"): - """Create a new tracking object""" - self.name = name - self.clear() - self.old_job_count = 0 - self.old_duration = 0 - - def clear(self): - """Reset all values and stop estimate calculation""" - self.jobs = 0 - self.waiting = 0 - self.running = 0 - self.total = 0 - self.start = 0 - self.last = 0 - - self.stopped = True - - def startTiming(self): - """Starts estimate calculation""" - self.stopped = False - self.start = int(time.time()) - - def jobsPerSecond(self): - """Returns the number of jobs per second as a float""" - #t = int(time.time()) - self.start - t = self.last - self.start - if t > 0: - return self.jobs / t - else: - return 0 - - def averageRunningTime(self): - """Calculates the average running time""" - return self.running / self.jobs - - def secondsPerJob(self): - """Returns how long a job takes in seconds""" - return 1.0 / self.jobsPerSecond() - - def averageConcurrentJobs(self): - """Returns the average number of jobs performed in parallel""" - return max(self.running / (self.last - self.start), 1) - - def estimate(self, jobs): - """Returns an estimate on how long the rest of the job will take. Jobs = the total number of jobs""" - if self.jobsPerSecond() > 0: - avg_concurrent_jobs = self.averageConcurrentJobs() - avg_running = self.averageRunningTime() - - jobs_left = jobs - self.jobs - est_remaining_running = avg_running * (jobs_left) / avg_concurrent_jobs - timeUsed = int(time.time()) - self.last - return est_remaining_running - timeUsed - else: - return -1 - - - def addTime(self, submit, start, finish): - """Add new statistical data to the tracker""" - if not self.stopped: - self.jobs += 1 - self.waiting += start - submit - self.running += finish - start - self.total += finish - submit - self.last = int(time.time()) - - def stop(self): - """Pause the tracker. Estimate data will be reset""" - self.old_job_count += self.jobs - self.old_duration += int(time.time()) - self.start - self.clear() - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/simulationsdialog.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/simulationsdialog.py deleted file mode 100644 index 250571ae91..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run/simulationsdialog.py +++ /dev/null @@ -1,257 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'simulationsdialog.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -from ert_gui.widgets.cogwheel import Cogwheel -from legend import Legend -from simulation import SimulationItemDelegate, SimulationList, SimulationItem, Simulation, SimulationPanel, SimulationStatistics - -import threading -import time -from ert_gui.widgets.util import getItemsFromList -from ert.ert.enums import ert_job_status_type -from PyQt4.QtGui import QApplication -from ert.util.tvector import BoolVector - -class SimulationsDialog(QtGui.QDialog): - """A dialog that shows the progress of a simulation""" - def __init__(self, parent=None): - QtGui.QDialog.__init__(self, parent) - self.setModal(True) - self.setWindowTitle("Running jobs") - self.setMinimumWidth(250) - #self.setMinimumHeight(250) - - self.ctrl = SimulationsDialogController(self) - - self.simulationProgress = QtGui.QProgressBar() - self.simulationProgress.setValue(0) - self.connect(self.simulationProgress, QtCore.SIGNAL('setValue(int)'), self.updateProgress) - - self.cogwheel = Cogwheel(size=20) - - memberLayout = QtGui.QVBoxLayout() - - progressLayout = QtGui.QHBoxLayout() - progressLayout.addWidget(self.simulationProgress) - progressLayout.addWidget(self.cogwheel) - memberLayout.addLayout(progressLayout) - - - simulationLayout = QtGui.QHBoxLayout() - self.simulationList = SimulationList() - self.simulationList.contextMenuEvent = self._contextMenu - self.connect(self.simulationList, QtCore.SIGNAL('itemSelectionChanged()'), self.ctrl.selectSimulation) - simulationLayout.addWidget(self.simulationList) - self.simulationPanel = SimulationPanel() - simulationLayout.addWidget(self.simulationPanel) - memberLayout.addLayout(simulationLayout) - - legendLayout = QtGui.QHBoxLayout() - legendLayout.addLayout(Legend("Not active", SimulationItemDelegate.notactive)) - legendLayout.addLayout(Legend("Waiting", SimulationItemDelegate.waiting)) - legendLayout.addLayout(Legend("Pending", SimulationItemDelegate.pending)) - legendLayout.addLayout(Legend("Running", SimulationItemDelegate.running)) - legendLayout.addLayout(Legend("User killed", SimulationItemDelegate.userkilled)) - legendLayout.addLayout(Legend("Failed", SimulationItemDelegate.failed)) - legendLayout.addLayout(Legend("Finished", SimulationItemDelegate.finished)) - memberLayout.addLayout(legendLayout) - - - self.doneButton = QtGui.QPushButton("Done", self) - self.connect(self.doneButton, QtCore.SIGNAL('clicked()'), self.accept) - - buttonLayout = QtGui.QHBoxLayout() - - self.estimateLabel = QtGui.QLabel() - buttonLayout.addWidget(self.estimateLabel) - buttonLayout.addStretch(1) - buttonLayout.addWidget(self.doneButton) - - memberLayout.addSpacing(10) - memberLayout.addLayout(buttonLayout) - - self.setLayout(memberLayout) - - - def _createAction(self, name, func, parent=None): - """Create an action for the right click menu""" - action = QtGui.QAction(name, parent) - action.connect(action, QtCore.SIGNAL("triggered()"), func) - return action - - def _contextMenu(self, event): - """Create a right click menu for the simulation view.""" - menu = QtGui.QMenu(self.simulationList) - selectAll = self._createAction("Select all", self.simulationList.selectAll) - unselectAll = self._createAction("Unselect all", self.simulationList.clearSelection) - selectRunning = self._createAction("Select all running", lambda : self.ctrl.select(ert_job_status_type.RUNNING)) - selectFailed = self._createAction("Select all failed", lambda : self.ctrl.select(ert_job_status_type.FAILED)) - selectUserKilled = self._createAction("Select all user killed", lambda : self.ctrl.select(ert_job_status_type.USER_KILLED)) - selectWaiting = self._createAction("Select all waiting", lambda : self.ctrl.select(ert_job_status_type.WAITING, ert_job_status_type.PENDING)) - - menu.addAction(selectAll) - menu.addAction(unselectAll) - menu.addAction(selectWaiting) - menu.addAction(selectRunning) - menu.addAction(selectFailed) - menu.addAction(selectUserKilled) - menu.exec_(event.globalPos()) - - - def closeEvent(self, event): - """Ignore clicking of the x in the top right corner""" - event.ignore() - - def keyPressEvent(self, event): - """Ignore ESC keystrokes""" - if not event.key() == QtCore.Qt.Key_Escape: - QtGui.QDialog.keyPressEvent(self, event) - - def updateProgress(self, value): - """Update the progress bar""" - self.simulationProgress.setValue(value) - - def setRunningState(self, state): - """Set wether the cogwheel should spin and the Done button is enabled""" - self.cogwheel.setRunning(state) - self.doneButton.setEnabled(not state) - - def start(self, **kwargs): - """Show the dialog and start the simulation""" - self.open() - self.ctrl.start(**kwargs) - self.exec_() - - -class SimulationsDialogController: - """All controller code for the dialog""" - def __init__(self, view): - self.view = view - self.initialized = False - - def select(self, *states): - """Used by the right click menu to select multiple running jobs""" - self.view.simulationList.clearSelection() - - items = getItemsFromList(self.view.simulationList, lambda item : item, selected=False) - - for state in states: - for item in items: - if item.simulation.checkStatus(state): - item.setSelected(True) - - def selectSimulation(self): - """Set a job as selected""" - selection = getItemsFromList(self.view.simulationList, lambda item : item.simulation) - self.view.simulationPanel.setSimulations(selection) - - def initialize(self, ert): - if not self.initialized: - self.initialized = True - - def start(self, **kwargs): - """Start the simulation. Two threads are started one for the simulation and one for progress monitoring""" - ert = kwargs["ert"] - memberCount = kwargs["memberCount"] - selectedMembers = kwargs["selectedMembers"] - mode = kwargs["mode"] - init_step_parameter = kwargs["init_step_parameter"] - simFrom = kwargs["simFrom"] - simTo = kwargs["simTo"] - state = kwargs["state"] - - - self.initialize(ert) - self.view.simulationPanel.setModel(ert) - - self.statistics = SimulationStatistics() - self.view.simulationPanel.setSimulationStatistics(self.statistics) - simulations = {} - for member in selectedMembers: - simulations[member] = SimulationItem(Simulation(member, self.statistics)) - self.view.simulationList.addItem(simulations[member]) - - - self.runthread = threading.Thread(name="enkf_main_run") - def run(): - self.view.setRunningState(True) - boolVector = BoolVector.active_mask(str(selectedMembers).strip('[]')) - ert.main.run(boolVector, init_step_parameter, simFrom, state, mode) - self.view.setRunningState(False) - - self.runthread.setDaemon(True) - self.runthread.run = run - - - self.pollthread = threading.Thread(name="polling_thread") - def poll(): - while not ert.main.site_config.queue_is_running: - time.sleep(0.5) - - job_start_time = int(time.time()) - - while(self.runthread.isAlive()): - for member in selectedMembers: - state = ert.main.iget_state(member) - status = state.get_run_status - - simulations[member].simulation.setStatus(ert_job_status_type.resolveValue(status)) - - if not ert_job_status_type.NOT_ACTIVE == status: - start_time = state.get_start_time - submit_time = state.get_submit_time - - simulations[member].simulation.setStartTime(start_time) - simulations[member].simulation.setSubmitTime(submit_time) - - - totalCount = len(simulations.keys()) - succesCount = 0 - for key in simulations.keys(): - if simulations[key].simulation.finishedSuccessfully(): - succesCount+=1 - - count = (100 * succesCount / totalCount) - self.view.simulationProgress.emit(QtCore.SIGNAL("setValue(int)"), count) - self.view.simulationPanel.emit(QtCore.SIGNAL("simulationsUpdated()")) - - qmi1 = self.view.simulationList.indexFromItem(simulations[0]) - qmi2 = self.view.simulationList.indexFromItem(simulations[len(simulations) - 1]) - self.view.simulationList.model().emit(QtCore.SIGNAL("dataChanged(QModelIndex, QModelIndex)"), qmi1, qmi2) - - - if self.view.cogwheel.isRunning(): - job_running_time = int(time.time()) - job_start_time - self.view.estimateLabel.setText("Total runnning time: %d seconds" % (job_running_time)) -# if self.statistics.jobsPerSecond() > 0: -# #with assimilation the number of jobs must be multiplied by timesteps -# self.view.estimateLabel.setText("Estimated finished in %d seconds" % (self.statistics.estimate(len(simulations)))) -# else: -# self.view.estimateLabel.setText("") - QApplication.processEvents() - self.view.update() - time.sleep(0.1) - - self.pollthread.setDaemon(True) - self.pollthread.run = poll - - self.statistics.startTiming() - self.runthread.start() - self.pollthread.start() - - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/run_dialog.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/run_dialog.py new file mode 100644 index 0000000000..563be5f22d --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/pages/run_dialog.py @@ -0,0 +1,90 @@ +from PyQt4.QtCore import Qt, pyqtSignal, QTimer, pyqtSlot +from PyQt4.QtGui import QDialog, QVBoxLayout, QLayout, QMessageBox, QPushButton, QHBoxLayout, QColor, QLabel +from ert_gui.models.connectors.run import SimulationRunner, SimulationsTracker +from ert_gui.widgets.legend import Legend +from ert_gui.widgets.progress import Progress + + +class RunDialog(QDialog): + + simulationFinished = pyqtSignal() + + def __init__(self, run_model): + QDialog.__init__(self) + self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) + self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) + self.setModal(True) + self.setWindowTitle("Simulations") + + assert isinstance(run_model, SimulationRunner) + self.run_model = run_model + self.run_model.observable().attach(SimulationRunner.SIMULATION_FINISHED_EVENT, self.simulationFinished.emit) + + + layout = QVBoxLayout() + layout.setSizeConstraint(QLayout.SetFixedSize) + + self.simulations_tracker = SimulationsTracker() + self.simulations_tracker.observable().attach(SimulationsTracker.LIST_CHANGED_EVENT, self.statusChanged) + states = self.simulations_tracker.getList() + + self.progress = Progress() + + for state in states: + self.progress.addState(state.state, QColor(*state.color), 100.0 * state.count / state.total_count) + + layout.addWidget(self.progress) + + legend_layout = QHBoxLayout() + + for state in states: + legend_layout.addWidget(Legend(state.name, QColor(*state.color))) + + layout.addLayout(legend_layout) + + self.running_time = QLabel("") + + self.kill_button = QPushButton("Kill simulations") + self.done_button = QPushButton("Done") + self.done_button.setHidden(True) + + button_layout = QHBoxLayout() + button_layout.addWidget(self.running_time) + button_layout.addStretch() + button_layout.addWidget(self.kill_button) + button_layout.addWidget(self.done_button) + + layout.addStretch() + layout.addLayout(button_layout) + + self.setLayout(layout) + + self.kill_button.clicked.connect(self.killJobs) + self.done_button.clicked.connect(self.accept) + self.simulationFinished.connect(self.hideKillAndShowDone) + + timer = QTimer(self) + timer.setInterval(500) + timer.timeout.connect(self.setRunningTime) + timer.start() + + def setRunningTime(self): + self.running_time.setText("Running time: %d seconds" % self.run_model.getRunningTime()) + + def statusChanged(self): + states = self.simulations_tracker.getList() + + for state in states: + self.progress.updateState(state.state, 100.0 * state.count / state.total_count) + + + def killJobs(self): + kill_job = QMessageBox.question(self, "Kill simulations?", "Are you sure you want to kill the currently running simulations?", QMessageBox.Yes | QMessageBox.No ) + + if kill_job == QMessageBox.Yes: + self.run_model.killAllSimulations() + QDialog.reject(self) + + def hideKillAndShowDone(self): + self.kill_button.setHidden(True) + self.done_button.setHidden(False) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/pages/simulation_panel.py b/ThirdParty/Ert/devel/python/python/ert_gui/pages/simulation_panel.py new file mode 100644 index 0000000000..906580d0c1 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/pages/simulation_panel.py @@ -0,0 +1,94 @@ +from ert_gui.models.connectors import RunPathModel, EnsembleSizeModel +from ert_gui.models.connectors.init import CaseSelectorModel, IsCaseInitializedModel +from ert_gui.models.connectors.run import SimulationModeModel, OneMoreIteration +from ert_gui.models.mixins.connectorless import FunctionButtonModel +from ert_gui.pages.message_center import MessageCenter +from ert_gui.models.connectors.run.simulation_runner import SimulationRunner +from ert_gui.pages.run_dialog import RunDialog +from ert_gui.widgets.button import Button +from ert_gui.widgets.combo_choice import ComboChoice +from ert_gui.widgets.integer_spinner import IntegerSpinner +from ert_gui.widgets.path_format import PathFormatChooser +from ert_gui.widgets.row_panel import RowPanel +from ert_gui.widgets.warning_panel import WarningPanel + + + + +class SimulationPanel(RowPanel): + + def __init__(self): + RowPanel.__init__(self, "Simulation") + + self.addLabeledSeparator("Simulation settings") + + case_model = CaseSelectorModel() + case_selector = ComboChoice(case_model, "Current case", "init/current_case_selection") + self.addRow(case_selector) + + # Give a warning if the case is not initialized! + IsCaseInitializedModel().observable().attach(IsCaseInitializedModel.TEXT_VALUE_CHANGED_EVENT, self.updateSimulationStatus) + + runpath_model = RunPathModel() + self.addRow(PathFormatChooser(runpath_model, "Runpath", "config/simulation/runpath")) + + ensemble_size_model = EnsembleSizeModel() + self.addRow(IntegerSpinner(ensemble_size_model, "Number of realizations", "config/ensemble/num_realizations")) + + simulation_mode_model = SimulationModeModel() + self.addRow(ComboChoice(simulation_mode_model, "Simulation mode", "run/simulation_mode")) + + self.addSpace(10) + self.run = FunctionButtonModel("Run", self.runSimulation) + self.run.setEnabled(SimulationModeModel().getCurrentChoice().buttonIsEnabled()) + + self.run_button = Button(self.run, label="Start simulation", help_link="run/run") + self.run_button.addStretch() + + self.config_and_run = FunctionButtonModel("Configure and Run", self.configureAndRunSimulation) + self.config_and_run.setEnabled(SimulationModeModel().getCurrentChoice().buttonIsEnabled()) + + self.run_button.addOption(self.config_and_run) + self.run_button.addOption(OneMoreIteration()) + self.addRow(self.run_button) + self.addSpace(10) + + self.warning_panel = WarningPanel() + self.addRow(self.warning_panel) + + simulation_mode_model.observable().attach(SimulationModeModel.CURRENT_CHOICE_CHANGED_EVENT, self.toggleSimulationMode) + + self.updateSimulationStatus() + + + def updateSimulationStatus(self): + MessageCenter().setWarning(IsCaseInitializedModel.__name__, IsCaseInitializedModel().getText()) + #todo move this binding to the model? + + def runSimulation(self): + simulation_model = SimulationModeModel().getCurrentChoice() + + simulation_runner = SimulationRunner(simulation_model) + + + dialog = RunDialog(simulation_runner) + simulation_runner.start() + dialog.exec_() + + self.updateSimulationStatus() + + + def configureAndRunSimulation(self): + simulation_model = SimulationModeModel().getCurrentChoice() + print("Configure!!!") + simulation_model.buttonTriggered() + + + def toggleSimulationMode(self): + model = SimulationModeModel().getCurrentChoice() + self.run.setEnabled(model.buttonIsEnabled()) + self.config_and_run.setEnabled(model.buttonIsEnabled()) + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/CMakeLists.txt b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/CMakeLists.txt index 95ee1e73ca..633cabeebe 100644 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/CMakeLists.txt +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/CMakeLists.txt @@ -1,2 +1,33 @@ -add_python_package( "Python ert_gui.widgets" ${PYTHON_INSTALL_PREFIX}/ert_gui/widgets "__init__.py;activelabel.py;checkbox.py;cogwheel.py;combochoice.py;configpanel.py;helpedwidget.py;help.py;pathchooser.py;reloadbutton.py;searchablelist.py;spinnerwidgets.py;stringbox.py;tablewidgets.py;util.py;validateddialog.py" True) +set(PYTHON_SOURCES + __init__.py + active_label.py + add_remove_widget.py + button.py + check_list.py + checkbox.py + cogwheel.py + combo_choice.py + double_box.py + double_spinner.py + help_dock.py + helped_widget.py + integer_spinner.py + keyword_list.py + keyword_table.py + legend.py + path_chooser.py + path_format.py + progress.py + reloadbutton.py + row_group.py + row_panel.py + search_box.py + string_box.py + tablewidgets.py + util.py + validated_dialog.py + warning_panel.py +) + +add_python_package("Python ert_gui.widgets" ${PYTHON_INSTALL_PREFIX}/ert_gui/widgets "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/activelabel.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/active_label.py similarity index 50% rename from ThirdParty/Ert/devel/python/python/ert_gui/widgets/activelabel.py rename to ThirdParty/Ert/devel/python/python/ert_gui/widgets/active_label.py index 223fca5856..740f583ebd 100644 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/activelabel.py +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/active_label.py @@ -1,6 +1,6 @@ # Copyright (C) 2011 Statoil ASA, Norway. # -# The file 'activelabel.py' is part of ERT - Ensemble based Reservoir Tool. +# The file 'active_label.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,36 +12,37 @@ # FITNESS FOR A PARTICULAR PURPOSE. # # See the GNU General Public License at -# for more details. +# for more details. +from PyQt4.QtGui import QLabel, QFont +from ert_gui.models.mixins import TextModelMixin +from ert_gui.widgets.helped_widget import HelpedWidget - -from PyQt4 import QtGui, QtCore -from helpedwidget import HelpedWidget - class ActiveLabel(HelpedWidget): - """Label shows a string. The data structure expected from the getter is a string.""" + """Label shows a string. The model must be a TextModelMixin""" - def __init__(self, parent=None, label="", help="", default_string=""): - """Construct a StringBox widget""" - HelpedWidget.__init__(self, parent, label, help) + def __init__(self, model, label="", help_link="", default_string=""): + HelpedWidget.__init__(self, label, help_link) - self.active_label = QtGui.QLabel() + assert isinstance(model, TextModelMixin) + self.model = model + self.model.observable().attach(TextModelMixin.INITIALIZED_EVENT, self.modelChanged) + self.model.observable().attach(TextModelMixin.TEXT_VALUE_CHANGED_EVENT, self.modelChanged) + + self.active_label = QLabel() self.addWidget(self.active_label) font = self.active_label.font() - font.setWeight(QtGui.QFont.Bold) + font.setWeight(QFont.Bold) self.active_label.setFont(font) - #self.addHelpButton() - self.active_label.setText(default_string) - def fetchContent(self): + def modelChanged(self): """Retrieves data from the model and inserts it into the edit line""" - self_get_from_model = self.getFromModel() + self_get_from_model = self.model.getText() if self_get_from_model is None: self_get_from_model = "" - self.active_label.setText("%s" % self_get_from_model) + self.active_label.setText(str(self_get_from_model)) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/add_remove_widget.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/add_remove_widget.py new file mode 100644 index 0000000000..55bbfdb303 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/add_remove_widget.py @@ -0,0 +1,51 @@ +from PyQt4.QtCore import QSize, SIGNAL +from PyQt4.QtGui import QWidget, QToolButton, QVBoxLayout, QHBoxLayout +from ert_gui.widgets.util import resourceIcon + + +class AddRemoveWidget(QWidget): + """ + A simple class that provides to vertically positioned buttons for adding and removing something. + The addFunction and removeFunction functions must be provided. + """ + + def __init__(self, addFunction=None, removeFunction=None, horizontal=False): + QWidget.__init__(self) + + self.addButton = QToolButton(self) + self.addButton.setIcon(resourceIcon("add")) + self.addButton.setIconSize(QSize(16, 16)) + self.connect(self.addButton, SIGNAL('clicked()'), addFunction) + + self.removeButton = QToolButton(self) + self.removeButton.setIcon(resourceIcon("remove")) + self.removeButton.setIconSize(QSize(16, 16)) + self.connect(self.removeButton, SIGNAL('clicked()'), removeFunction) + + if horizontal: + self.buttonLayout = QHBoxLayout() + else: + self.buttonLayout = QVBoxLayout() + + self.buttonLayout.setMargin(0) + + if horizontal: + self.buttonLayout.addStretch(1) + + self.buttonLayout.addWidget(self.addButton) + self.buttonLayout.addWidget(self.removeButton) + + if not horizontal: + self.buttonLayout.addStretch(1) + else: + self.buttonLayout.addSpacing(2) + + self.setLayout(self.buttonLayout) + + def enableAddButton(self, state): + """Enable or disable the add button""" + self.addButton.setEnabled(state) + + def enableRemoveButton(self, state): + """Enable or disable the remove button""" + self.removeButton.setEnabled(state) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/button.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/button.py new file mode 100644 index 0000000000..3456eee4da --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/button.py @@ -0,0 +1,48 @@ +from PyQt4.QtGui import QToolButton, QMenu, QAction +from ert_gui.models.mixins.button_model import ButtonModelMixin +from ert_gui.widgets.helped_widget import HelpedWidget + + +class Button(HelpedWidget): + + def __init__(self, model, label="", help_link=""): + HelpedWidget.__init__(self, label, help_link) + + self.models = {} + assert isinstance(model, ButtonModelMixin) + + self.button = QToolButton() + self.button.setMinimumWidth(75) + self.button.setDefaultAction(self.createAction(model)) + + self.addWidget(self.button) + + + def addOption(self, model): + """ @type model: ButtonModelMixin""" + if self.button.popupMode() != QToolButton.MenuButtonPopup: + self.button.setPopupMode(QToolButton.MenuButtonPopup) + self.button.setMenu(QMenu()) + menu = self.button.menu() + menu.addAction(self.button.defaultAction()) + + menu = self.button.menu() + action = self.createAction(model) + menu.addAction(action) + + def createAction(self, model): + """ @type model: ButtonModelMixin""" + action = QAction(self.button) + action.setText(model.getButtonName()) + action.setEnabled(model.buttonIsEnabled()) + action.triggered.connect(model.buttonTriggered) + model.observable().attach(ButtonModelMixin.BUTTON_STATE_CHANGED_EVENT, self.modelChanged) + self.models[model] = action + return action + + def modelChanged(self): + for model in self.models: + assert isinstance(model, ButtonModelMixin) + action = self.models[model] + action.setText(model.getButtonName()) + action.setEnabled(model.buttonIsEnabled()) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/check_list.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/check_list.py new file mode 100644 index 0000000000..7f1898444b --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/check_list.py @@ -0,0 +1,153 @@ +from PyQt4.QtCore import QSize, Qt, SIGNAL +from PyQt4.QtGui import QToolButton, QHBoxLayout, QLabel, QListWidget, QWidget, QVBoxLayout, QListWidgetItem, QMenu, QAction, QAbstractItemView, QListView +from ert_gui.models.mixins import ListModelMixin, SelectableModelMixin +from ert_gui.widgets.search_box import SearchBox +from ert_gui.widgets.util import resourceIcon +from ert_gui.widgets.helped_widget import HelpedWidget + + +class CheckList(HelpedWidget): + + def __init__(self, model, label="", help_link=""): + HelpedWidget.__init__(self, "", help_link) + + layout = QVBoxLayout() + + widget = QWidget() + widget.setLayout(layout) + + self.checkAllButton = QToolButton() + self.checkAllButton.setIcon(resourceIcon("checked")) + self.checkAllButton.setIconSize(QSize(16, 16)) + self.checkAllButton.setToolButtonStyle(Qt.ToolButtonIconOnly) + self.checkAllButton.setAutoRaise(True) + self.checkAllButton.setToolTip("Select all") + + self.uncheckAllButton = QToolButton() + self.uncheckAllButton.setIcon(resourceIcon("notchecked")) + self.uncheckAllButton.setIconSize(QSize(16, 16)) + self.uncheckAllButton.setToolButtonStyle(Qt.ToolButtonIconOnly) + self.uncheckAllButton.setAutoRaise(True) + self.uncheckAllButton.setToolTip("Unselect all") + + self.list = QListWidget() + self.list.setContextMenuPolicy(Qt.CustomContextMenu) + self.list.setSelectionMode(QAbstractItemView.ExtendedSelection) + + self.search_box = SearchBox() + + check_button_layout = QHBoxLayout() + + check_button_layout.setMargin(0) + check_button_layout.setSpacing(0) + check_button_layout.addWidget(QLabel(label)) + check_button_layout.addStretch(1) + check_button_layout.addWidget(self.checkAllButton) + check_button_layout.addWidget(self.uncheckAllButton) + + layout.addLayout(check_button_layout) + layout.addWidget(self.list) + layout.addWidget(self.search_box) + + self.addWidget(widget) + + self.connect(self.checkAllButton, SIGNAL('clicked()'), self.checkAll) + self.connect(self.uncheckAllButton, SIGNAL('clicked()'), self.uncheckAll) + self.connect(self.list, SIGNAL('itemChanged(QListWidgetItem*)'), self.itemChanged) + self.search_box.filterChanged.connect(self.filterList) + # self.connect(self.search_box, SIGNAL('filterChanged(str)'), self.filterList) + + self.connect(self.list, SIGNAL('customContextMenuRequested(QPoint)'), self.showContextMenu) + + assert isinstance(model, (SelectableModelMixin, ListModelMixin)) + self.model = model + self.model.observable().attach(SelectableModelMixin.SELECTION_CHANGED_EVENT, self.modelChanged) + self.model.observable().attach(ListModelMixin.LIST_CHANGED_EVENT, self.modelChanged) + self.modelChanged() + + def itemChanged(self, item): + """@type item: QListWidgetItem""" + if item.checkState() == Qt.Checked: + self.model.selectValue(str(item.text())) + elif item.checkState() == Qt.Unchecked: + self.model.unselectValue(str(item.text())) + else: + raise AssertionError("Unhandled checkstate!") + + def modelChanged(self): + self.list.clear() + + items = self.model.getList() + + for item in items: + list_item = QListWidgetItem(item) + list_item.setFlags(list_item.flags() | Qt.ItemIsUserCheckable) + + if self.model.isValueSelected(item): + list_item.setCheckState(Qt.Checked) + else: + list_item.setCheckState(Qt.Unchecked) + + self.list.addItem(list_item) + + self.filterList(self.search_box.filter()) + + def setSelectionEnabled(self, enabled): + self.setEnabled(enabled) + self.checkAllButton.setEnabled(enabled) + self.uncheckAllButton.setEnabled(enabled) + + def filterList(self, filter): + filter = filter.lower() + + for index in range(0, self.list.count()): + item = self.list.item(index) + text = str(item.text()).lower() + + if filter == "": + item.setHidden(False) + elif filter in text: + item.setHidden(False) + else: + item.setHidden(True) + + + def checkAll(self): + self.model.selectAll() + + def uncheckAll(self): + self.model.unselectAll() + + def checkSelected(self): + items = [] + for item in self.list.selectedItems(): + items.append(str(item.text())) + + for item in items: + self.model.selectValue(item) + + def uncheckSelected(self): + items = [] + for item in self.list.selectedItems(): + items.append(str(item.text())) + + for item in items: + self.model.unselectValue(item) + + def showContextMenu(self, point): + p = self.list.mapToGlobal(point) + menu = QMenu() + check_selected = menu.addAction("Check selected") + uncheck_selected = menu.addAction("Uncheck selected") + menu.addSeparator() + clear_selection = menu.addAction("Clear selection") + + selected_item = menu.exec_(p) + + if selected_item == check_selected: + self.checkSelected() + elif selected_item == uncheck_selected: + self.uncheckSelected() + elif selected_item == clear_selection: + self.list.clearSelection() + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/cogwheel.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/cogwheel.py index 6d54588bce..63c61597dc 100644 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/cogwheel.py +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/cogwheel.py @@ -92,7 +92,7 @@ def _createCogwheel(self, size): out = not out def setRunning(self, bool): - """Set wether it should animat or not""" + """Set wether it should animate or not""" self.running = bool def isRunning(self): diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/combo_choice.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/combo_choice.py new file mode 100644 index 0000000000..5a8099f320 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/combo_choice.py @@ -0,0 +1,89 @@ +# Copyright (C) 2011 Statoil ASA, Norway. +# +# The file 'combo_choice.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +from PyQt4.QtCore import SIGNAL +from PyQt4.QtGui import QComboBox +from ert_gui.models.mixins import ChoiceModelMixin +from ert_gui.widgets.helped_widget import HelpedWidget + + +class ComboChoice(HelpedWidget): + """ + A combo box widget for choices. + List of objects retrieved from model + str(item) is used for presentation + getValue and setValue uses the same object as from the list + """ + def __init__(self, model, combo_label="Choice", help_link=""): + HelpedWidget.__init__(self, combo_label, help_link) + + assert model is not None and isinstance(model, ChoiceModelMixin) + self.model = model + + + model.observable().attach(ChoiceModelMixin.CURRENT_CHOICE_CHANGED_EVENT, self.getCurrentFromModel) + model.observable().attach(ChoiceModelMixin.CHOICE_LIST_CHANGED_EVENT, self.updateChoicesFromModel) + + self.combo = QComboBox() + + self.combo.addItem("Fail!") + + self.addWidget(self.combo) + self.addStretch() + + self.choice_list = None + """ @type: list """ + + self.connect(self.combo, SIGNAL('currentIndexChanged(int)'), self.selectionChanged) + + self.updateChoicesFromModel() + self.getCurrentFromModel() + + + def selectionChanged(self, index): + assert 0 <= index < len(self.choice_list), "Should not happen! Index out of range: 0 <= %i < %i" % (index, len(self.choice_list)) + + item = self.choice_list[index] + self.model.setCurrentChoice(item) + + + def getCurrentFromModel(self): + new_value = self.model.getCurrentChoice() + + if self.choice_list is None: + self.updateChoicesFromModel() + + if new_value in self.choice_list: + index = self.choice_list.index(new_value) + if not index == self.combo.currentIndex(): + self.combo.setCurrentIndex(index) + else: + self.combo.setCurrentIndex(0) + + #sys.stderr.write("AssertionError: ComboBox can not be set to: " + str(new_value) + "\n") + # raise AssertionError("ComboBox can not be set to: " + str(new_value)) + + + def updateChoicesFromModel(self): + block = self.combo.signalsBlocked() + self.combo.blockSignals(True) + + self.choice_list = self.model.getChoices() + + self.combo.clear() + for choice in self.choice_list: + self.combo.addItem(str(choice)) + + self.combo.blockSignals(block) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/combochoice.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/combochoice.py deleted file mode 100644 index 6813e8e99a..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/combochoice.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'combochoice.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - -import sys -from PyQt4 import QtGui, QtCore -from helpedwidget import * - -class ComboChoice(HelpedWidget): - """ - A combo box widget for choices. The data structure expected and sent to the getter and setter is a string - that is equal to one of the available ones. - """ - def __init__(self, parent=None, choiceList=None, comboLabel="Choice", help=""): - """Construct a ComboChoice widget""" - HelpedWidget.__init__(self, parent, comboLabel, help) - - self.combo = QtGui.QComboBox(self) - - if choiceList is None: - choiceList = ["No choices"] - - for choice in choiceList: - self.combo.addItem(str(choice)) - - self.addWidget(self.combo) - self.addStretch() - self.addHelpButton() - - self.connect(self.combo, QtCore.SIGNAL('currentIndexChanged(QString)'), self.updateContent) - - - def fetchContent(self): - """Retrieves data from the model and updates the combo box.""" - newValue = self.getFromModel() - - indexSet = False - for i in range(self.combo.count()): - if str(self.combo.itemText(i)).lower() == str(newValue).lower(): - self.combo.setCurrentIndex(i) - indexSet = True - break - - if not indexSet: - self.combo.setCurrentIndex(0) - sys.stderr.write("AssertionError: ComboBox can not be set to: " + str(newValue) + "\n") - #raise AssertionError("ComboBox can not be set to: " + str(newValue)) - - - - def updateList(self, choiceList): - """Replace the list of choices with the specified items""" - self.disconnect(self.combo, QtCore.SIGNAL('currentIndexChanged(QString)'), self.updateContent) - - self.combo.clear() - for choice in choiceList: - self.combo.addItem(choice) - - self.connect(self.combo, QtCore.SIGNAL('currentIndexChanged(QString)'), self.updateContent) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/configpanel.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/configpanel.py deleted file mode 100644 index 1000cc2782..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/configpanel.py +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'configpanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -from util import createSeparator - -class ConfigPanel(QtGui.QTabWidget): - """Convenience class for a tabbed configuration panel""" - - def __init__(self, parent=None): - """Creates a config panel widget""" - QtGui.QTabWidget.__init__(self, parent) - self.layoutQueue = [] - - - def startPage(self, name): - """Starts a new page of the configuration panel""" - self.pageName = name - self.contentPage = QtGui.QWidget() - self.formLayout = QtGui.QFormLayout() - self.formLayout.setLabelAlignment(QtCore.Qt.AlignRight) - - - def addRow(self, row, label=None): - """ - Add a new row on a configuration page. Returns the row widget. - If the row does not have a getLabel() function the row spans both columns. - """ - if hasattr(row, "getLabel") and not row.getLabel() == "": - self.formLayout.addRow(row.getLabel(), row) - else: - if label is None: - self.formLayout.addRow(row) - else: - self.formLayout.addRow(label, row) - - return row - - def endPage(self): - """Indicate the end of a complete configuration page.""" - self.contentPage.setLayout(self.formLayout) - self.addTab(self.contentPage, self.pageName) - - self.contentPage = None - self.formLayout = None - self.pageName = None - - def startGroup(self, groupTitle): - """Start a titled sub group on the page.""" - self.groupBox = QtGui.QGroupBox(groupTitle) - self.layoutQueue.append(self.formLayout) - self.formLayout = QtGui.QFormLayout() - self.formLayout.setLabelAlignment(QtCore.Qt.AlignRight) - - def endGroup(self): - """Finish the titled sub group""" - self.groupBox.setLayout(self.formLayout) - - self.formLayout = self.layoutQueue.pop() - self.formLayout.addRow(self.groupBox) - self.groupBox = None - - def addSeparator(self): - """Adds a separator line to the panel.""" - - self.formLayout.addRow(createSeparator()) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/double_box.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/double_box.py new file mode 100644 index 0000000000..38e8c8a726 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/double_box.py @@ -0,0 +1,32 @@ +class DoubleBox(HelpedWidget): + """DoubleBox shows a double value. The data structure expected and sent to the getter and setter is a double.""" + + def __init__(self, parent=None, pathLabel="Double", help=""): + """Construct a DoubleBox widget""" + HelpedWidget.__init__(self, parent, pathLabel, help) + + self.doubleBox = QtGui.QLineEdit() + self.doubleBox.setValidator(QtGui.QDoubleValidator(self)) + self.doubleBox.setMaximumWidth(75) + + #self.connect(self.doubleBox, QtCore.SIGNAL('editingFinished()'), self.validateString) + self.connect(self.doubleBox, QtCore.SIGNAL('editingFinished()'), self.contentsChanged) + self.connect(self.doubleBox, QtCore.SIGNAL('textChanged(QString)'), self.validateString) + self.addWidget(self.doubleBox) + + self.addStretch() + self.addHelpButton() + + + def validateString(self): + stringToValidate = str(self.doubleBox.text()) + if stringToValidate.strip() == "": + self.contentsChanged() + + def contentsChanged(self): + """Called whenever the contents of the editline changes.""" + self.updateContent(str(self.doubleBox.text())) + + def fetchContent(self): + """Retrieves data from the model and inserts it into the edit line""" + self.doubleBox.setText(str(self.getFromModel())) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/spinnerwidgets.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/double_spinner.py similarity index 53% rename from ThirdParty/Ert/devel/python/python/ert_gui/widgets/spinnerwidgets.py rename to ThirdParty/Ert/devel/python/python/ert_gui/widgets/double_spinner.py index c1610812ab..33a9fb3f84 100644 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/spinnerwidgets.py +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/double_spinner.py @@ -1,6 +1,6 @@ # Copyright (C) 2011 Statoil ASA, Norway. # -# The file 'spinnerwidgets.py' is part of ERT - Ensemble based Reservoir Tool. +# The file 'double_spinner.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,45 +12,10 @@ # FITNESS FOR A PARTICULAR PURPOSE. # # See the GNU General Public License at -# for more details. - - +# for more details. from PyQt4 import QtGui, QtCore -from helpedwidget import HelpedWidget - -class IntegerSpinner(HelpedWidget): - """A spinner widget for integers. The data structure expected and sent to the getter and setter is an integer.""" - def __init__(self, parent=None, spinnerLabel="Number", help="", min=0, max=10): - """Construct a spinner widget for integers""" - HelpedWidget.__init__(self, parent, spinnerLabel, help) - - self.spinner = QtGui.QSpinBox(self) - self.spinner.setMinimum(min) - self.spinner.setMaximum(max) - #self.connect(self.pathLine, QtCore.SIGNAL('textChanged(QString)'), self.validatePath) - self.addWidget(self.spinner) - - self.infoLabel = QtGui.QLabel() - self.infoLabel.setHidden(True) - self.addWidget(self.infoLabel) - - self.addStretch() - self.addHelpButton() - - #self.connect(self.spinner, QtCore.SIGNAL('valueChanged(int)'), self.updateContent) - self.connect(self.spinner, QtCore.SIGNAL('editingFinished()'), self.contentsChanged) - - def contentsChanged(self): - """Called whenever the contents of the spinner changes.""" - self.updateContent(self.spinner.value()) - - def fetchContent(self): - """Retrieves data from the model and inserts it into the spinner""" - self.spinner.setValue(self.getFromModel()) +from ert_gui.widgets.helped_widget import HelpedWidget - def setInfo(self, info): - self.infoLabel.setText(info) - self.infoLabel.setHidden(False) class DoubleSpinner(HelpedWidget): """A spinner widget for doubles. The data structure expected and sent to the getter and setter is a double.""" diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/help.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/help.py deleted file mode 100644 index 260f4a208b..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/help.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'help.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -import os -import sys - -# The variable @help_prefix should be set to point to a directory -# containing (directories) with html help files. In the current -# implementation this variable is set from the gert_main.py script. -help_prefix = None - - -def getTemplate(): - path = help_prefix + "template.html" - if os.path.exists(path) and os.path.isfile(path): - f = open(path, 'r') - template = f.read() - f.close() - return template - else: - return "%s" - - -def resolveHelpLabel(label): - """ - Reads a HTML file from the help directory. - The HTML must follow the specification allowed by QT here: http://doc.trolltech.com/4.6/richtext-html-subset.html - """ - - # This code can be used to find widgets with empty help labels -# if label.strip() == "": -# raise AssertionError("NOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!") - - path = help_prefix + label + ".html" - if os.path.exists(path) and os.path.isfile(path): - f = open(path, 'r') - help = f.read() - f.close() - return getTemplate() % help - else: - # This code automatically creates empty help files -# sys.stderr.write("Missing help file: '%s'\n" % label) -# if not label == "" and not label.find("/") == -1: -# sys.stderr.write("Creating help file: '%s'\n" % label) -# directory, filename = os.path.split(path) -# -# if not os.path.exists(directory): -# os.makedirs(directory) -# -# file_object = open(path, "w") -# file_object.write(label) -# file_object.close() - return "" diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/help_dock.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/help_dock.py new file mode 100644 index 0000000000..10ca77286b --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/help_dock.py @@ -0,0 +1,139 @@ +from PyQt4.QtCore import Qt, SIGNAL +from PyQt4.QtGui import QDockWidget, QLabel, QWidget, QVBoxLayout + +import os +from ert_gui.pages.message_center import MessageCenter + + +class HelpDock(QDockWidget): + __instance = None + help_prefix = None + default_help_string = "No help available!" + validation_template = ("" + "" + "" + "" + "
Notice:
%s
" + "") + + def __init__(self): + QDockWidget.__init__(self, "Help") + self.setObjectName("HelpDock") + + widget = QWidget() + widget.setStyleSheet("background-color: #ffffe0") + layout = QVBoxLayout() + widget.setLayout(layout) + + self.link_widget = QLabel() + self.link_widget.setStyleSheet("font-weight: bold") + self.link_widget.setMinimumHeight(20) + + self.help_widget = QLabel(HelpDock.default_help_string) + self.help_widget.setWordWrap(True) + self.help_widget.setTextFormat(Qt.RichText) + + self.validation_widget = QLabel("") + self.validation_widget.setWordWrap(True) + self.validation_widget.setScaledContents(True) + self.validation_widget.setAlignment(Qt.AlignHCenter) + self.validation_widget.setTextFormat(Qt.RichText) + + + layout.addWidget(self.link_widget) + layout.addWidget(self.help_widget) + layout.addStretch(1) + layout.addWidget(self.validation_widget) + + self.setWidget(widget) + + self.help_messages = {} + + MessageCenter().addHelpMessageListeners(self) + + def __new__(cls): + if cls.__instance is None: + cls.__instance = QDockWidget.__new__(cls) + return cls.__instance + return None + + + @classmethod + def getInstance(cls): + """ @rtype: HelpDock """ + if cls.__instance is None: + cls() + + return cls.__instance + + @classmethod + def setHelpMessageLink(cls, help_link): + instance = cls.getInstance() + if not help_link in instance.help_messages: + help_message = HelpDock.resolveHelpLink(help_link) + if help_message is not None: + instance.help_messages[help_link] = help_message + else: + instance.help_messages[help_link] = instance.default_help_string + + instance.link_widget.setText(help_link) + instance.help_widget.setText(instance.help_messages[help_link]) + instance.validation_widget.setText("") + + @classmethod + def setValidationMessage(cls, message): + instance = cls.getInstance() + instance.validation_widget.setHidden(message is None) + instance.validation_widget.setText(instance.validation_template % message) + + + # The setHelpLinkPrefix should be set to point to a directory + # containing (directories) with html help files. In the current + # implementation this variable is set from the gert_main.py script. + @classmethod + def setHelpLinkPrefix(cls, prefix): + cls.help_prefix = prefix + + @classmethod + def getTemplate(cls): + path = cls.help_prefix + "template.html" + if os.path.exists(path) and os.path.isfile(path): + f = open(path, 'r') + template = f.read() + f.close() + return template + else: + return "%s" + + @classmethod + def resolveHelpLink(cls, help_link): + """ + Reads a HTML file from the help directory. + The HTML must follow the specification allowed by QT here: http://doc.trolltech.com/4.6/richtext-html-subset.html + """ + + # This code can be used to find widgets with empty help labels + # if label.strip() == "": + # raise AssertionError("NOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!") + + path = cls.help_prefix + help_link + ".html" + if os.path.exists(path) and os.path.isfile(path): + f = open(path, 'r') + help = f.read() + f.close() + return cls.getTemplate() % help + else: + # This code automatically creates empty help files + # sys.stderr.write("Missing help file: '%s'\n" % label) + # if not label == "" and not label.find("/") == -1: + # sys.stderr.write("Creating help file: '%s'\n" % label) + # directory, filename = os.path.split(path) + # + # if not os.path.exists(directory): + # os.makedirs(directory) + # + # file_object = open(path, "w") + # file_object.write(label) + # file_object.close() + return None + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/helped_widget.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/helped_widget.py new file mode 100644 index 0000000000..ceaa74ec8f --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/helped_widget.py @@ -0,0 +1,82 @@ +from PyQt4.QtCore import QSize +from PyQt4.QtGui import QWidget, QColor, QLabel, QHBoxLayout +from ert_gui.pages.message_center import MessageCenter + +from ert_gui.widgets.util import resourceImage + + +class HelpedWidget(QWidget): + """ + HelpedWidget is a class that enables embedded help messages in widgets. + """ + + STRONG_ERROR_COLOR = QColor(255, 215, 215) + ERROR_COLOR = QColor(255, 235, 235) + INVALID_COLOR = QColor(235, 235, 255) + + WARNING = "warning" + EXCLAMATION = "exclamation" + + def __init__(self, widget_label="", help_link=""): + QWidget.__init__(self) + + self.validation_label = QLabel() + self.validation_label.setMaximumSize(QSize(16, 16)) + self.validation_label.setPixmap(resourceImage(HelpedWidget.WARNING)) + self.validation_label.setHidden(True) + + if not widget_label == "": + self.label = widget_label + ":" + else: + self.label = "" + + self.help_link = help_link + self.validation_message = None + self.validation_type = None + + self.widget_layout = QHBoxLayout() + self.widget_layout.setMargin(0) + self.widget_layout.addWidget(self.validation_label) + self.setLayout(self.widget_layout) + + + def getLabel(self): + """Returns the label of this widget if set or empty string.""" + return self.label + + def addLayout(self, layout): + """Add a layout to the layout of this widget.""" + self.widget_layout.addLayout(layout) + + + def addWidget(self, widget): + """Add a widget to the layout of this widget.""" + self.widget_layout.addWidget(widget) + + def addStretch(self, stretch=1): + """Add stretch between widgets. """ + self.widget_layout.addStretch(stretch) + + def setValidationMessage(self, message, validation_type=WARNING): + """Add a warning or information icon to the widget with a tooltip""" + if message == "": + self.validation_type = None + self.validation_message = None + self.validation_label.setHidden(True) + self.validation_label.setToolTip("") + else: + self.validation_type = validation_type + self.validation_message = message + self.validation_label.setHidden(False) + self.validation_label.setToolTip(message) + self.validation_label.setPixmap(resourceImage(validation_type)) + + MessageCenter().setWarning(self, self.validation_message) + + def enterEvent(self, event): + QWidget.enterEvent(self, event) + MessageCenter().setHelpMessageLink(self.help_link) + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/helpedwidget.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/helpedwidget.py deleted file mode 100644 index ce46086536..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/helpedwidget.py +++ /dev/null @@ -1,307 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'helpedwidget.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -import help -import sys -from util import resourceIcon, resourceImage -import inspect -import ert.ert.enums as enums - -def abstract(): - """Abstract keyword that indicate an abstract function""" - import inspect - caller = inspect.getouterframes(inspect.currentframe())[1][3] - raise NotImplementedError(caller + ' must be implemented in subclass') - -class UpdateOperations(enums.enum): - INSERT = None - REMOVE = None - UPDATE = None -UpdateOperations.INSERT = UpdateOperations("Insert", 1) -UpdateOperations.REMOVE = UpdateOperations("Remove", 2) -UpdateOperations.UPDATE = UpdateOperations("Update", 3) - - -class ContentModel: - """This class is a wrapper for communication between the model and the view.""" - contentModel = None - signalManager = QtCore.QObject() - observers = [] - - INSERT = UpdateOperations.INSERT - REMOVE = UpdateOperations.REMOVE - UPDATE = UpdateOperations.UPDATE - - def __init__(self): - """Constructs a ContentModel. All inheritors are registered""" - ContentModel.observers.append(self) - - def initialize(self, model): - """Should be implemented by inheriting classes that wants to do some one time initialization before getting and setting.""" - abstract() - - def getter(self, model): - """MUST be implemented to get data from a source. Should not be called directly.""" - abstract() - - def setter(self, model, value): - """MUST be implemented to update the source with new data. Should not be called directly.""" - abstract() - - def insert(self, model, value): - """Can be implemented to insert new data to the source. Should not be called directly.""" - abstract() - - def remove(self, model, value): - """Can be implemented to remove data from the source. Should not be called directly.""" - abstract() - - def fetchContent(self): - """MUST be implemented. This function is called to tell all inheriting classes to retrieve data from the model. """ - abstract() - - def getFromModel(self): - """Retrieves the data from the model. Calls the getter function with an appropriate model.""" - gargs = inspect.getargspec(self.getter) - - if inspect.isfunction(self.getter) and "self" in gargs[0]: - data = self.getter.__call__(self, ContentModel.contentModel) - else: - data = self.getter(ContentModel.contentModel) - - return data - - def updateContent(self, value, operation = UPDATE): - """ - Sends updated data to the model. - Calls the a function with an appropriate model. - The function is one of INSERT, REMOVE, UPDATE which corresponds to insert, remove and setter - Any value returned by insert, remove or setter is also returned to the caller of this function - - Emits a SIGNAL 'contentsChanged()' after the function has been called. - Emits a SIGNAL 'contentsChanged(int)' after the function has been called, where int is the operation performed. - """ - if not ContentModel.contentModel is None : - if ContentModel.INSERT == operation: - result = self.insert(ContentModel.contentModel, value) - elif ContentModel.REMOVE == operation: - result = self.remove(ContentModel.contentModel, value) - elif ContentModel.UPDATE == operation: - result = self.setter(ContentModel.contentModel, value) - else: - sys.stderr.write("Unknown operation: %d\n" % (operation)) - return - - self.emit(QtCore.SIGNAL('contentsChanged()')) - self.emit(QtCore.SIGNAL('contentsChanged(int)'), operation) - - return result - - def getModel(self): - """Returns the contentModel associated with this session""" - return ContentModel.contentModel - - # The modelConnect, modelDisconnect and modelEmit uses Qt signal handling to enable communication between - # separate parts of the model that needs to know about changes. - @classmethod - def modelConnect(cls, signal, callable): - """Connect to a custom signal available to all ContentModel objects.""" - QtCore.QObject.connect(ContentModel.signalManager, QtCore.SIGNAL(signal), callable) - - @classmethod - def modelDisconnect(cls, signal, callable): - """Disconnect from a custom signal available to all ContentModel objects.""" - QtCore.QObject.disconnect(ContentModel.signalManager, QtCore.SIGNAL(signal), callable) - - @classmethod - def modelEmit(cls, signal, *args): - """Emit a custom signal available to all ContentModel objects.""" - ContentModel.signalManager.emit(QtCore.SIGNAL(signal), *args) - - @classmethod - def updateObservers(cls): - """ - Calls all ContentModel inheritors to initialize (if implemented) and perform initial fetch of data. - The signal 'initialized()' is emitted after initialization and fetching is completed. - """ - for o in ContentModel.observers: - try: - o.initialize(ContentModel.contentModel) - except NotImplementedError: - sys.stderr.write("Missing initializer: " + o.helpLabel + "\n") - except Exception: - sys.stderr.write("Caught an exception during initialization!\n") - - #try: - o.fetchContent() - #except Exception: - # sys.stderr.write("Caught an exception while fetching!\n") - - ContentModel.modelEmit('initialized()') - - @classmethod - def printObservers(cls): - """Convenience method for printing the registered inheritors.""" - for o in ContentModel.observers: - print o - - @classmethod - def emptyInitializer(cls, model): - """An empty initializer. Provided for convenience.""" - pass - -class ContentModelProxy: - """ - A ContentModelProxy adds an apply mode to a ContentModel - The proxy sits between the widget and the updateContent function call - and delays the updateContent call until the apply function of the proxy is called. - It only relays the last updateContent call (for a single instance) so it should only - be used in situations when this is the desired behaviour. - """ - def __init__(self): - self.objectFunctions = {} - self.objectContent = {} - - def proxifyObject(self, object): - """ - This function is here because lambdas loose context in loops. - Lambdas point to the variable and not the content. - """ - self.objectFunctions[object] = object.updateContent - object.updateContent = lambda value, operation = ContentModel.UPDATE : self._proxyUpdateContent(object, value, - operation) - - def proxify(self, *objects): - """Add a ContenModel instance to this proxy group""" - for object in objects: - self.proxifyObject(object) - - def _proxyUpdateContent(self, object, value, operation): - self.objectContent[object] = (value, operation) - - def apply(self): - """Perform all delayed updateContent calls""" - for key in self.objectFunctions.keys(): - function = self.objectFunctions[key] - if self.objectContent.has_key(key): - data = self.objectContent[key] - function(data[0], data[1]) - else: - #This usually means that no value has been sent to the setter - #print "Unknown key: %s" % (str(key)) - pass - - - -class HelpedWidget(QtGui.QWidget, ContentModel): - """ - HelpedWidget is a class that enables embedded help messages in widgets. - The help button must manually be added to the containing layout with addHelpButton(). - """ - - STRONG_ERROR_COLOR = QtGui.QColor(255, 215, 215) - ERROR_COLOR = QtGui.QColor(255, 235, 235) - INVALID_COLOR = QtGui.QColor(235, 235, 255) - - WARNING = "warning" - EXCLAMATION = "exclamation" - - def __init__(self, parent=None, widgetLabel="", helpLabel=""): - """Creates a widget that can have a help button""" - QtGui.QWidget.__init__(self, parent) - ContentModel.__init__(self) - - - self.validationLabel = QtGui.QLabel() - self.validationLabel.setMaximumSize(QtCore.QSize(16, 16)) - self.validationLabel.setPixmap(resourceImage("warning")) - self.validationLabel.setHidden(True) - - if not widgetLabel == "": - self.label = widgetLabel + ":" - else: - self.label = "" - - self.helpMessage = help.resolveHelpLabel(helpLabel) - self.helpLabel = helpLabel - - self.widgetLayout = QtGui.QHBoxLayout() - #self.setStyleSheet("padding: 2px") - self.widgetLayout.setMargin(0) - self.widgetLayout.addWidget(self.validationLabel) - self.setLayout(self.widgetLayout) - - - def getHelpButton(self): - """Returns the help button or None""" - try: - self.helpButton - except AttributeError: - self.helpButton = None - - return self.helpButton - - def showHelp(self): - """Pops up the tooltip associated to the button""" - QtGui.QToolTip.showText(QtGui.QCursor.pos(), self.helpMessage, self) - - def addHelpButton(self): - """Adds the help button to the provided layout.""" - - self.helpButton = QtGui.QToolButton(self) - - self.helpButton.setIcon(resourceIcon("help")) - self.helpButton.setIconSize(QtCore.QSize(16, 16)) - self.helpButton.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly) - self.helpButton.setAutoRaise(True) - - self.connect(self.helpButton, QtCore.SIGNAL('clicked()'), self.showHelp) - - if self.helpMessage == "": - self.helpButton.setEnabled(False) - - if not self.getHelpButton() is None : - self.addWidget(self.getHelpButton()) - - def getLabel(self): - """Returns the label of this widget if set or empty string.""" - return self.label - - def addLayout(self, layout): - """Add a layout to the layout of this widget.""" - self.widgetLayout.addLayout(layout) - - - def addWidget(self, widget): - """Add a widget to the layout of this widget.""" - self.widgetLayout.addWidget(widget) - - def addStretch(self): - """Add stretch between widgets. Usually added between a widget and the help button.""" - self.widgetLayout.addStretch(1) - - def setValidationMessage(self, message, validationType=WARNING): - """Add a warning or information icon to the widget with a tooltip""" - if message == "": - self.validationLabel.setHidden(True) - self.validationLabel.setToolTip("") - else: - self.validationLabel.setHidden(False) - self.validationLabel.setToolTip(message) - self.validationLabel.setPixmap(resourceImage(validationType)) - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/integer_spinner.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/integer_spinner.py new file mode 100644 index 0000000000..6d69259cd1 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/integer_spinner.py @@ -0,0 +1,50 @@ +from PyQt4.QtCore import SIGNAL +from PyQt4.QtGui import QSpinBox, QLabel +from ert_gui.models.mixins import SpinnerModelMixin +from ert_gui.widgets.helped_widget import HelpedWidget + + +class IntegerSpinner(HelpedWidget): + """A spinner widget for integers. The data structure expected and sent to the getter and setter is an integer.""" + def __init__(self, model, spinner_label="Integer Number", help_link=""): + HelpedWidget.__init__(self, spinner_label, help_link) + + assert isinstance(model, SpinnerModelMixin) + self.model = model + model.observable().attach(SpinnerModelMixin.SPINNER_VALUE_CHANGED_EVENT, self.getValueFromModel) + model.observable().attach(SpinnerModelMixin.RANGE_VALUE_CHANGED_EVENT, self.getRangeFromModel) + + self.spinner = QSpinBox(self) + self.addWidget(self.spinner) + + self.info_label = QLabel() + self.info_label.setHidden(True) + self.addWidget(self.info_label) + + self.addStretch() + + # self.connect(self.spinner, SIGNAL('editingFinished()'), self.updateModel) + self.__initialized = False + self.connect(self.spinner, SIGNAL('valueChanged(int)'), self.updateModel) + + self.getRangeFromModel() + self.getValueFromModel() + + def updateModel(self): + """Called whenever the contents of the spinner changes.""" + if self.__initialized: + self.model.setSpinnerValue(self.spinner.value()) + + def getRangeFromModel(self): + self.spinner.setMinimum(self.model.getMinValue()) + self.spinner.setMaximum(self.model.getMaxValue()) + + def getValueFromModel(self): + """Retrieves data from the model and inserts it into the spinner""" + if not self.__initialized: + self.__initialized = True + self.spinner.setValue(self.model.getSpinnerValue()) + + def setInfo(self, info): + self.info_label.setText(info) + self.info_label.setHidden(False) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/keyword_list.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/keyword_list.py new file mode 100644 index 0000000000..af18e014aa --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/keyword_list.py @@ -0,0 +1,85 @@ +from PyQt4.QtGui import QListWidget, QInputDialog, QLineEdit, QMessageBox, QAbstractItemView +from ert_gui.models.mixins import ListModelMixin +from ert_gui.widgets.add_remove_widget import AddRemoveWidget +from ert_gui.widgets.helped_widget import HelpedWidget + + +class KeywordList(HelpedWidget): + """Shows a list of keywords. The data structure expected and sent to the getter and setter is an array of values.""" + def __init__(self, model, list_label="", help_link=""): + HelpedWidget.__init__(self, list_label, help_link) + + assert isinstance(model, ListModelMixin) + self.model = model + self.keyword_list = [] + + self.list = QListWidget(self) + self.list.setMinimumHeight(100) + self.list.setMaximumHeight(150) + self.default_selection_mode = self.list.selectionMode() + + + self.addWidget(self.list) + + self.addRemoveWidget = AddRemoveWidget(self.addItem, self.removeItem) + self.addWidget(self.addRemoveWidget) + + self.title = "New keyword" + self.description = "Enter name of keyword:" + + self.model.observable().attach(ListModelMixin.LIST_CHANGED_EVENT, self.modelChanged) + + self.modelChanged() + + def setSelectable(self, selectable): + if selectable: + self.list.setSelectionMode(self.default_selection_mode) + else: + self.list.setSelectionMode(QAbstractItemView.NoSelection) + + def setPopupLabels(self, title, description): + """Change the labels of the default popup.""" + self.title = title + self.description = description + + def newKeywordPopup(self, keyword_list): + """ + Pops up a message box asking for a new keyword. + Override this and return a string to customize the input dialog - Empty string equals canceled. + The provided list are the already defined keywords + """ + new_keyword, ok = QInputDialog.getText(self, self.tr(self.title), self.tr(self.description), QLineEdit.Normal) + + if ok: + return str(new_keyword).strip() + else: + return "" + + def addItem(self): + """Called by the add button to insert a new keyword""" + new_keyword = self.newKeywordPopup(self.keyword_list) + if not new_keyword == "": + self.model.addItem(new_keyword) + + + def removeItem(self): + """Called by the remove button to remove a selected keyword""" + if not self.list.currentItem() is None: + row = self.list.currentRow() + try: + self.model.removeItem(self.keyword_list[row]) + except NotImplementedError: + message = "Support for removal of items has not been implemented!" + QMessageBox.information(self, "Not implemented!", message) + + + def modelChanged(self): + """Retrieves data from the model and inserts it into the list""" + keywords = self.model.getList() + + self.list.clear() + + self.keyword_list = keywords + + for keyword in keywords: + self.list.addItem(keyword) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/keyword_table.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/keyword_table.py new file mode 100644 index 0000000000..5b3a29ab47 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/keyword_table.py @@ -0,0 +1,98 @@ +from PyQt4.QtCore import SIGNAL, Qt +from PyQt4.QtGui import QTableWidget, QAbstractItemView, QMessageBox, QTableWidgetItem, QInputDialog, QLineEdit +from ert_gui.models.mixins import DictionaryModelMixin +from ert_gui.widgets.add_remove_widget import AddRemoveWidget +from ert_gui.widgets.helped_widget import HelpedWidget + + +class KeywordTable(HelpedWidget): + """Shows a table of key/value pairs. The data structure expected and sent to the getter and setter is a dictionary of values.""" + def __init__(self, model, table_label="", help_link=""): + HelpedWidget.__init__(self, table_label, help_link) + + self.table = QTableWidget(self) + self.table.setColumnCount(2) + self.setColumnHeaders() + self.table.verticalHeader().setHidden(True) + self.table.setColumnWidth(0, 150) + self.table.horizontalHeader().setStretchLastSection(True) + + self.table.setMinimumHeight(110) + self.table.setSelectionMode(QAbstractItemView.SingleSelection) + self.table.setSelectionBehavior(QAbstractItemView.SelectRows) + + self.addWidget(self.table) + + self.addWidget(AddRemoveWidget(self.addItem, self.removeItem)) + + self.connect(self.table, SIGNAL('cellChanged(int,int)'), self.tableChanged) + + assert isinstance(model, DictionaryModelMixin) + self.model = model + model.observable().attach(DictionaryModelMixin.DICTIONARY_CHANGED_EVENT, self.modelChanged) + self.modelChanged() + + + def setColumnHeaders(self, keyword_name="Keyword", value_name="Value"): + self.headers = [keyword_name, value_name] + self.table.setHorizontalHeaderLabels(self.headers) + + def addItem(self): + """Called by the add button to insert a new keyword""" + title = "New %s" % self.headers[0] + description = "Enter new %s:" % self.headers[0] + (new_keyword, ok) = QInputDialog.getText(self, title, description, QLineEdit.Normal) + + if ok: + new_keyword = str(new_keyword).strip() + self.model.addKey(new_keyword) + + def removeItem(self): + """Called by the remove button to remove a selected keyword""" + current_row = self.table.currentRow() + + if current_row >= 0: + do_delete = QMessageBox.question(self, "Delete row?", "Are you sure you want to delete the key/value pair?", QMessageBox.Yes | QMessageBox.No ) + + if do_delete: + key_item = self.table.item(current_row, 0) + if key_item is not None: + key = str(key_item.text()).strip() + self.model.removeKey(key) + + + def tableChanged(self, row, column): + """Called whenever the contents of a cell changes.""" + key_item = self.table.item(row, 0) + + if key_item is not None: + key = str(key_item.text()).strip() + value_item = self.table.item(row, 1) + + if value_item is not None: + value = str(value_item.text()).strip() + + self.model.setValueForKey(key, value) + + + def modelChanged(self): + """Retrieves data from the model and inserts it into the table.""" + values = self.model.getDictionary() + + blocked = self.table.blockSignals(True) + + for row in reversed(range(self.table.rowCount())): + self.table.removeRow(row) + + row = 0 + for key in values: + key_item = QTableWidgetItem(str(key)) + key_item.setFlags(key_item.flags() ^ Qt.ItemIsEditable) + value_item = QTableWidgetItem(str(values[key])) + self.table.insertRow(row) + self.table.setItem(row, 0, key_item) + self.table.setItem(row, 1, value_item) + row += 1 + + self.table.blockSignals(blocked) + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/legend.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/legend.py new file mode 100644 index 0000000000..729c1bb409 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/legend.py @@ -0,0 +1,42 @@ +from PyQt4.QtCore import QSize +from PyQt4.QtGui import QWidget, QPainter, QHBoxLayout, QLabel + + +class LegendMarker(QWidget): + """A widget that shows a colored box""" + def __init__(self, color): + QWidget.__init__(self) + + self.setMaximumSize(QSize(12, 12)) + self.setMinimumSize(QSize(12, 12)) + + self.color = color + + def paintEvent(self, paintevent): + """Paints the box""" + painter = QPainter(self) + + rect = self.contentsRect() + rect.setWidth(rect.width() - 1) + rect.setHeight(rect.height() - 1) + painter.drawRect(rect) + + rect.setX(rect.x() + 1) + rect.setY(rect.y() + 1) + painter.fillRect(rect, self.color) + +class Legend(QWidget): + """Combines a LegendMarker with a label""" + def __init__(self, legend, color): + QWidget.__init__(self) + + layout = QHBoxLayout() + + legendMarker = LegendMarker(color) + legendMarker.setToolTip(legend) + + layout.addWidget(legendMarker) + layout.addWidget(QLabel(legend)) + layout.addStretch() + + self.setLayout(layout) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/path_chooser.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/path_chooser.py new file mode 100644 index 0000000000..3a0f42b352 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/path_chooser.py @@ -0,0 +1,185 @@ +# Copyright (C) 2011 Statoil ASA, Norway. +# +# The file 'path_chooser.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +import os +import re +from PyQt4.QtCore import SIGNAL, QSize +from PyQt4.QtGui import QLineEdit, QToolButton, QFileDialog +from ert_gui.models.mixins import PathModelMixin +from ert_gui.widgets.util import resourceIcon +from ert_gui.widgets.helped_widget import HelpedWidget + + +class PathChooser(HelpedWidget): + """ + PathChooser shows, enables choosing of and validates paths. + The data structure expected and sent to the models getValue and setValue is a string. + """ + + file_does_not_exist_msg = "The specified path does not exist." + file_is_not_executable_msg = "The specified file is not an executable." + path_is_not_a_file_msg = "The specified path must be a file." + required_field_msg = "A value is required." + +# UNDEFINED = 0 +# REQUIRED = 1 +# FILE = 2 +# DIRECTORY = 4 +# MUST_EXIST = 8 +# EXECUTABLE = 16 + + def __init__(self, model, path_label="Path", help_link=""): + HelpedWidget.__init__(self, path_label, help_link) + + self.__editing = True + + self.path_line = QLineEdit() + + self.addWidget(self.path_line) + + dialog_button = QToolButton(self) + dialog_button.setIcon(resourceIcon("folder")) + dialog_button.setIconSize(QSize(16, 16)) + self.connect(dialog_button, SIGNAL('clicked()'), self.selectDirectory) + self.addWidget(dialog_button) + + self.valid_color = self.path_line.palette().color(self.path_line.backgroundRole()) + + self.path_line.setText(os.getcwd()) + self.__editing = False + + assert isinstance(model, PathModelMixin) + self.model = model + model.observable().attach(PathModelMixin.PATH_CHANGED_EVENT, self.getPathFromModel) + self.getPathFromModel() + + self.connect(self.path_line, SIGNAL('editingFinished()'), self.validatePath) + self.connect(self.path_line, SIGNAL('editingFinished()'), self.contentsChanged) + self.connect(self.path_line, SIGNAL('textChanged(QString)'), self.validatePath) + + + def getValidationTypeAndColor(self): + """Returns the type of validation message and the color that should be applied""" + if self.model.pathIsRequired(): + color = self.ERROR_COLOR + validity_type = self.WARNING + else: + color = self.INVALID_COLOR + validity_type = self.EXCLAMATION + return validity_type, color + + def validatePath(self): + """Called whenever the path is modified""" + palette = self.path_line.palette() + + path = self.getPath().strip() + exists = os.path.exists(path) + + color = self.valid_color + message = "" + validity_type = self.WARNING + + self.valid = True + + if path == "" and self.model.pathIsRequired(): + message = self.required_field_msg + color = self.ERROR_COLOR + self.valid = False + elif not exists: + if self.model.pathMustExist(): + message = self.file_does_not_exist_msg + self.valid = False + validity_type, color = self.getValidationTypeAndColor() + elif exists: + if self.model.pathMustBeExecutable() and os.path.isfile(path) and not os.access(path, os.X_OK): + validity_type, color = self.getValidationTypeAndColor() + message = self.file_is_not_executable_msg + self.valid = False + elif self.model.pathMustBeExecutable() and not os.path.isfile(path): + validity_type, color = self.getValidationTypeAndColor() + message = self.path_is_not_a_file_msg + self.valid = False + + + self.setValidationMessage(message, validity_type) + self.path_line.setToolTip(message) + palette.setColor(self.path_line.backgroundRole(), color) + + self.path_line.setPalette(palette) + + + def getPath(self): + """Returns the path""" + return str(self.path_line.text()) + + def pathExists(self): + """Returns True if the entered path exists""" + return os.path.exists(self.getPath()) + + def isValid(self): + """Returns the validation value""" + return self.valid + + + def selectDirectory(self): + """Pops up the 'select a directory' dialog""" + self.__editing = True + currentDirectory = self.getPath() + + #if not os.path.exists(currentDirectory): + # currentDirectory = "~" + + if self.model.pathMustBeAFile(): + currentDirectory = QFileDialog.getOpenFileName(self, "Select a path", currentDirectory) + else: + currentDirectory = QFileDialog.getExistingDirectory(self, "Select a directory", currentDirectory) + + if not currentDirectory == "": + if not self.model.pathMustBeAbsolute(): + cwd = os.getcwd() + match = re.match(cwd + "/(.*)", currentDirectory) + if match: + currentDirectory = match.group(1) + + self.path_line.setText(currentDirectory) + self.model.setPath(self.getPath()) + + self.__editing = False + + + def contentsChanged(self): + """Called whenever the path is changed.""" + if not self.__editing: + if self.model.pathIsRequired() and (self.model.pathMustExist() and self.pathExists()): + # print("Pathchooser value set!") + self.model.setPath(self.getPath()) + + #todo: FIX!!!! + + # else: + # print("Pathchooser value not set!") + + + def getPathFromModel(self): + """Retrieves data from the model and inserts it into the edit line""" + self.__editing = True + + path = self.model.getPath() + if path is None: + path = "" + + self.path_line.setText("%s" % path) + self.__editing = False + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/path_format.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/path_format.py new file mode 100644 index 0000000000..66fb755c46 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/path_format.py @@ -0,0 +1,117 @@ +# Copyright (C) 2011 Statoil ASA, Norway. +# +# The file 'path_format.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +import re +from PyQt4.QtCore import SIGNAL +from PyQt4.QtGui import QLineEdit +from ert_gui.models.mixins import BasicModelMixin +from ert_gui.widgets.helped_widget import HelpedWidget + + +class PathFormatChooser(HelpedWidget): + """ + PathChooser shows, enables choosing of and validates paths. + The data structure expected and sent to the models getValue and setValue is a string. + """ + path_format_msg = "Must be a path format." + + # UNDEFINED = 0 + # REQUIRED = 1 + # FILE = 2 + # DIRECTORY = 4 + # MUST_EXIST = 8 + # EXECUTABLE = 16 + + def __init__(self, model, path_label="Path", help_link=""): + HelpedWidget.__init__(self, path_label, help_link) + self.path_line = QLineEdit() + #self.pathLine.setMinimumWidth(250) + self.addWidget(self.path_line) + + self.validColor = self.path_line.palette().color(self.path_line.backgroundRole()) + + self.path_line.setText("Not initialized!") + self.editing = False + + self.connect(self.path_line, SIGNAL('editingFinished()'), self.validatePathFormat) + self.connect(self.path_line, SIGNAL('editingFinished()'), self.contentsChanged) + self.connect(self.path_line, SIGNAL('textChanged(QString)'), self.validatePathFormat) + + assert isinstance(model, BasicModelMixin) + self.model = model + self.getPathFromModel() + model.observable().attach(BasicModelMixin.VALUE_CHANGED_EVENT, self.getPathFromModel) + + + def getValidationTypeAndColor(self): + """Returns the type of validation message and the color that should be applied""" + if self.must_be_set: + color = self.ERROR_COLOR + validity_type = self.WARNING + else: + color = self.INVALID_COLOR + validity_type = self.EXCLAMATION + return validity_type, color + + def validatePathFormat(self): + """Called whenever the path is modified""" + palette = self.path_line.palette() + + path = self.getPathFormat().strip() + + color = self.validColor + message = "" + validity_type = self.WARNING + + self.valid = True + + if not re.search("%[0-9]*d", path): + message = self.path_format_msg + color = self.ERROR_COLOR + self.valid = False + + self.setValidationMessage(message, validity_type) + self.path_line.setToolTip(message) + palette.setColor(self.path_line.backgroundRole(), color) + + self.path_line.setPalette(palette) + + + def getPathFormat(self): + """Returns the path""" + return str(self.path_line.text()) + + + def isValid(self): + """Returns the validation value""" + return self.valid + + + def contentsChanged(self): + """Called whenever the path is changed.""" + if not self.editing: + self.model.setValue(self.getPathFormat()) + + def getPathFromModel(self): + """Retrieves data from the model and inserts it into the edit line""" + self.editing = True + + path = self.model.getValue() + if path is None: + path = "" + + self.path_line.setText("%s" % path) + self.editing = False + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/pathchooser.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/pathchooser.py deleted file mode 100644 index 0c24134f26..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/pathchooser.py +++ /dev/null @@ -1,188 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'pathchooser.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -import os -from PyQt4 import QtGui, QtCore -from helpedwidget import * -import re - -class PathChooser(HelpedWidget): - """PathChooser shows, enables choosing of and validates paths. The data structure expected and sent to the getter and setter is a string.""" - - file_does_not_exist_msg = "The specified path does not exist." - file_is_not_executable_msg = "The specified file is not an executable." - path_is_not_a_file_msg = "The specified path must be a file." - required_field_msg = "A value is required." - path_format_msg = "Must be a path format." - -# UNDEFINED = 0 -# REQUIRED = 1 -# FILE = 2 -# DIRECTORY = 4 -# MUST_EXIST = 8 -# EXECUTABLE = 16 - - def __init__(self, parent=None, pathLabel="Path", help="", - show_files=False, - must_be_set=True, - path_format=False, - must_exist=True, - absolute_path = False, - is_executable_file=False): - """Construct a PathChooser widget""" - HelpedWidget.__init__(self, parent, pathLabel, help) - - self.editing = True - self.selectFiles = show_files - self.must_be_set = must_be_set - self.path_format = path_format - self.must_exist = must_exist - self.absolute_path = absolute_path - self.is_executable_file = is_executable_file - - self.pathLine = QtGui.QLineEdit() - #self.pathLine.setMinimumWidth(250) - - self.connect(self.pathLine, QtCore.SIGNAL('editingFinished()'), self.validatePath) - self.connect(self.pathLine, QtCore.SIGNAL('editingFinished()'), self.contentsChanged) - self.connect(self.pathLine, QtCore.SIGNAL('textChanged(QString)'), self.validatePath) - - self.addWidget(self.pathLine) - - dialogButton = QtGui.QToolButton(self) - dialogButton.setIcon(resourceIcon("folder")) - dialogButton.setIconSize(QtCore.QSize(16, 16)) - self.connect(dialogButton, QtCore.SIGNAL('clicked()'), self.selectDirectory) - self.addWidget(dialogButton) - - self.addHelpButton() - - self.validColor = self.pathLine.palette().color(self.pathLine.backgroundRole()) - - self.pathLine.setText(os.getcwd()) - self.editing = False - - def getValidationTypeAndColor(self): - """Returns the type of validation message and the color that should be applied""" - if self.must_be_set: - color = self.ERROR_COLOR - type = self.WARNING - else: - color = self.INVALID_COLOR - type = self.EXCLAMATION - return type, color - - def validatePath(self): - """Called whenever the path is modified""" - palette = self.pathLine.palette() - - path = self.getPath().strip() - exists = os.path.exists(path) - - color = self.validColor - message = "" - type = self.WARNING - - self.valid = True - - if path == "" and self.must_be_set: - message = self.required_field_msg - color = self.ERROR_COLOR - self.valid = False - elif self.path_format and not re.search("%[0-9]*d", path): - message = self.path_format_msg - color = self.ERROR_COLOR - self.valid = False - elif not exists: - if not self.path_format and self.must_exist: - message = self.file_does_not_exist_msg - self.valid = False - type, color = self.getValidationTypeAndColor() - elif exists: - if self.is_executable_file and os.path.isfile(path) and not os.access(path, os.X_OK): - type, color = self.getValidationTypeAndColor() - message = self.file_is_not_executable_msg - self.valid = False - elif self.is_executable_file and not os.path.isfile(path): - type, color = self.getValidationTypeAndColor() - message = self.path_is_not_a_file_msg - self.valid = False - - - self.setValidationMessage(message, type) - self.pathLine.setToolTip(message) - palette.setColor(self.pathLine.backgroundRole(), color) - - self.pathLine.setPalette(palette) - - - def getPath(self): - """Returns the path""" - return str(self.pathLine.text()) - - def pathExists(self): - """Returns True if the entered path exists""" - return os.path.exists(self.getPath()) - - def isValid(self): - """Retruns the validation value""" - return self.valid - - - def selectDirectory(self): - """Pops up the 'select a directory' dialog""" - self.editing = True - currentDirectory = self.getPath() - - #if not os.path.exists(currentDirectory): - # currentDirectory = "~" - - if self.selectFiles: - currentDirectory = QtGui.QFileDialog.getOpenFileName(self, "Select a path", currentDirectory) - else: - currentDirectory = QtGui.QFileDialog.getExistingDirectory(self, "Select a directory", currentDirectory) - - if not currentDirectory == "": - if not self.absolute_path: - cwd = os.getcwd() - match = re.match(cwd + "/(.*)", currentDirectory) - if match: - currentDirectory = match.group(1) - - self.pathLine.setText(currentDirectory) - self.updateContent(self.getPath()) - - self.editing = False - - - def contentsChanged(self): - """Called whenever the path is changed.""" - if not self.editing: - self.updateContent(self.getPath()) - - - def fetchContent(self): - """Retrieves data from the model and inserts it into the edit line""" - self.editing = True - - path = self.getFromModel() - if path is None: - path = "" - - self.pathLine.setText("%s" % path) - self.editing = False - diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/progress.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/progress.py new file mode 100644 index 0000000000..b555bae08c --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/progress.py @@ -0,0 +1,76 @@ +from math import floor +from PyQt4.QtGui import QWidget, QPainter, QColor, QFrame, QLinearGradient + + +class StateTracker(object): + def __init__(self, state_reference, color, progress=0.0): + super(StateTracker, self).__init__() + self.name = state_reference + self.color = color + self.progress = progress + + def setProgress(self, progress): + self.progress = progress + + +class Progress(QFrame): + def __init__(self): + QFrame.__init__(self) + self.setLineWidth(1) + self.setFrameStyle(QFrame.Panel | QFrame.Plain) + + self.color = QColor(255, 255, 255) + + self.setMinimumHeight(30) + self.__state_order = [] + """@type: list of State""" + + self.__states = {} + """@type: dict of (object, State)""" + + def addState(self, state, state_color, progress=0.0): + state_tracker = StateTracker(state, state_color, progress) + self.__state_order.append(state_tracker) + self.__states[state] = state_tracker + + def updateState(self, state, progress): + self.__states[state].setProgress(progress) + self.update() + + def paintEvent(self, paintevent): + QFrame.paintEvent(self, paintevent) + painter = QPainter(self) + painter.setRenderHint(QPainter.Antialiasing, True) + painter.setRenderHint(QPainter.SmoothPixmapTransform, True) + + rect = self.contentsRect() + """@type: QRect""" + + painter.fillRect(rect, self.color) + + x = rect.x() + y = rect.y() + height = rect.height() + count = len(self.__state_order) + for index in range(count): + state = self.__state_order[index] + width = floor(rect.width() * (state.progress / 100.0)) + + if index == count - 1: + width = rect.width() - x + 1 + + painter.fillRect(x, y, width, height, state.color) + + x += width + + #Shiny overlay! + gradient = QLinearGradient(rect.width() / 2, 0, rect.width() / 2, rect.height()) + gradient.setColorAt(0, QColor(255, 255, 255, 0)) + gradient.setColorAt(0.2, QColor(255, 255, 255, 200)) + gradient.setColorAt(0.4, QColor(255, 255, 255, 0)) + gradient.setColorAt(0.85, QColor(255, 255, 255, 0)) + gradient.setColorAt(0.85, QColor(0, 0, 0, 0)) + gradient.setColorAt(1, QColor(0, 0, 0, 127)) + painter.fillRect(rect, gradient) + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/row_group.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/row_group.py new file mode 100644 index 0000000000..17b102f530 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/row_group.py @@ -0,0 +1,22 @@ +from PyQt4.QtGui import QHBoxLayout, QWidget +from ert_gui.widgets.helped_widget import HelpedWidget + + +class RowGroup(HelpedWidget): + + def __init__(self, label="", help_link=""): + HelpedWidget.__init__(self, label, help_link) + + widget = QWidget() + self.layout = QHBoxLayout() + self.layout.setMargin(0) + + widget.setLayout(self.layout) + + HelpedWidget.addWidget(self, widget) + self.addStretch() + + def addWidget(self, widget): + self.layout.addWidget(widget) + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/row_panel.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/row_panel.py new file mode 100644 index 0000000000..4273df2206 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/row_panel.py @@ -0,0 +1,154 @@ +from PyQt4.QtCore import Qt, SIGNAL, QSize +from PyQt4.QtGui import QWidget, QGridLayout, QGroupBox, QLabel, QVBoxLayout, QFrame, QHBoxLayout, QTabWidget +from ert_gui.pages.popup_dialog import PopupDialog + + +class RowPanel(QWidget): + def __init__(self, name): + QWidget.__init__(self) + self.__name = name + self.__layout_queue = [] + self.setMinimumWidth(500) + self.__layout = QGridLayout() + """ @type: QGridLayout """ + self.setLayout(self.__layout) + self.__row = 0 + self.__widgets = {} + + self.__layout.setColumnMinimumWidth(0, 20) + self.__layout.setColumnMinimumWidth(6, 20) + + self.__popups = [] + + def getName(self): + return self.__name + + def __startNewRow(self): + self.__layout.setRowStretch(self.__row, 0) + + def __rowFinished(self): + self.__row += 2 + self.__layout.setRowStretch(self.__row, 1) + + def addRow(self, row_widget, configurator=None): + """ + Add a new row on a configuration page. Returns the row widget. + If the row does not have a getLabel() function the row spans both columns. + + @rtype: QWidget + """ + assert hasattr(row_widget, "getLabel"), "Widget must have a getLabel() method" + + self.__startNewRow() + + if row_widget.getLabel() is None or row_widget.getLabel() == "": + self.__layout.addWidget(row_widget, self.__row, 1, 1, 3) + else: + self.__layout.addWidget(QLabel(row_widget.getLabel()), self.__row, 1, Qt.AlignLeft | Qt.AlignTop) + self.__layout.addWidget(row_widget, self.__row, 3) + + if not configurator is None: + button = self.__addConfigurationButton(configurator) + self.__layout.addWidget(button, self.__row, 5) + + self.__widgets[row_widget] = self.__row + + self.__rowFinished() + + + def startTabs(self, name_of_first_tab): + self.__tab_widget = QTabWidget() + self.__layout_queue.append(self.__layout) + self.__layout = None + self.addTab(name_of_first_tab) + + def addTab(self, name): + self.__layout = QGridLayout() + widget = QWidget() + widget.setLayout(self.__layout) + self.__tab_widget.addTab(widget, name) + + + def endTabs(self): + self.__layout = self.__layout_queue.pop() + """ @type: QGridLayout """ + self.__startNewRow() + self.__layout.addWidget(self.__tab_widget, self.__row, 1, 1, 5) + self.__rowFinished() + self.__tab_widget = None + + + def startGroup(self, group_title): + """Start a titled sub group on the page.""" + self.__group_box = QGroupBox(group_title) + self.__layout_queue.append(self.__layout) + self.__layout = QGridLayout() + + def endGroup(self): + """Finish the titled sub group""" + self.__group_box.setLayout(self.__layout) + self.__layout = self.__layout_queue.pop() + """ @type: QGridLayout """ + self.__layout.addRow(self.__group_box) + self.__group_box = None + + def addLabeledSeparator(self, label): + """Adds a labeled separator line to the panel.""" + widget = QWidget() + layout = QVBoxLayout() + widget.setLayout(layout) + + h_layout = QHBoxLayout() + + frame = QFrame() + frame.setFrameShape(QFrame.HLine) + frame.setFrameShadow(QFrame.Sunken) + + h_layout.addWidget(QLabel(label)) + h_layout.addWidget(frame, 1, Qt.AlignBottom) + + layout.addSpacing(2) + layout.addLayout(h_layout) + layout.addSpacing(0) + + # widget.setStyleSheet("background-color: #ffff00") + + self.__startNewRow() + self.__layout.addWidget(widget, self.__row, 0, 1, 7) + self.__rowFinished() + + def addSeparator(self): + widget = QWidget() + layout = QVBoxLayout() + widget.setLayout(layout) + + frame = QFrame() + frame.setFrameShape(QFrame.HLine) + frame.setFrameShadow(QFrame.Sunken) + + layout.addSpacing(5) + layout.addWidget(frame) + layout.addSpacing(5) + + self.__startNewRow() + self.__layout.addWidget(widget, self.__row, 1, 1, 5) + self.__rowFinished() + + + def __addConfigurationButton(self, configurator): + popup = PopupDialog(configurator.getName(), configurator, self) + button = popup.getButton() + button.setText("Configure") + self.__popups.append(popup) + return button + + + def addSpace(self, size=5): + """Creates a widget that can be used as spacing on a panel.""" + space = QWidget() + space.setMinimumSize(QSize(size, size)) + self.__startNewRow() + self.__layout.addWidget(space, self.__row, 1, 1, 5) + self.__rowFinished() + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/search_box.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/search_box.py new file mode 100644 index 0000000000..aeb841db1c --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/search_box.py @@ -0,0 +1,68 @@ +from PyQt4.QtCore import SIGNAL, pyqtSignal, Qt +from PyQt4.QtGui import QLineEdit, QColor + + +class SearchBox(QLineEdit): + passive_color = QColor(194, 194, 194) + + filterChanged = pyqtSignal(['PyQt_PyObject']) + + def __init__(self): + QLineEdit.__init__(self) + + self.setToolTip("Type to search!") + self.active_color = self.palette().color(self.foregroundRole()) + self.disable_search = True + self.presentSearch() + self.textChanged.connect(self.__emitFilterChanged) + + def __emitFilterChanged(self, filter): + self.filterChanged.emit(self.filter()) + # self.emit(SIGNAL('filterChanged(PyQt_PyObject)'), self.filter()) + + def filter(self): + if self.disable_search: + return "" + else: + return str(self.text()) + + def presentSearch(self): + """Is called to present the greyed out search""" + self.disable_search = True + self.setText("Search") + palette = self.palette() + palette.setColor(self.foregroundRole(), self.passive_color) + self.setPalette(palette) + + def activateSearch(self): + """Is called to remove the greyed out search""" + self.disable_search = False + self.setText("") + palette = self.palette() + palette.setColor(self.foregroundRole(), self.active_color) + self.setPalette(palette) + + def enterSearch(self): + """Called when the line edit gets the focus""" + if str(self.text()) == "Search": + self.activateSearch() + + def exitSearch(self): + """Called when the line edit looses focus""" + if str(self.text()) == "": + self.presentSearch() + + def focusInEvent(self, focus_event): + QLineEdit.focusInEvent(self, focus_event) + self.enterSearch() + + def focusOutEvent(self, focus_event): + QLineEdit.focusOutEvent(self, focus_event) + self.exitSearch() + + + def keyPressEvent(self, key_event): + if key_event.key() == Qt.Key_Escape: + self.clear() + else: + QLineEdit.keyPressEvent(self, key_event) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/searchablelist.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/searchablelist.py deleted file mode 100644 index 9304f88e92..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/searchablelist.py +++ /dev/null @@ -1,153 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'searchablelist.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from tablewidgets import AddRemoveWidget -from PyQt4 import QtGui, QtCore -from tablewidgets import OrderWidget - -class SearchableList(QtGui.QWidget): - """ - A searchable list of items. - Emits addItem(QListWidget) and removeItem(QListWidget) when the add and remove buttons are pressed. - """ - passiveColor = QtGui.QColor(194, 194, 194) - - def __init__(self, parent=None, converter=lambda item : str(item.text()), list_height=350, list_width = 130, ignore_case=False, order_editable=False): - QtGui.QWidget.__init__(self, parent) - self.setMaximumWidth(list_width) - self.setMinimumWidth(list_width) - self.converter = converter - self.ignore_case = ignore_case - - vlayout = QtGui.QVBoxLayout() - vlayout.setMargin(0) - - self.searchBox = QtGui.QLineEdit(parent) - self.searchBox.setToolTip("Type to search!") - self.searchBox.focusInEvent = lambda event : self.enterSearch(event) - self.searchBox.focusOutEvent = lambda event : self.exitSearch(event) - self.activeColor = self.searchBox.palette().color(self.searchBox.foregroundRole()) - self.disableSearch = True - self.presentSearch() - self.connect(self.searchBox, QtCore.SIGNAL('textChanged(QString)'), self.searchInList) - vlayout.addWidget(self.searchBox) - - self.list = QtGui.QListWidget(parent) - self.list.setMaximumWidth(list_width - 2) - self.list.setMinimumWidth(list_width - 2) - self.list.setMinimumHeight(list_height) - - if not order_editable: - self.list.setSortingEnabled(True) - - vlayout.addWidget(self.list) - - addItem = lambda : self.emit(QtCore.SIGNAL("addItem(list)"), self.list) - removeItem = lambda : self.emit(QtCore.SIGNAL("removeItem(list)"), self.list) - add_remove_widget = AddRemoveWidget(self, addItem, removeItem, True) - - if order_editable: - def moveItemUp(): - index = self.list.currentRow() - if index > 0 and self.list.count() > 1: - item = self.list.takeItem(index) - self.list.insertItem(index - 1, item) - self.list.setCurrentItem(item) - self.emit(QtCore.SIGNAL("orderChanged(list)"), self.list) - - def moveItemDown(): - index = self.list.currentRow() - if index < self.list.count() - 1 and self.list.count() > 1: - item = self.list.takeItem(index) - self.list.insertItem(index + 1, item) - self.list.setCurrentItem(item) - self.emit(QtCore.SIGNAL("orderChanged(list)"), self.list) - - hlayout = QtGui.QHBoxLayout() - hlayout.setMargin(0) - hlayout.addWidget(OrderWidget(self, moveItemUp, moveItemDown, True)) - - hlayout.addWidget(add_remove_widget) - vlayout.addLayout(hlayout) - - else: - vlayout.addWidget(add_remove_widget) - - - - - self.setLayout(vlayout) - - def emitter(current, previous): - self.emit(QtCore.SIGNAL("currentItemChanged(QListWidgetItem, QListWidgetItem)"), current, previous) - - self.connect(self.list, QtCore.SIGNAL('currentItemChanged(QListWidgetItem *, QListWidgetItem *)'), emitter) - - def presentSearch(self): - """Is called to present the greyed out search""" - self.disableSearch = True - self.searchBox.setText("Search") - palette = self.searchBox.palette() - palette.setColor(self.searchBox.foregroundRole(), self.passiveColor) - self.searchBox.setPalette(palette) - - def activateSearch(self): - """Is called to remove the greyed out search""" - self.disableSearch = False - self.searchBox.setText("") - palette = self.searchBox.palette() - palette.setColor(self.searchBox.foregroundRole(), self.activeColor) - self.searchBox.setPalette(palette) - - def enterSearch(self, focusEvent): - """Called when the line edit gets the focus""" - QtGui.QLineEdit.focusInEvent(self.searchBox, focusEvent) - if str(self.searchBox.text()) == "Search": - self.activateSearch() - - def exitSearch(self, focusEvent): - """Called when the line edit looses focus""" - QtGui.QLineEdit.focusOutEvent(self.searchBox, focusEvent) - if str(self.searchBox.text()) == "": - self.presentSearch() - - def searchInList(self, value): - """Called when the contents of the search box changes""" - if not self.disableSearch: - for index in range(self.list.count()): - item = self.list.item(index) - text = self.converter(item) - - if self.ignore_case: - value = str(value).lower() - text = text.lower() - - if not text.find(value) == -1: - item.setHidden(False) - else: - item.setHidden(True) - - def getList(self): - """Returns the contained list widget""" - return self.list - - def getItems(self): - items = [] - - for index in range(self.list.count()): - items.append(self.list.item(index)) - return items diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/string_box.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/string_box.py new file mode 100644 index 0000000000..5f8652ac99 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/string_box.py @@ -0,0 +1,66 @@ +# Copyright (C) 2011 Statoil ASA, Norway. +# +# The file 'string_box.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. + + +from PyQt4 import QtGui, QtCore +from ert_gui.models.mixins import BasicModelMixin +from ert_gui.widgets.helped_widget import HelpedWidget + + +class StringBox(HelpedWidget): + """StringBox shows a string. The data structure expected and sent to the getter and setter is a string.""" + + def __init__(self, model, path_label="String", help_link="", defaultString=""): + HelpedWidget.__init__(self, path_label, help_link) + + self.box_string = QtGui.QLineEdit() + self.connect(self.box_string, QtCore.SIGNAL('editingFinished()'), self.validateString) + self.connect(self.box_string, QtCore.SIGNAL('editingFinished()'), self.stringBoxChanged) + self.connect(self.box_string, QtCore.SIGNAL('textChanged(QString)'), self.validateString) + self.addWidget(self.box_string) + + self.box_string.setText(defaultString) + + assert isinstance(model, BasicModelMixin) + self.model = model + self.model.observable().attach(BasicModelMixin.VALUE_CHANGED_EVENT, self.modelChanged) + self.modelChanged() + + def validateString(self): + """Override this to provide validation of the contained string. NOT SUPPORTED YET!""" + stringToValidate = self.box_string.text() + #todo implement validation possibility + + + def stringBoxChanged(self): + """Called whenever the contents of the editline changes.""" + text = str(self.box_string.text()) + if text == "": + text = None + + self.model.setValue(text) + + def modelChanged(self): + """Retrieves data from the model and inserts it into the edit line""" + text = self.model.getValue() + if text is None: + text = "" + + self.box_string.setText(str(text)) + + + + diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/stringbox.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/stringbox.py deleted file mode 100644 index 71064308a5..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/stringbox.py +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'stringbox.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -from helpedwidget import * - -class StringBox(HelpedWidget): - """StringBox shows a string. The data structure expected and sent to the getter and setter is a string.""" - - def __init__(self, parent=None, pathLabel="String", help="", defaultString=""): - """Construct a StringBox widget""" - HelpedWidget.__init__(self, parent, pathLabel, help) - - self.boxString = QtGui.QLineEdit() - self.connect(self.boxString, QtCore.SIGNAL('editingFinished()'), self.validateString) - self.connect(self.boxString, QtCore.SIGNAL('editingFinished()'), self.contentsChanged) - self.connect(self.boxString, QtCore.SIGNAL('textChanged(QString)'), self.validateString) - self.addWidget(self.boxString) - - self.addHelpButton() - - self.boxString.setText(defaultString) - - - def validateString(self): - """Override this to provide validation of the contained string. NOT SUPPORTED YET!""" - stringToValidate = self.boxString.text() - #todo implement validation possibility - - - def contentsChanged(self): - """Called whenever the contents of the editline changes.""" - box_string_text = str(self.boxString.text()) - if box_string_text == "": - box_string_text = None - - self.updateContent(box_string_text) - - def fetchContent(self): - """Retrieves data from the model and inserts it into the edit line""" - self_get_from_model = self.getFromModel() - if self_get_from_model is None: - self_get_from_model = "" - - self.boxString.setText("%s" % self_get_from_model) - - - -class DoubleBox(HelpedWidget): - """DoubleBox shows a double value. The data structure expected and sent to the getter and setter is a double.""" - - def __init__(self, parent=None, pathLabel="Double", help=""): - """Construct a DoubleBox widget""" - HelpedWidget.__init__(self, parent, pathLabel, help) - - self.doubleBox = QtGui.QLineEdit() - self.doubleBox.setValidator(QtGui.QDoubleValidator(self)) - self.doubleBox.setMaximumWidth(75) - - #self.connect(self.doubleBox, QtCore.SIGNAL('editingFinished()'), self.validateString) - self.connect(self.doubleBox, QtCore.SIGNAL('editingFinished()'), self.contentsChanged) - self.connect(self.doubleBox, QtCore.SIGNAL('textChanged(QString)'), self.validateString) - self.addWidget(self.doubleBox) - - self.addStretch() - self.addHelpButton() - - - def validateString(self): - stringToValidate = str(self.doubleBox.text()) - if stringToValidate.strip() == "": - self.contentsChanged() - - def contentsChanged(self): - """Called whenever the contents of the editline changes.""" - self.updateContent(str(self.doubleBox.text())) - - def fetchContent(self): - """Retrieves data from the model and inserts it into the edit line""" - self.doubleBox.setText(str(self.getFromModel())) diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/tablewidgets.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/tablewidgets.py index 8e4a64349a..2ebb512062 100644 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/tablewidgets.py +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/tablewidgets.py @@ -16,6 +16,8 @@ from PyQt4 import QtGui, QtCore +from matplotlib.docstring import Substitution +from ert.util.substitution_list import SubstitutionList from helpedwidget import * from util import * @@ -67,52 +69,7 @@ def enableDownButton(self, state): self.moveDownButton.setEnabled(state) -class AddRemoveWidget(QtGui.QWidget): - """ - A simple class that provides to vertically positioned buttons for adding and removing something. - The addFunction and removeFunction functions must be provided. - """ - def __init__(self, parent=None, addFunction=None, removeFunction=None, horizontal=False): - """Creates a two button widget""" - QtGui.QWidget.__init__(self, parent) - - self.addButton = QtGui.QToolButton(self) - self.addButton.setIcon(resourceIcon("add")) - self.addButton.setIconSize(QtCore.QSize(16, 16)) - self.connect(self.addButton, QtCore.SIGNAL('clicked()'), addFunction) - - self.removeButton = QtGui.QToolButton(self) - self.removeButton.setIcon(resourceIcon("remove")) - self.removeButton.setIconSize(QtCore.QSize(16, 16)) - self.connect(self.removeButton, QtCore.SIGNAL('clicked()'), removeFunction) - - if horizontal: - self.buttonLayout = QtGui.QHBoxLayout() - else: - self.buttonLayout = QtGui.QVBoxLayout() - - self.buttonLayout.setMargin(0) - if horizontal: - self.buttonLayout.addStretch(1) - - self.buttonLayout.addWidget(self.addButton) - self.buttonLayout.addWidget(self.removeButton) - - if not horizontal: - self.buttonLayout.addStretch(1) - else: - self.buttonLayout.addSpacing(2) - - self.setLayout(self.buttonLayout) - - def enableAddButton(self, state): - """Enable or disable the add button""" - self.addButton.setEnabled(state) - - def enableRemoveButton(self, state): - """Enable or disable the remove button""" - self.removeButton.setEnabled(state) class KeywordList(HelpedWidget): @@ -191,89 +148,95 @@ def fetchContent(self): -class KeywordTable(HelpedWidget): - """Shows a table of key/value pairs. The data structure expected and sent to the getter and setter is a dictionary of values.""" - def __init__(self, parent=None, tableLabel="", help="", colHead1="Keyword", colHead2="Value"): - """Construct a table for key/value pairs.""" - HelpedWidget.__init__(self, parent, tableLabel, help) - - self.table = QtGui.QTableWidget(self) - self.table.setColumnCount(2) - self.headers = [colHead1, colHead2] - self.table.setHorizontalHeaderLabels(self.headers) - self.table.verticalHeader().setHidden(True) - self.table.setColumnWidth(0, 150) - #self.table.setColumnWidth(1, 250) - self.table.horizontalHeader().setStretchLastSection(True) - - self.table.setMinimumHeight(110) - self.table.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) - self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - - self.addWidget(self.table) - - self.addWidget(AddRemoveWidget(self, self.addItem, self.removeItem)) - - self.addHelpButton() - - #self.connect(self.spinner, QtCore.SIGNAL('valueChanged(int)'), self.updateContent) - self.connect(self.table, QtCore.SIGNAL('cellChanged(int,int)'), self.contentsChanged) - - - def addItem(self): - """Called by the add button to insert a new keyword""" - self.table.insertRow(self.table.currentRow() + 1) - - self.contentsChanged() - - - def removeItem(self): - """Called by the remove button to remove a selected keyword""" - currentRow = self.table.currentRow() - - if currentRow >= 0: - doDelete = QtGui.QMessageBox.question(self, "Delete row?", "Are you sure you want to delete the key/value pair?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No ) - - if doDelete: - self.table.removeRow(currentRow) - self.contentsChanged() - - - def contentsChanged(self): - """Called whenever the contents of a cell changes.""" - keyValueList = [] - - for index in range(self.table.rowCount()): - key = self.table.item(index, 0) - if not key is None: - key = str(key.text()).strip() - value = self.table.item(index, 1) - - if not key == "" and not value is None: - keyValueList.append([key, str(value.text()).strip()]) - - self.updateContent(keyValueList) - - - def fetchContent(self): - """Retrieves data from the model and inserts it into the table.""" - values = self.getFromModel() - - for row in reversed(range(self.table.rowCount())): - self.table.removeRow(row) - #for column in reversed(range(self.table.columnCount())): - # self.table.removeColumn(column) - #self.table.clearContents() - row = 0 - for value in values: - keyItem = QtGui.QTableWidgetItem(value[0]) - valueItem = QtGui.QTableWidgetItem(value[1]) - self.table.insertRow(row) - self.table.setItem(row, 0, keyItem) - self.table.setItem(row, 1, valueItem) - row+=1 +# class MultiColumnTable(HelpedWidget): +# """Shows a table of key/value pairs. The data structure expected and sent to the getter and setter is a dictionary of values.""" +# def __init__(self, parent=None, table_label="", help="", columns=("Key", "Value")): +# """ +# Construct a table with multiple columns. +# Input and output expected to be tuples. +# """ +# HelpedWidget.__init__(self, parent, table_label, help) +# +# self.table = QtGui.QTableWidget(self) +# self.table.setColumnCount(len(columns)) +# self.headers = columns +# self.table.setHorizontalHeaderLabels(self.headers) +# self.table.verticalHeader().setHidden(True) +# self.table.setColumnWidth(0, 150) +# #self.table.setColumnWidth(1, 250) +# self.table.horizontalHeader().setStretchLastSection(True) +# +# self.table.setMinimumHeight(110) +# self.table.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) +# self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) +# +# self.addWidget(self.table) +# +# self.addWidget(AddRemoveWidget(self, self.addItem, self.removeItem)) +# +# self.addHelpButton() +# +# #self.connect(self.spinner, QtCore.SIGNAL('valueChanged(int)'), self.updateContent) +# self.connect(self.table, QtCore.SIGNAL('cellChanged(int,int)'), self.contentsChanged) +# +# +# def addItem(self): +# """Called by the add button to insert a new keyword""" +# self.table.insertRow(self.table.currentRow() + 1) +# +# self.contentsChanged() +# +# +# def removeItem(self): +# """Called by the remove button to remove a selected keyword""" +# current_row = self.table.currentRow() +# +# if current_row >= 0: +# do_delete = QtGui.QMessageBox.question(self, "Delete row?", "Are you sure you want to delete the key/value pair?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No ) +# +# if do_delete: +# self.table.removeRow(current_row) +# self.contentsChanged() +# +# +# def contentsChanged(self): +# """Called whenever the contents of a cell changes.""" +# values = [] +# +# for index in range(self.table.rowCount()): +# column_values = [] +# if not self.table.item(index, 0) is None: +# for column in self.table.columnCount(): +# value = self.table.item(index, column) +# column_values.append(str(value.text()).strip()) +# +# values.append(tuple(column_values)) +# +# self.updateContent(values) +# +# +# def fetchContent(self): +# """Retrieves data from the model and inserts it into the table.""" +# values = self.getFromModel() +# +# for row in reversed(range(self.table.rowCount())): +# self.table.removeRow(row) +# +# #for column in reversed(range(self.table.columnCount())): +# # self.table.removeColumn(column) +# +# #self.table.clearContents() +# +# row = 0 +# for key in values: +# key_item = QtGui.QTableWidgetItem(key) +# value_item = QtGui.QTableWidgetItem(str(values[key])) +# self.table.insertRow(row) +# self.table.setItem(row, 0, key_item) +# self.table.setItem(row, 1, value_item) +# row += 1 diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/util.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/util.py index d6c42ebee4..693bf963e9 100644 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/util.py +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/util.py @@ -40,133 +40,11 @@ def resourceImage(name): return QtGui.QPixmap(img_prefix + name) -class ListCheckPanel(QtGui.QHBoxLayout): - """ - Creates a panel with two buttons to select and unselect all elements of a list. - A function: setSelectionEnabled(bool) is added to the list which enables enabling/disabling of list and buttons. - """ - - def __init__(self, list): - QtGui.QHBoxLayout.__init__(self) - - list.checkAll = QtGui.QToolButton() - list.checkAll.setIcon(resourceIcon("checked")) - list.checkAll.setIconSize(QtCore.QSize(16, 16)) - list.checkAll.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly) - list.checkAll.setAutoRaise(True) - list.checkAll.setToolTip("Select all") - - list.uncheckAll = QtGui.QToolButton() - list.uncheckAll.setIcon(resourceIcon("notchecked")) - list.uncheckAll.setIconSize(QtCore.QSize(16, 16)) - list.uncheckAll.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly) - list.uncheckAll.setAutoRaise(True) - list.uncheckAll.setToolTip("Unselect all") - - self.setMargin(0) - self.setSpacing(0) - self.addStretch(1) - self.addWidget(list.checkAll) - self.addWidget(list.uncheckAll) - - self.connect(list.checkAll, QtCore.SIGNAL('clicked()'), list.selectAll) - self.connect(list.uncheckAll, QtCore.SIGNAL('clicked()'), list.clearSelection) - - def setSelectionEnabled(bool): - list.setEnabled(bool) - list.checkAll.setEnabled(bool) - list.uncheckAll.setEnabled(bool) - - list.setSelectionEnabled = setSelectionEnabled - - - - -class ValidatedTimestepCombo(QtGui.QComboBox): - """ - A special type of combobox applicable to ERTs "fluxing" history length - It supports values that have different representations and internal values - """ - def __init__(self, parent, fromValue=0, fromLabel="Initial", toValue=1, toLabel="Final"): - """Constructor""" - QtGui.QComboBox.__init__(self, parent) - self.fromLabel = fromLabel - self.fromValue = fromValue - self.toLabel = toLabel - self.toValue = toValue - self.minTimeStep = fromValue - self.maxTimeStep = toValue - self.setMaximumWidth(150) - self.setEditable(True) - self.setValidator(QtGui.QIntValidator(self.minTimeStep, self.maxTimeStep, None)) - self.addItem(self.fromLabel + " (" + str(self.fromValue) + ")") - self.addItem(self.toLabel + " (" + str(self.toValue) + ")") - def focusOutEvent(self, event): - """Combo lost focus. Validate and approve contents.""" - QtGui.QComboBox.focusOutEvent(self, event) - timestepMakesSense = False - currentText = str(self.currentText()) - if currentText.startswith(self.fromLabel) or currentText.startswith(self.toLabel): - timestepMakesSense = True - - elif currentText.isdigit(): - intValue = int(currentText) - timestepMakesSense = True - - if intValue < self.minTimeStep: - self.setCurrentIndex(0) - - if intValue > self.maxTimeStep: - self.setCurrentIndex(1) - - - if not timestepMakesSense: - self.setCurrentIndex(0) - - - def setMinTimeStep(self, value): - """Set the minimum timestep value for custom values""" - self.minTimeStep = value - self.validator().setBottom(value) - - def setMaxTimeStep(self, value): - """Set the maximum timestep value for custom values""" - self.maxTimeStep = value - self.validator().setTop(value) - - def setFromValue(self, value): - """Set the presented from value""" - self.fromValue = value - self.setItemText(0, self.fromLabel + " (" + str(self.fromValue) + ")") - - def setToValue(self, value): - """Set the presented to value""" - self.toValue = value - if self.toValue < self.fromValue: - self.setItemText(1, self.toLabel) - else: - self.setItemText(1, self.toLabel + " (" + str(self.toValue) + ")") - - def setHistoryLength(self, length): - """Set history length. Applies to both maximum timestep and value""" - self.setMaxTimeStep(length) - self.setToValue(length) - - def getSelectedValue(self): - """Return the selected value. Either custom or one of: from value or to value""" - currentText = str(self.currentText()) - - if currentText.startswith(self.fromLabel): - return self.fromValue - elif currentText.startswith(self.toLabel): - return self.toValue - else: - return int(currentText) class ValidationInfo(QtGui.QWidget): diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/validated_dialog.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/validated_dialog.py new file mode 100644 index 0000000000..2a4260a79d --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/validated_dialog.py @@ -0,0 +1,133 @@ +# Copyright (C) 2011 Statoil ASA, Norway. +# +# The file 'validated_dialog.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. +from PyQt4.QtCore import Qt, QSize, SIGNAL +from PyQt4.QtGui import QDialog, QColor, QFormLayout, QLabel, QWidget, QDialogButtonBox, QLineEdit, QComboBox, QLayout + + +class ValidatedDialog(QDialog): + """ + A dialog for creating a validated new value. Performs validation of name against a provided. + Can be used to select from the list or for creating a new value that is not on the list. + + """ + + INVALID_COLOR = QColor(255, 235, 235) + + def __init__(self, title = "Title", description = "Description", unique_names = None, choose_from_list=False): + QDialog.__init__(self) + self.setModal(True) + self.setWindowTitle(title) + # self.setMinimumWidth(250) + # self.setMinimumHeight(150) + + if unique_names is None: + unique_names = [] + + self.unique_names = unique_names + self.choose_from_list = choose_from_list + + self.layout = QFormLayout() + self.layout.setSizeConstraint(QLayout.SetFixedSize) + + label = QLabel(description) + label.setAlignment(Qt.AlignHCenter) + + self.layout.addRow(self.createSpace(5)) + self.layout.addRow(label) + self.layout.addRow(self.createSpace(10)) + + + buttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self) + self.ok_button = buttons.button(QDialogButtonBox.Ok) + self.ok_button.setEnabled(False) + + + if choose_from_list: + self.param_name_combo = QComboBox() + self.connect(self.param_name_combo, SIGNAL('currentIndexChanged(QString)'), self.validateChoice) + for item in unique_names: + self.param_name_combo.addItem(item) + self.layout.addRow("Job:", self.param_name_combo) + else: + self.param_name = QLineEdit(self) + self.connect(self.param_name, SIGNAL('textChanged(QString)'), self.validateName) + self.validColor = self.param_name.palette().color(self.param_name.backgroundRole()) + + self.layout.addRow("Name:", self.param_name) + self.layout.addRow(self.createSpace(10)) + + + self.layout.addRow(buttons) + + self.connect(buttons, SIGNAL('accepted()'), self.accept) + self.connect(buttons, SIGNAL('rejected()'), self.reject) + + self.setLayout(self.layout) + + def notValid(self, msg): + """Called when the name is not valid.""" + self.ok_button.setEnabled(False) + palette = self.param_name.palette() + palette.setColor(self.param_name.backgroundRole(), self.INVALID_COLOR) + self.param_name.setToolTip(msg) + self.param_name.setPalette(palette) + + def valid(self): + """Called when the name is valid.""" + self.ok_button.setEnabled(True) + palette = self.param_name.palette() + palette.setColor(self.param_name.backgroundRole(), self.validColor) + self.param_name.setToolTip("") + self.param_name.setPalette(palette) + + def validateName(self, value): + """Called to perform validation of a name. For specific needs override this function and call valid() and notValid(msg).""" + value = str(value) + + if value == "": + self.notValid("Can not be empty!") + elif not value.find(" ") == -1: + self.notValid("No spaces allowed!") + elif value in self.unique_names: + self.notValid("Name must be unique!") + else: + self.valid() + + def validateChoice(self, choice): + """Only called when using selection mode.""" + self.ok_button.setEnabled(not choice == "") + + + def getName(self): + """Return the new name chosen by the user""" + if self.choose_from_list: + return str(self.param_name_combo.currentText()) + else: + return str(self.param_name.text()) + + def showAndTell(self): + """Shows the dialog and returns the result""" + if self.exec_(): + return str(self.getName()).strip() + + return "" + + def createSpace(self, size = 5): + """Creates a widget that can be used as spacing on a panel.""" + qw = QWidget() + qw.setMinimumSize(QSize(size, size)) + + return qw diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/validateddialog.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/validateddialog.py deleted file mode 100644 index f69ae4d58d..0000000000 --- a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/validateddialog.py +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'validateddialog.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - - -from PyQt4 import QtGui, QtCore -import util - -class ValidatedDialog(QtGui.QDialog): - """A dialog for creating a validated. Performs validation of name.""" - - INVALID_COLOR = QtGui.QColor(255, 235, 235) - - def __init__(self, parent, title = "Title", description = "Description", uniqueNames = None, chooseFromList=False): - """Creates a new dialog that validates uniqueness against the provided list""" - QtGui.QDialog.__init__(self, parent) - self.setModal(True) - self.setWindowTitle(title) - self.setMinimumWidth(250) - self.setMinimumHeight(150) - - if uniqueNames is None: - uniqueNames = [] - self.uniqueNames = uniqueNames - - self.layout = QtGui.QFormLayout() - - q_label = QtGui.QLabel(description) - q_label.setAlignment(QtCore.Qt.AlignHCenter) - - self.layout.addRow(util.createSpace(5)) - self.layout.addRow(q_label) - self.layout.addRow(util.createSpace(10)) - - - buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self) - self.okbutton = buttons.button(QtGui.QDialogButtonBox.Ok) - self.okbutton.setEnabled(False) - - - if chooseFromList: - self.paramNameCombo = QtGui.QComboBox() - self.connect(self.paramNameCombo, QtCore.SIGNAL('currentIndexChanged(QString)'), self.validateChoice) - for item in uniqueNames: - self.paramNameCombo.addItem(item) - self.layout.addRow("Job:", self.paramNameCombo) - else: - self.paramName = QtGui.QLineEdit(self) - self.connect(self.paramName, QtCore.SIGNAL('textChanged(QString)'), self.validateName) - self.validColor = self.paramName.palette().color(self.paramName.backgroundRole()) - - self.layout.addRow("Name:", self.paramName) - self.layout.addRow(util.createSpace(10)) - - - self.layout.addRow(buttons) - - self.connect(buttons, QtCore.SIGNAL('accepted()'), self.accept) - self.connect(buttons, QtCore.SIGNAL('rejected()'), self.reject) - - self.setLayout(self.layout) - - def notValid(self, msg): - """Called when the name is not valid.""" - self.okbutton.setEnabled(False) - palette = self.paramName.palette() - palette.setColor(self.paramName.backgroundRole(), self.INVALID_COLOR) - self.paramName.setToolTip(msg) - self.paramName.setPalette(palette) - - def valid(self): - """Called when the name is valid.""" - self.okbutton.setEnabled(True) - palette = self.paramName.palette() - palette.setColor(self.paramName.backgroundRole(), self.validColor) - self.paramName.setToolTip("") - self.paramName.setPalette(palette) - - def validateName(self, value): - """Called to perform validation of a name. For specific needs override this function and call valid() and notValid(msg).""" - value = str(value) - - if value == "": - self.notValid("Can not be empty!") - elif not value.find(" ") == -1: - self.notValid("No spaces allowed!") - elif value in self.uniqueNames: - self.notValid("Name must be unique!") - else: - self.valid() - - def validateChoice(self, choice): - """Only called when using selection mode.""" - self.okbutton.setEnabled(not choice == "") - - - def getName(self): - """Return the new name chosen by the user""" - if hasattr(self, "paramName"): - return str(self.paramName.text()) - else: - return str(self.paramNameCombo.currentText()) - - def showAndTell(self): - """Shows the dialog and returns the result""" - if self.exec_(): - return str(self.getName()).strip() - - return "" \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/python/ert_gui/widgets/warning_panel.py b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/warning_panel.py new file mode 100644 index 0000000000..7f488d1994 --- /dev/null +++ b/ThirdParty/Ert/devel/python/python/ert_gui/widgets/warning_panel.py @@ -0,0 +1,55 @@ +from PyQt4.QtCore import Qt, pyqtSlot +from PyQt4.QtGui import QLabel +from ert_gui.pages.message_center import MessageCenter +from ert_gui.widgets.helped_widget import HelpedWidget + + +class WarningPanel(HelpedWidget): + + warning_template = ("" + "" + "" + "%s" + "
Warning:
" + "") + + warning_row_template = "%s" + + def __init__(self, label="", help_link=""): + HelpedWidget.__init__(self, label, help_link) + + self.warning_widget = QLabel("") + self.warning_widget.setWordWrap(True) + self.warning_widget.setScaledContents(True) + self.warning_widget.setAlignment(Qt.AlignHCenter) + self.warning_widget.setTextFormat(Qt.RichText) + self.warning_widget.setVisible(False) + + self.addWidget(self.warning_widget) + self.warnings = {} + + MessageCenter().addWarningMessageListeners(self) + + + def setWarning(self, reference, warning): + if warning is None: + warning = "" + + warning = warning.strip() + + if (warning == "" or warning is None) and reference in self.warnings: + self.warnings.pop(reference) + + if not warning == "": + self.warnings[reference] = warning + + if len(self.warnings) > 0: + message = "" + for key in self.warnings: + message += self.warning_row_template % self.warnings[key] + + self.warning_widget.setText(self.warning_template % message) + else: + self.warning_widget.setText("") + + self.warning_widget.setHidden(len(self.warnings) == 0) \ No newline at end of file diff --git a/ThirdParty/Ert/devel/python/test/CMakeLists.txt b/ThirdParty/Ert/devel/python/test/CMakeLists.txt index f36d8fd6ef..42dd8d4f2a 100644 --- a/ThirdParty/Ert/devel/python/test/CMakeLists.txt +++ b/ThirdParty/Ert/devel/python/test/CMakeLists.txt @@ -3,9 +3,9 @@ set(RSH_SERVERS "" CACHE STRING "List of nodes which will be used to test the R set(TEST_SOURCES ert_tests/__init__.py + ert_tests/source_enumerator.py ert_tests/run_tests.py ert_tests/test_ert_import.py - ert_tests/test_ert_gui_import.py ert_tests/config/__init__.py ert_tests/config/test_config.py @@ -31,6 +31,10 @@ set(TEST_SOURCES ert_tests/enkf/__init__.py ert_tests/enkf/test_enkf.py ert_tests/enkf/test_enkf_library.py + ert_tests/enkf/test_analysis_config.py + + ert_tests/job_queue/__init__.py + ert_tests/job_queue/test_job_queue.py ert_tests/sched/__init__.py ert_tests/sched/test_sched.py @@ -44,6 +48,8 @@ set(TEST_SOURCES ert_tests/util/test_string_list.py ert_tests/util/test_vectors.py + ert_tests/run/__init__.py + ert_tests/run/test_run.py ecl_isosurf.py ens_config_test.py @@ -56,8 +62,11 @@ set(TEST_SOURCES ctest_run.py ) +if (ERT_BUILD_GUI) + LIST(APPEND ${TEST_SOURCES} ert_tests/test_ert_gui_import.py) +endif() -add_python_package("Python test" "${PYTHON_INSTALL_PREFIX}/test" "${TEST_SOURCES}" True) +add_python_package("Python test" "${PYTHON_INSTALL_PREFIX}/test" "${TEST_SOURCES}" False) # The test data is located in the current source directory; that is # the reason we set that as the working directory for the test @@ -69,9 +78,12 @@ add_test( NAME python.ert.import_all_ert WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ctest_run.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX} ert_tests.test_ert_import.ErtImportTest ) -add_test( NAME python.ert.import_all_ert_gui - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND ctest_run.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX} ert_tests.test_ert_gui_import.ErtGuiImportTest ) + +if (ERT_BUILD_GUI) + add_test( NAME python.ert.import_all_ert_gui + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ctest_run.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX} ert_tests.test_ert_gui_import.ErtGuiImportTest ) +endif() #UTIL @@ -120,6 +132,22 @@ add_test( NAME python.ert.enkf_library WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ctest_run.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX} ert_tests.enkf.test_enkf_library.EnKFLibraryTest) +add_test( NAME python.ert.enkf_analysis_config + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ctest_run.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX} ert_tests.enkf.test_analysis_config.AnalysisConfigTest) + + +#GUI +if (ERT_BUILD_GUI) + add_test( NAME python.ert_gui.models + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ctest_run.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX} ert_tests.gui.test_model.ModelTest) + + add_test( NAME python.ert_gui.models.observable + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ctest_run.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX} ert_tests.gui.test_observable.ObservableTest) +endif() + #ECL @@ -199,6 +227,12 @@ add_test( NAME python.ert.sched.sched WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ctest_run.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX} ert_tests.sched.test_sched.SchedFileTest) +#JOB QUEUE +add_test( NAME python.ert.job_queue.job_status_type_enum + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ctest_run.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX} ert_tests.job_queue.test_job_queue.JobQueueTest) + + #CONFIG add_test( NAME python.ert.config WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} @@ -217,6 +251,17 @@ add_test( NAME python.ert.cwrap.basecenum WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ctest_run.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX} ert_tests.cwrap.test_basecenum.BaseCEnumTest) +#TESTRUN +add_test( NAME python.ert.test_run + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ctest_run.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX} ert_tests.run.test_run.RunTest ) + +#ANALYSIS +add_test( NAME python.ert.analysis.enums + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ctest_run.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX} ert_tests.analysis.test_options_enum.AnalysisOptionsEnumTest) + + set_property( TEST python.ert.sched.sched PROPERTY LABELS Python:StatoilData ) @@ -232,10 +277,14 @@ set_property( TEST python.ert.ecl.ecl_rft PROPERTY LABELS Python:Stato set_property( TEST python.ert.ecl.ecl_grid PROPERTY LABELS Python:StatoilData:Slow ) #set_property( TEST python.import_local PROPERTY LABELS Python:StatoilBuild ) -set_property( TEST python.ert.import_all_ert PROPERTY LABELS Python) -set_property( TEST python.ert.import_all_ert_gui PROPERTY LABELS Python) +set_property( TEST python.ert.test_run PROPERTY LABELS Python) +set_property( TEST python.ert.import_all_ert PROPERTY LABELS Python) set_property( TEST python.ert.util.stringlist PROPERTY LABELS Python ) set_property( TEST python.ert.util.tvector PROPERTY LABELS Python ) -#set_property( TEST python.ert.import_all_ert PROPERTY ENVIRONMENT "ERT_SHARE_PATH=${PROJECT_SOURCE_PATH}/share") -set_property( TEST python.ert.import_all_ert_gui PROPERTY ENVIRONMENT "ERT_SHARE_PATH=${PROJECT_SOURCE_PATH}/share") +if (ERT_BUILD_GUI) + set_property( TEST python.ert.import_all_ert_gui PROPERTY ENVIRONMENT "ERT_SHARE_PATH=${PROJECT_SOURCE_PATH}/share") + set_property( TEST python.ert.import_all_ert_gui PROPERTY LABELS Python) + set_property( TEST python.ert_gui.models PROPERTY LABELS Python) + set_property( TEST python.ert_gui.models.observable PROPERTY LABELS Python) +endif() diff --git a/ThirdParty/Ert/devel/python/test/ctest_run.py b/ThirdParty/Ert/devel/python/test/ctest_run.py index 7710d86349..5392ad02a1 100644 --- a/ThirdParty/Ert/devel/python/test/ctest_run.py +++ b/ThirdParty/Ert/devel/python/test/ctest_run.py @@ -1,6 +1,11 @@ #!/usr/bin/env python import sys -from unittest2 import TextTestRunner + +try: + from unittest2 import TextTestRunner +except ImportError: + from unittest import TextTestRunner + from ert_tests.run_tests import getTestsFromTestClass diff --git a/ThirdParty/Ert/devel/python/test/enkf_test.py b/ThirdParty/Ert/devel/python/test/enkf_test.py deleted file mode 100644 index b923a7ce9c..0000000000 --- a/ThirdParty/Ert/devel/python/test/enkf_test.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'enkf_test.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ERT is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. -# -# See the GNU General Public License at -# for more details. - -import datetime -import unittest -import ert -import ert.enkf.enkf as enkf -from ert.util.tvector import * -from test_util import approx_equal, approx_equalv - -case = "/private/inmyr/ERT-Intro/testcase/ert_config" -site_conf_file = "/project/res/etc/ERT/site-config" -obs_config_file = "/private/inmyr/ERT-Intro/testcase/observations" - -class EnKFtest( unittest.TestCase ): - def setUp(self): - pass - - - def test_boot( self ): - self.main = enkf.EnKFMain.bootstrap( case, site_conf_file ) - self.assertTrue( self.main , "Load failed" ) - del self - - def test_enum(self): - self.assertEqual( enkf.enkf_state_enum.FORECAST , 2 ) - self.assertEqual( enkf.enkf_state_enum.ANALYZED , 4 ) - del self - - def test_config( self ): - self.main = enkf.EnKFMain.bootstrap( case, site_conf_file ) - config = self.main.ensemble_config - anal_config = self.main.analysis_config - mod_config = self.main.model_config - loc_config = self.main.local_config - site_conf = self.main.site_config - ecl_conf = self.main.ecl_config - plot_conf = self.main.plot_config - self.main.load_obs(obs_config_file) - ob = self.main.get_obs - temp = self.main.get_templates - enkf_fsout = self.main.get_fs - mem_conf = self.main.iget_member_config(0) - enkf_stat = self.main.iget_state(0) - self.assertTrue( isinstance( config , ert.enkf.ens_config.EnsConfig)) - self.assertTrue( isinstance( anal_config , ert.enkf.analysis_config.AnalysisConfig)) - self.assertTrue( isinstance( mod_config , ert.enkf.model_config.ModelConfig)) - self.assertTrue( isinstance( loc_config , ert.enkf.local_config.LocalConfig)) - self.assertTrue( isinstance( site_conf , ert.enkf.site_config.SiteConfig)) - self.assertTrue( isinstance( ecl_conf , ert.enkf.ecl_config.EclConfig)) - self.assertTrue( isinstance( plot_conf , ert.enkf.plot_config.PlotConfig)) - self.assertTrue( isinstance( ob , ert.enkf.enkf_obs.EnkfObs)) - self.assertTrue( isinstance( temp , ert.enkf.ert_templates.ErtTemplates)) - self.assertTrue( isinstance( enkf_fsout , ert.enkf.enkf_fs.EnkfFs)) - self.assertTrue( isinstance( mem_conf , ert.enkf.member_config.MemberConfig)) - self.assertTrue( isinstance( enkf_stat , ert.enkf.enkf_state.EnKFState)) - del self - -unittest.main() -e diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/__init__.py b/ThirdParty/Ert/devel/python/test/ert_tests/__init__.py index 5120406b82..b52890d0df 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/__init__.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/__init__.py @@ -16,7 +16,13 @@ import numbers import os import traceback -from unittest2 import TestCase + +try: + from unittest2 import TestCase +except ImportError: + from unittest import TestCase + +from ert_tests.source_enumerator import SourceEnumerator """ @@ -61,6 +67,18 @@ def assertFilesAreNotEqual(self, first, second): if self.__filesAreEqual(first, second): self.fail("Buffer contents of files are identical!") + def assertEnumIsFullyDefined(self, enum_class, enum_name, source_path, verbose=False): + enum_values = SourceEnumerator.findEnumerators(enum_name, source_path) + + for identifier, value in enum_values: + if verbose: + print("%s = %d" % (identifier, value)) + + self.assertTrue(enum_class.__dict__.has_key(identifier), "Enum does not have identifier: %s" % identifier) + class_value = enum_class.__dict__[identifier] + self.assertEqual(class_value, value, "Enum value for identifier: %s does not match: %s != %s" % (identifier, class_value, value)) + + def __filesAreEqual(self, first, second): buffer1 = open(first).read() buffer2 = open(second).read() diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/analysis/__init__.py b/ThirdParty/Ert/devel/python/test/ert_tests/analysis/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/analysis/test_options_enum.py b/ThirdParty/Ert/devel/python/test/ert_tests/analysis/test_options_enum.py new file mode 100644 index 0000000000..8dc2ca559c --- /dev/null +++ b/ThirdParty/Ert/devel/python/test/ert_tests/analysis/test_options_enum.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# Copyright (C) 2013 Statoil ASA, Norway. +# +# The file 'test_options_enum.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. + +from ert_tests import ExtendedTestCase +from ert.analysis import AnalysisModuleOptionsEnum + + +class AnalysisOptionsEnumTest(ExtendedTestCase): + def test_items(self): + source_file_path = "libanalysis/include/ert/analysis/analysis_module.h" + self.assertEnumIsFullyDefined(AnalysisModuleOptionsEnum, "analysis_module_flag_enum", source_file_path) diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/cwrap/test_basecenum.py b/ThirdParty/Ert/devel/python/test/ert_tests/cwrap/test_basecenum.py index 256b7e75a3..ab728d4819 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/cwrap/test_basecenum.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/cwrap/test_basecenum.py @@ -59,6 +59,23 @@ class enum2(BaseCEnum): e = enum.ONE ^ enum2.ONE + def test_in_operator(self): + class PowerOf2(BaseCEnum): + pass + + PowerOf2.addEnum("ONE", 1) + PowerOf2.addEnum("TWO", 2) + PowerOf2.addEnum("FOUR", 4) + + three = PowerOf2.ONE | PowerOf2.TWO + + self.assertEqual(int(three), 3) + + self.assertIn(PowerOf2.TWO, three) + self.assertIn(PowerOf2.ONE, three) + self.assertNotIn(PowerOf2.FOUR, three) + + def test_enum_populate_from_c(self): class ContentTypeEnum(BaseCEnum): pass diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_default.py b/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_default.py index cfe20c6ec8..d5476b10d7 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_default.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_default.py @@ -1,4 +1,9 @@ -from unittest2 import TestCase + +try: + from unittest2 import TestCase +except ImportError: + from unittest import TestCase + from ert.ecl import EclDefault diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_file.py b/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_file.py index c57393ea11..ed68ef5d57 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_file.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_file.py @@ -14,7 +14,11 @@ # # See the GNU General Public License at # for more details. -from unittest2 import skipIf +try: + from unittest2 import skipIf +except ImportError: + from unittest import skipIf + from ert.ecl import EclFile, FortIO from ert.ecl.ecl_util import EclFileFlagEnum diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_submit.py b/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_submit.py index c88efd0cc0..66afd81eed 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_submit.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_ecl_submit.py @@ -17,7 +17,12 @@ # import os import getpass -from unittest2 import skipIf + +try: + from unittest2 import skipIf +except ImportError: + from unittest import skipIf + import time import shutil from ert.ecl import EclQueue, EclSum @@ -141,7 +146,7 @@ class LocalSubmitTest(EclSubmitTest): def test_LOCAL_submit(self): #work_area = TestArea("python/ecl_submit/LOCAL", True) - with TestAreaContext("python/ecl_submit/LOCAL", True) as work_area: + with TestAreaContext("python/ecl_submit/LOCAL") as work_area: num_submit = 4 queue = EclQueue(driver_type=QueueDriverEnum.LOCAL_DRIVER, max_running=2) path_list = [] diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_grid.py b/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_grid.py index 33a4cb5230..0e2024cb04 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_grid.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_grid.py @@ -14,8 +14,12 @@ # # See the GNU General Public License at # for more details. +try: + from unittest2 import skipIf +except ImportError: + from unittest import skipIf + import time -from unittest2 import skipIf from ert.ecl import EclTypeEnum, EclKW, EclGrid from ert.util import DoubleVector from ert.util.test_area import TestAreaContext @@ -60,8 +64,7 @@ def create(self, filename, load_actnum=True): def test_rect(self): - #work_area = TestArea("python/grid-test/testRect", True) - with TestAreaContext("python/grid-test/testRect", True): + with TestAreaContext("python/grid-test/testRect"): a1 = 1.0 a2 = 2.0 a3 = 3.0 @@ -111,8 +114,7 @@ def test_time(self): def test_save(self): - #work_area = TestArea("python/grid-test/testSave", True) - with TestAreaContext("python/grid-test/testSave", True): + with TestAreaContext("python/grid-test/testSave"): g1 = EclGrid(self.egrid_file()) g1.save_EGRID("test.EGRID") @@ -155,8 +157,7 @@ def test_raise_IO_error(self): @skipIf(ExtendedTestCase.slowTestShouldNotRun(), "Slow test of dual grid skipped!") def test_dual(self): - #work_area = TestArea("python/grid-test/testDual", True) - with TestAreaContext("python/grid-test/testDual", True): + with TestAreaContext("python/grid-test/testDual"): grid = EclGrid(self.egrid_file()) self.assertFalse(grid.dual_grid) self.assertTrue(grid.nactive_fracture == 0) @@ -208,4 +209,4 @@ def test_nactive_large_memory(self): grid1 = EclGrid(case) grid2 = EclGrid(case) self.assertEqual(grid1.nactive, grid2.nactive) - self.assertEqual(grid1.nactive, 34770) \ No newline at end of file + self.assertEqual(grid1.nactive, 34770) diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_legacy_ecl.py b/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_legacy_ecl.py index 40383b43d0..9c63a4cb63 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_legacy_ecl.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_legacy_ecl.py @@ -14,7 +14,11 @@ # # See the GNU General Public License at # for more details. -from unittest2 import TestCase +try: + from unittest2 import TestCase +except ImportError: + from unittest import TestCase + from ert.ecl import EclTypeEnum, EclFileFlagEnum, EclPhaseEnum import ert.ecl.ecl as ecl diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_sum.py b/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_sum.py index d5f1ad97c1..a5657bc4fd 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_sum.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_sum.py @@ -17,7 +17,12 @@ import os import datetime -from unittest2 import skip, skipUnless, skipIf + +try: + from unittest2 import skipIf, skipUnless, skipIf +except ImportError: + from unittest import skipIf, skipUnless, skipIf + from ert.ecl import EclSum from ert.util import StringList, TimeVector, DoubleVector @@ -138,11 +143,12 @@ def test_report(self): self.assertEqual(sum.get_report_time(10), datetime.date(2000, 10, 1)) self.assertAlmostEqualScaled(sum.get_from_report("FOPT", 10), 6.67447e+06) + @skipIf(ExtendedTestCase.slowTestShouldNotRun(), "Slow test skipped") def test_fwrite(self): # todo: What is tested here? - #work_area = TestArea("python/sum-test/fwrite", True) - with TestAreaContext("python/sum-test/fwrite", True): + # work_area = TestArea("python/sum-test/fwrite", True) + with TestAreaContext("python/sum-test/fwrite") as work_area: self.ecl_sum.fwrite(ecl_case="CASE") self.assertTrue(True) diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/enkf/test_analysis_config.py b/ThirdParty/Ert/devel/python/test/ert_tests/enkf/test_analysis_config.py new file mode 100644 index 0000000000..38e6b8eb42 --- /dev/null +++ b/ThirdParty/Ert/devel/python/test/ert_tests/enkf/test_analysis_config.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# Copyright (C) 2013 Statoil ASA, Norway. +# +# The file 'test_analysis_config.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ERT is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. +# +# See the GNU General Public License at +# for more details. + +import os +from ert.enkf import AnalysisConfig +from ert_tests import ExtendedTestCase + + +class AnalysisConfigTest(ExtendedTestCase): + + def test_keywords_for_monitoring_simulation_runtime(self): + ac = AnalysisConfig() + ac.set_min_realisations( 100 ) + self.assertEqual( 100 , ac.get_min_realisations() ) + + ac.set_max_runtime( 50 ) + self.assertEqual( 50 , ac.get_max_runtime() ) + + ac.set_stop_long_running( True ) + self.assertTrue( ac.get_stop_long_running() ) + + + def test_analysis_modules(self): + ac = AnalysisConfig() + self.assertIsNone( ac.activeModuleName() ) + diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/enkf/test_enkf.py b/ThirdParty/Ert/devel/python/test/ert_tests/enkf/test_enkf.py index 9b7c1aba7b..d9cc275535 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/enkf/test_enkf.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/enkf/test_enkf.py @@ -16,9 +16,11 @@ # for more details. import os -from ert.enkf import EnkfStateEnum, EnsConfig, AnalysisConfig, ModelConfig, SiteConfig, EclConfig, PlotConfig, EnkfObs, ErtTemplates, EnkfFs, EnKFState -from ert.enkf.local_config import LocalConfig +from ert.enkf import EnsConfig, AnalysisConfig, ModelConfig, SiteConfig, EclConfig, PlotConfig, EnkfObs, ErtTemplates, EnkfFs, EnKFState, EnkfStateType, EnkfRunEnum, EnkfVarType, ObsVector +from ert.enkf.data import EnkfConfigNode from ert.enkf.enkf_main import EnKFMain +from ert.enkf.enums import EnkfObservationImplementationType, LoadFailTypeEnum +from ert.enkf.observations.summary_observation import SummaryObservation from ert.util.test_area import TestAreaContext from ert_tests import ExtendedTestCase @@ -38,8 +40,59 @@ def test_bootstrap( self ): del main def test_enum(self): - self.assertEqual(EnkfStateEnum.FORECAST, 2) - self.assertEqual(EnkfStateEnum.ANALYZED, 4) + + self.assertEnumIsFullyDefined(EnkfVarType, "enkf_var_type", "libenkf/include/ert/enkf/enkf_types.h") + self.assertEnumIsFullyDefined(EnkfStateType, "state_enum", "libenkf/include/ert/enkf/enkf_types.h") + self.assertEnumIsFullyDefined(EnkfObservationImplementationType, "obs_impl_type", "libenkf/include/ert/enkf/obs_vector.h") + self.assertEnumIsFullyDefined(LoadFailTypeEnum, "load_fail_type", "libenkf/include/ert/enkf/summary_config.h") + + self.assertEqual(EnkfRunEnum.ENKF_ASSIMILATION, 1) + self.assertEqual(EnkfRunEnum.ENSEMBLE_EXPERIMENT, 2) + + + def test_observations(self): + with TestAreaContext("enkf_test") as work_area: + work_area.copy_directory(self.case_directory) + + main = EnKFMain("simple_config/minimum_config", self.site_config_file) + + count = 10 + summary_key = "test_key" + observation_key = "test_obs_key" + summary_observation_node = EnkfConfigNode.createSummaryConfigNode(summary_key, LoadFailTypeEnum.LOAD_FAIL_EXIT) + observation_vector = ObsVector(EnkfObservationImplementationType.SUMMARY_OBS, observation_key, summary_observation_node, count) + + main.getObservations().addObservationVector(observation_key, observation_vector) + + values = [] + for index in range(0, count): + value = index * 10.5 + std = index / 10.0 + summary_observation_node = SummaryObservation(summary_key, observation_key, value, std) + observation_vector.installNode(index, summary_observation_node) + self.assertEqual(observation_vector.getNode(index), summary_observation_node) + self.assertEqual(value, summary_observation_node.getValue()) + values.append((index, value, std)) + + + observations = main.getObservations() + test_vector = observations.getObservationsVector(observation_key) + + self.assertEqual(observation_vector, test_vector) + for index, value, std in values: + self.assertTrue(test_vector.isActive(index)) + + summary_observation_node = test_vector.getNode(index) + """@type: SummaryObservation""" + + self.assertEqual(value, summary_observation_node.getValue()) + self.assertEqual(std, summary_observation_node.getStandardDeviation()) + self.assertEqual(summary_key, summary_observation_node.getSummaryKey()) + + + + + def test_config( self ): with TestAreaContext("enkf_test") as work_area: @@ -47,19 +100,19 @@ def test_config( self ): main = EnKFMain("simple_config/minimum_config", self.site_config_file) - self.assertIsInstance(main.ensemble_config(), EnsConfig) + self.assertIsInstance(main.ensembleConfig(), EnsConfig) self.assertIsInstance(main.analysis_config(), AnalysisConfig) - self.assertIsInstance(main.model_config(), ModelConfig) + self.assertIsInstance(main.getModelConfig(), ModelConfig) #self.assertIsInstance(main.local_config(), LocalConfig) #warn: Should this be None? - self.assertIsInstance(main.site_config(), SiteConfig) + self.assertIsInstance(main.siteConfig(), SiteConfig) self.assertIsInstance(main.ecl_config(), EclConfig) self.assertIsInstance(main.plot_config(), PlotConfig) # self.main.load_obs(obs_config_file) - self.assertIsInstance(main.get_obs(), EnkfObs) + self.assertIsInstance(main.getObservations(), EnkfObs) self.assertIsInstance(main.get_templates(), ErtTemplates) - self.assertIsInstance(main.get_fs(), EnkfFs) + self.assertIsInstance(main.getFileSystem(), EnkfFs) # self.assertIsInstance(main.iget_member_config(0), MemberConfig) - self.assertIsInstance(main.iget_state(0), EnKFState) + self.assertIsInstance(main.getMemberRunningState(0), EnKFState) del main diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/enkf/test_enkf_library.py b/ThirdParty/Ert/devel/python/test/ert_tests/enkf/test_enkf_library.py index 1ce24211f1..9b315764bf 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/enkf/test_enkf_library.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/enkf/test_enkf_library.py @@ -1,11 +1,11 @@ import os from ert.ecl import EclSum -from ert.enkf import BlockObs, AnalysisConfig, EclConfig, GenKwConfig, EnkfConfigNode, SiteConfig, EnkfStateEnum +from ert.enkf import BlockObs, AnalysisConfig, EclConfig, GenKwConfig, EnkfConfigNode, SiteConfig, ObsVector from ert.enkf import GenDataConfig, FieldConfig, EnkfFs, EnkfObs, EnKFState, EnsConfig from ert.enkf import ErtTemplate, ErtTemplates, LocalConfig, ModelConfig, PlotConfig from ert.enkf.enkf_main import EnKFMain -from ert.enkf.util import ObsVector, TimeMap +from ert.enkf.util import TimeMap from ert.util.test_area import TestAreaContext from ert_tests import ExtendedTestCase @@ -17,8 +17,8 @@ def setUp(self): def test_failed_class_creation(self): - classes = [AnalysisConfig, BlockObs, FieldConfig, GenKwConfig, GenDataConfig, - EnkfConfigNode, EnkfFs, EnkfObs, TimeMap, ObsVector, EnKFState, EnsConfig, + classes = [BlockObs, FieldConfig, GenKwConfig, GenDataConfig, + EnkfConfigNode, EnkfFs, EnkfObs, TimeMap, EnKFState, EnsConfig, ErtTemplate, ErtTemplates, LocalConfig, ModelConfig, PlotConfig, SiteConfig] for cls in classes: @@ -26,9 +26,6 @@ def test_failed_class_creation(self): temp = cls() - def test_enums(self): - print(EnkfStateEnum.enum_names) - def test_ecl_config_creation(self): with self.assertRaises(NotImplementedError): ecl_config = EclConfig() @@ -44,7 +41,9 @@ def test_ecl_config_creation(self): with self.assertRaises(AttributeError): self.assertIsInstance(main.ecl_config().get_refcase(), EclSum) - time_map = main.get_fs().get_time_map() + file_system = main.getFileSystem() + self.assertEqual(file_system.getCaseName(), "default") + time_map = file_system.get_time_map() self.assertIsInstance(time_map, TimeMap) del main diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/gui/__init__.py b/ThirdParty/Ert/devel/python/test/ert_tests/gui/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/gui/test_model.py b/ThirdParty/Ert/devel/python/test/ert_tests/gui/test_model.py new file mode 100644 index 0000000000..43b04c4462 --- /dev/null +++ b/ThirdParty/Ert/devel/python/test/ert_tests/gui/test_model.py @@ -0,0 +1,96 @@ +from ert_gui.models import ErtConnector +from ert_gui.models.mixins import BasicModelMixin +from ert_tests import ExtendedTestCase + + +class EmptyModel(ErtConnector, BasicModelMixin): + def __init__(self): + super(EmptyModel, self).__init__() + + +class TestModel(ErtConnector, BasicModelMixin): + TEST_EVENT = "test_event" + + def __init__(self): + self.value = None + super(TestModel, self).__init__() + + def registerDefaultEvents(self): + self.observable().addEvent(TestModel.TEST_EVENT) + + def getValue(self): + return self.value + + def setValue(self, value): + self.value = value + self.observable().notify(TestModel.TEST_EVENT) + + def hasErt(self): + return self.ert() is not None + + + + +class ModelTest(ExtendedTestCase): + + + def setUp(self): + TestModel().setValue(None) + + def tearDown(self): + TestModel().setValue(None) + ErtConnector.setErt(None) + + + def test_abstract_model(self): + model = EmptyModel() + + with self.assertRaises(NotImplementedError): + model.getValue() + + with self.assertRaises(NotImplementedError): + model.setValue("Error") + + + + def test_observer(self): + model = TestModel() + + def observe(): + self.assertEqual(model.getValue(), 2) + + model.observable().attach(TestModel.TEST_EVENT, observe) + + model.setValue(2) # will call the observe function + + model.observable().detach(TestModel.TEST_EVENT, observe) + + + def test_ertification(self): + model = TestModel() + + self.assertFalse(TestModel().hasErt()) + + ErtConnector.setErt("ERT") + self.assertEqual(model.ert(), "ERT") + + self.assertTrue(TestModel().hasErt()) + + + def test_observability(self): + model = EmptyModel() + model1 = TestModel() + model2 = TestModel() + + self.assertIsNone(ErtConnector()) + self.assertIsNotNone(model) + self.assertIsNotNone(model1) + self.assertIsNotNone(model2) + + self.assertNotEqual(model, model1) + self.assertEqual(model1, model2) + + + + + diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/gui/test_observable.py b/ThirdParty/Ert/devel/python/test/ert_tests/gui/test_observable.py new file mode 100644 index 0000000000..3f96b7393f --- /dev/null +++ b/ThirdParty/Ert/devel/python/test/ert_tests/gui/test_observable.py @@ -0,0 +1,96 @@ +from ert_gui.models import Observable +from ert_tests import ExtendedTestCase + + +def observeWithoutSelf(): + pass + +class ObservableTest(ExtendedTestCase): + + def observeWithSelf(self): + pass + + + def test_observable(self): + observable = Observable("Test Observer") + + observable.addEvent("test_event") + self.assertTrue("test_event" in observable) + + observable.attach("test_event", self.observeWithSelf) + observable.attach("test_event", observeWithoutSelf) + + with self.assertRaises(AssertionError): + observable.attach("test_event", "Fail!") #not a callable + + with self.assertRaises(LookupError): + observable.attach("fail", observeWithoutSelf) # not a valid event + + observable.notify("test_event") + + observable.detach("test_event", observeWithoutSelf) + + with self.assertRaises(ValueError): + observable.detach("test_event", observeWithoutSelf) + + + observer_as_lambda = lambda : observeWithoutSelf() + observable.attach("test_event", observer_as_lambda) + observable.notify("test_event") + observable.detach("test_event", observer_as_lambda) + + + def test_events(self): + observable = Observable("Event observer") + observable.addEvent("event1") + observable.addEvent("event2") + + def event1(): + raise ValueError("event 1 error") + + def event2(): + raise NotImplementedError("event 1 error") + + observable.attach("event1", event1) + observable.attach("event2", event2) + + with self.assertRaises(ValueError): + observable.notify("event1") + + with self.assertRaises(NotImplementedError): + observable.notify("event2") + + with self.assertRaises(LookupError): + observable.notify("event3") + + observable.detach("event2", event2) + + # no exception raised when notify list is empty + observable.notify("event2") + + with self.assertRaises(LookupError): + observable.detach("event3", event2) + + def test_weak_references(self): + observable = Observable("Event observer") + observable.addEvent("event") + + self.addAndRemoveListener(observable) #the listener dies when the method returns. + + observable.notify("event") # Should not raise assertion error + + def addAndRemoveListener(self, observable): + + class WeakTest(object): + def __init__(self): + super(WeakTest, self).__init__() + + def listener(self): + raise AssertionError("This should be caught!") + + o = WeakTest() + + observable.attach("event", o.listener) + + with self.assertRaises(AssertionError): + observable.notify("event") diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/job_queue/__init__.py b/ThirdParty/Ert/devel/python/test/ert_tests/job_queue/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/job_queue/test_job_queue.py b/ThirdParty/Ert/devel/python/test/ert_tests/job_queue/test_job_queue.py new file mode 100644 index 0000000000..cc765ddbd7 --- /dev/null +++ b/ThirdParty/Ert/devel/python/test/ert_tests/job_queue/test_job_queue.py @@ -0,0 +1,11 @@ +from ert.job_queue import JobStatusType +from ert_tests import ExtendedTestCase + + +class JobQueueTest(ExtendedTestCase): + + def testStatusEnum(self): + source_path = "libjob_queue/include/ert/job_queue/queue_driver.h" + self.assertEnumIsFullyDefined(JobStatusType, "job_status_type", source_path) + + diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/run/__init__.py b/ThirdParty/Ert/devel/python/test/ert_tests/run/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/run/test_run.py b/ThirdParty/Ert/devel/python/test/ert_tests/run/test_run.py new file mode 100644 index 0000000000..37f9f00298 --- /dev/null +++ b/ThirdParty/Ert/devel/python/test/ert_tests/run/test_run.py @@ -0,0 +1,71 @@ +from ert.test_run import TestRun , path_exists +from ert_tests import ExtendedTestCase + + + + +class RunTest(ExtendedTestCase): + + def test_init(self): + with self.assertRaises(IOError): + TestRun("Does/notExist") + + tr = TestRun("test-data/local/run/config.txt") + self.assertEqual( tr.config_file , "config.txt") + + + def test_cmd(self): + tr = TestRun("test-data/local/run/config.txt") + self.assertEqual( tr.ert_cmd , TestRun.default_ert_cmd ) + + tr.ert_cmd = "/tmp/test" + self.assertEqual( "/tmp/test" , tr.ert_cmd ) + + + def test_args(self): + tr = TestRun("test-data/local/run/config.txt") + self.assertEqual( tr.get_args() , []) + + tr.add_arg("-v") + self.assertEqual( tr.get_args() , ["-v"]) + tr.add_arg("latest") + self.assertEqual( tr.get_args() , ["-v" , "latest"]) + + + def test_workflows(self): + tr = TestRun("test-data/local/run/config.txt") + self.assertEqual( tr.get_workflows() , []) + + tr.add_workflow( "wf1" ) + tr.add_workflow( "wf2" ) + self.assertEqual( tr.get_workflows() , ["wf1" , "wf2"]) + + + def test_run_no_workflow(self): + tr = TestRun("test-data/local/run/config.txt") + with self.assertRaises(Exception): + tr.run() + + + def test_name(self): + tr = TestRun("test-data/local/run/config.txt" , "Name") + self.assertEqual( "Name" , tr.name[:4] ) + + tr = TestRun("test-data/local/run/config.txt") + self.assertEqual( "test-data.local.run.config.txt" , tr.name[:len("test-data/local/run/config.txt")] ) + + + def test_runpath(self): + tr = TestRun("test-data/local/run/config.txt" , "Name") + self.assertEqual( TestRun.default_path_prefix , tr.path_prefix ) + + + def test_check(self): + tr = TestRun("test-data/local/run/config.txt" , "Name") + tr.add_check( path_exists , "some/file" ) + + with self.assertRaises(Exception): + tr.add_check( 25 , "arg") + + with self.assertRaises(Exception): + tr.add_check( func_does_not_exist , "arg") diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/run_tests.py b/ThirdParty/Ert/devel/python/test/ert_tests/run_tests.py index b232be1afd..68877220b1 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/run_tests.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/run_tests.py @@ -1,4 +1,8 @@ -from unittest2 import TestLoader, TextTestRunner + +try: + from unittest2 import TestLoader, TextTestRunner +except ImportError: + from unittest import TestLoader, TextTestRunner def runTestsInDirectory(path="."): diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/source_enumerator.py b/ThirdParty/Ert/devel/python/test/ert_tests/source_enumerator.py new file mode 100644 index 0000000000..f81e59375c --- /dev/null +++ b/ThirdParty/Ert/devel/python/test/ert_tests/source_enumerator.py @@ -0,0 +1,60 @@ +import os +import re + +class SourceEnumerator(object): + @classmethod + def findDevRoot(cls, root_directory_name = "devel"): + dev_root = os.path.dirname(os.path.realpath(__file__)) + + while os.path.basename(dev_root) != root_directory_name: + head, tail = os.path.split(dev_root) + dev_root = head + if tail == "": + raise ValueError("Source root: '%s' not found!" % root_directory_name) + + return dev_root + + @classmethod + def findSourceFile(cls, path): + dev_root = SourceEnumerator.findDevRoot() + + source_file = os.path.join(dev_root, path) + + if not os.path.exists(source_file): + raise ValueError("File not found: %s" % path) + + return source_file + + @classmethod + def removeComments(cls, code_string): + code_string = re.sub(re.compile("/\*.*?\*/",re.DOTALL ) ,"" ,code_string) # remove all occurance streamed comments (/*COMMENT */) from string + code_string = re.sub(re.compile("//.*?\n" ) ,"" ,code_string) # remove all occurance singleline comments (//COMMENT\n ) from string + return code_string + + @classmethod + def findEnum(cls, enum_name, full_source_file_path): + with open(full_source_file_path, "r") as f: + text = f.read() + + text = SourceEnumerator.removeComments(text) + + enum_pattern = re.compile("typedef\s+enum\s+\{(.*?)\}\s*(\w+?);", re.DOTALL) + + for enum in enum_pattern.findall(text): + if enum[1] == enum_name: + return enum[0] + + raise ValueError("Enum with name: '%s' not found!" % enum_name) + + + @classmethod + def findEnumerators(cls, enum_name, source_file_path): + enum_text = SourceEnumerator.findEnum(enum_name, SourceEnumerator.findSourceFile(source_file_path)) + + enumerator_pattern = re.compile("(\w+?)\s*?=\s*?(\d+)") + + enumerators = [] + for enumerator in enumerator_pattern.findall(enum_text): + enumerators.append((enumerator[0], int(enumerator[1]))) + + return enumerators diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/test_ert_gui_import.py b/ThirdParty/Ert/devel/python/test/ert_tests/test_ert_gui_import.py index 16e5003de9..8d31fc5af1 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/test_ert_gui_import.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/test_ert_gui_import.py @@ -21,12 +21,12 @@ class ErtGuiImportTest(ExtendedTestCase): - pass - # def test_ert_gui(self): - # self.assertImportable("ert_gui") - # self.assertImportable("ert_gui.gert_main") - # self.assertImportable("ert_gui.newconfig") - # + def test_ert_gui(self): + self.assertImportable("ert_gui") + self.assertImportable("ert_gui.gert_main") + self.assertImportable("ert_gui.main_window") + self.assertImportable("ert_gui.newconfig") + # def test_ert_gui_widgets(self): # self.assertImportable("ert_gui.widgets") # self.assertImportable("ert_gui.widgets.activelabel") diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/test_ert_import.py b/ThirdParty/Ert/devel/python/test/ert_tests/test_ert_import.py index e8fa9b72ca..c9f7cc0460 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/test_ert_import.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/test_ert_import.py @@ -23,6 +23,10 @@ class ErtImportTest(ExtendedTestCase): def test_ert(self): self.assertImportable("ert") + def test_ert_analysis(self): + self.assertImportable("ert.analysis") + self.assertImportable("ert.analysis.enums.analysis_module_options_enum") + def test_ert_config(self): self.assertImportable("ert.config") self.assertImportable("ert.config.content_type_enum") @@ -56,6 +60,7 @@ def test_ert_ecl(self): self.assertImportable("ert.ecl.ecl_region") self.assertImportable("ert.ecl.ecl_rft") self.assertImportable("ert.ecl.ecl_rft_cell") + self.assertImportable("ert.ecl.ecl_smspec_node") self.assertImportable("ert.ecl.ecl_subsidence") self.assertImportable("ert.ecl.ecl_sum") self.assertImportable("ert.ecl.ecl_sum_node") @@ -67,9 +72,9 @@ def test_ert_ecl(self): def test_ert_enkf(self): self.assertImportable("ert.enkf") self.assertImportable("ert.enkf.analysis_config") + self.assertImportable("ert.enkf.analysis_iter_config") self.assertImportable("ert.enkf.block_obs") self.assertImportable("ert.enkf.ecl_config") - self.assertImportable("ert.enkf.enkf_enum") self.assertImportable("ert.enkf.enkf_fs") self.assertImportable("ert.enkf.enkf_main") self.assertImportable("ert.enkf.enkf_obs") @@ -93,17 +98,22 @@ def test_ert_enkf_data(self): self.assertImportable("ert.enkf.data.gen_kw_config") self.assertImportable("ert.enkf.data.summary_config") + def test_ert_enkf_enums(self): + self.assertImportable("ert.enkf.enums") + self.assertImportable("ert.enkf.enums.enkf_run_enum") + self.assertImportable("ert.enkf.enums.enkf_state_type_enum") + self.assertImportable("ert.enkf.enums.enkf_var_type_enum") + self.assertImportable("ert.enkf.enums.load_fail_type_enum") + + def test_ert_enkf_observations(self): + self.assertImportable("ert.enkf.observations") + self.assertImportable("ert.enkf.observations.obs_vector") + self.assertImportable("ert.enkf.observations.summary_observation") + def test_ert_enkf_util(self): self.assertImportable("ert.enkf.util") - self.assertImportable("ert.enkf.util.obs_vector") self.assertImportable("ert.enkf.util.time_map") - # def test_ert_ert(self): - # self.assertImportable("ert.ert") - # self.assertImportable("ert.ert.c_enums") - # self.assertImportable("ert.ert.enums") - # self.assertImportable("ert.ert.ertwrapper") - def test_ert_geo(self): self.assertImportable("ert.geo") self.assertImportable("ert.geo.geo_polygon") @@ -115,6 +125,7 @@ def test_ert_job_queue(self): self.assertImportable("ert.job_queue.ext_joblist") self.assertImportable("ert.job_queue.forward_model") self.assertImportable("ert.job_queue.job") + self.assertImportable("ert.job_queue.job_status_type_enum") self.assertImportable("ert.job_queue.queue") def test_ert_rms(self): @@ -152,5 +163,6 @@ def test_ert_well(self): self.assertImportable("ert.well.well_state") self.assertImportable("ert.well.well_ts") - + def test_ert_test_run(self): + self.assertImportable("ert.test_run") diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/util/test_ctime.py b/ThirdParty/Ert/devel/python/test/ert_tests/util/test_ctime.py index f9250f98e6..eb04c76c35 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/util/test_ctime.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/util/test_ctime.py @@ -1,7 +1,11 @@ from datetime import datetime -from unittest2 import TestCase from ert.util import ctime +try: + from unittest2 import TestCase +except ImportError: + from unittest import TestCase + class CTimeTest(TestCase): diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/util/test_latex.py b/ThirdParty/Ert/devel/python/test/ert_tests/util/test_latex.py index 297cac9108..631563c07c 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/util/test_latex.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/util/test_latex.py @@ -1,5 +1,9 @@ +try: + from unittest2 import skipIf +except ImportError: + from unittest import skipIf + import os -from unittest2 import skip from ert.util import LaTeX from ert.util.test_area import TestAreaContext from ert_tests import ExtendedTestCase diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/util/test_lookup_table.py b/ThirdParty/Ert/devel/python/test/ert_tests/util/test_lookup_table.py index aa225e8ff3..6577256bde 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/util/test_lookup_table.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/util/test_lookup_table.py @@ -1,4 +1,8 @@ -from unittest2 import TestCase +try: + from unittest2 import TestCase +except ImportError: + from unittest import TestCase + from ert.util import LookupTable import numpy diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/util/test_matrix.py b/ThirdParty/Ert/devel/python/test/ert_tests/util/test_matrix.py index f1ef5c9667..4fbe8d7ac5 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/util/test_matrix.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/util/test_matrix.py @@ -1,5 +1,9 @@ from ert.util import Matrix -from unittest2 import TestCase + +try: + from unittest2 import TestCase +except ImportError: + from unittest import TestCase class MatrixTest(TestCase): def test_matrix(self): diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/util/test_string_list.py b/ThirdParty/Ert/devel/python/test/ert_tests/util/test_string_list.py index ac077299e7..9ee86472c4 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/util/test_string_list.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/util/test_string_list.py @@ -1,4 +1,8 @@ -from unittest2 import TestCase +try: + from unittest2 import TestCase +except ImportError: + from unittest import TestCase + from ert.util import StringList @@ -81,4 +85,12 @@ def test_negative_index(self): self.assertEqual(s[-3], "A") with self.assertRaises(LookupError): - s = s[-4] \ No newline at end of file + s = s[-4] + + def test_find_first(self): + s = StringList(["A", "B", "C"]) + + self.assertEqual(s.index("A"), 0) + self.assertEqual(s.index("B"), 1) + self.assertEqual(s.index("C"), 2) + self.assertEqual(s.index("D"), -1) diff --git a/ThirdParty/Ert/devel/python/test/ert_tests/util/test_vectors.py b/ThirdParty/Ert/devel/python/test/ert_tests/util/test_vectors.py index c37609a1a9..cbbcd5b642 100644 --- a/ThirdParty/Ert/devel/python/test/ert_tests/util/test_vectors.py +++ b/ThirdParty/Ert/devel/python/test/ert_tests/util/test_vectors.py @@ -18,7 +18,11 @@ import copy from datetime import datetime -from unittest2 import TestCase + +try: + from unittest2 import TestCase +except ImportError: + from unittest import TestCase from ert.util import DoubleVector, IntVector, BoolVector, TimeVector, ctime diff --git a/ThirdParty/Ert/devel/python/test/local_bash b/ThirdParty/Ert/devel/python/test/local_bash index 66b6f95ed1..c96c5f856f 100644 --- a/ThirdParty/Ert/devel/python/test/local_bash +++ b/ThirdParty/Ert/devel/python/test/local_bash @@ -1,4 +1,5 @@ export PYTHONPATH=$PWD/../python:$PYTHONPATH +export PYTHONPATH=$PWD/../test:$PYTHONPATH lib_path="../lib64"; if [ -d "$lib_path" ]; then diff --git a/ThirdParty/Ert/devel/python/test/local_csh b/ThirdParty/Ert/devel/python/test/local_csh index 01ef14cc42..5eacc17a0b 100644 --- a/ThirdParty/Ert/devel/python/test/local_csh +++ b/ThirdParty/Ert/devel/python/test/local_csh @@ -1,4 +1,6 @@ setenv PYTHONPATH $PWD/../python:$PYTHONPATH +setenv PYTHONPATH $PWD/../test:$PYTHONPATH + set lib_path="../lib64"; if ( -d "$lib_path") then diff --git a/ThirdParty/Ert/devel/python/test/run_tests.py b/ThirdParty/Ert/devel/python/test/run_tests.py new file mode 100644 index 0000000000..0a182c703b --- /dev/null +++ b/ThirdParty/Ert/devel/python/test/run_tests.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python +import sys +from ert_tests.run_tests import * + +#runTestsInClass("ert_tests.util.test_string_list.StringListTest") +runTestsInClass("ert_tests.run.test_run.RunTest") diff --git a/ThirdParty/Ert/devel/python/test/test-data/local/run/config.txt b/ThirdParty/Ert/devel/python/test/test-data/local/run/config.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ThirdParty/Ert/devel/share/gui/help/init/current_case_selection.html b/ThirdParty/Ert/devel/share/gui/help/init/current_case_selection.html index 4f0133d2a4..fbcc72af96 100644 --- a/ThirdParty/Ert/devel/share/gui/help/init/current_case_selection.html +++ b/ThirdParty/Ert/devel/share/gui/help/init/current_case_selection.html @@ -1 +1 @@ -The case to initialize. +The case to initialize and use for simulation. diff --git a/ThirdParty/Ert/devel/share/gui/help/welcome_to_ert.html b/ThirdParty/Ert/devel/share/gui/help/welcome_to_ert.html new file mode 100644 index 0000000000..8d6993316d --- /dev/null +++ b/ThirdParty/Ert/devel/share/gui/help/welcome_to_ert.html @@ -0,0 +1,17 @@ +
+ _________________________________
+/                                 \
+|    ______   ______   _______    |
+|   |  ____| |  __  \ |__   __|   |
+|   | |__    | |__) |    | |      |
+|   |  __|   |  _  /     | |      |
+|   | |____  | | \ \     | |      |
+|   |______| |_|  \_\    |_|      |
+|                                 |
+|  Ensemble based Reservoir Tool  |
+\_________________________________/
+
+
+

+Welcome to ERT +

diff --git a/VisualizationModules/LibCore/cvfVector2.cpp b/VisualizationModules/LibCore/cvfVector2.cpp deleted file mode 100644 index 05b6299b7a..0000000000 --- a/VisualizationModules/LibCore/cvfVector2.cpp +++ /dev/null @@ -1,32 +0,0 @@ -//################################################################################################## -// -// Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. -// -//################################################################################################## - -#include "cvfBase.h" -#include "cvfVector2.h" - -namespace cvf { - - -template<> Vector2 const Vector2::UNDEFINED(UNDEFINED_DOUBLE, UNDEFINED_DOUBLE); -template<> Vector2 const Vector2::UNDEFINED(UNDEFINED_FLOAT, UNDEFINED_FLOAT); -template<> Vector2 const Vector2::UNDEFINED(UNDEFINED_INT, UNDEFINED_INT); - - -} // namespace cvf - diff --git a/VisualizationModules/LibCore/cvfVersion.h b/VisualizationModules/LibCore/cvfVersion.h deleted file mode 100644 index 3b2e8ff665..0000000000 --- a/VisualizationModules/LibCore/cvfVersion.h +++ /dev/null @@ -1,27 +0,0 @@ -//################################################################################################## -// -// Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. -// -//################################################################################################## - -#pragma once - - - -#define CVF_MAJOR_VERSION "0" // Major version number -#define CVF_MINOR_VERSION "9" // Minor version number -#define CVF_SPECIAL_BUILD "" // Special build description -#define CVF_BUILD_NUMBER "5" // Build number. Increase for each shipment diff --git a/VisualizationModules/LibGuiQt/cvfqtUtils.cpp b/VisualizationModules/LibGuiQt/cvfqtUtils.cpp deleted file mode 100644 index 439685ffbe..0000000000 --- a/VisualizationModules/LibGuiQt/cvfqtUtils.cpp +++ /dev/null @@ -1,99 +0,0 @@ -//################################################################################################## -// -// Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. -// -//################################################################################################## - -#include "cvfBase.h" - -#include "cvfqtUtils.h" - -#include - -namespace cvfqt { - - - -//================================================================================================== -/// -/// \class cvfqt::Utils -/// \ingroup GuiQt -/// -/// Static helper class for CeeViz/Qt interop -/// -//================================================================================================== - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString Utils::toQString(const cvf::String& ceeString) -{ - if (ceeString.isEmpty()) - { - return QString(); - } - - if (sizeof(wchar_t) == 2) - { - const unsigned short* strPtr = reinterpret_cast(ceeString.c_str()); - - return QString::fromUtf16(strPtr); - } - else if (sizeof(wchar_t) == 4) - { - const unsigned int* strPtr = reinterpret_cast(ceeString.c_str()); - - return QString::fromUcs4(strPtr); - } - - CVF_FAIL_MSG("Unexpected sizeof wchar_t"); - return QString(); -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -cvf::String Utils::fromQString(const QString& qtString) -{ - if (qtString.length() == 0) - { - return cvf::String(); - } - - if (sizeof(wchar_t) == 2) - { - const wchar_t* strPtr = reinterpret_cast(qtString.utf16()); - - return cvf::String(strPtr); - } - else if (sizeof(wchar_t) == 4) - { - QVector ucs4Str = qtString.toUcs4(); - ucs4Str.push_back(0); - const wchar_t* strPtr = reinterpret_cast(ucs4Str.data()); - - return cvf::String(strPtr); - } - - CVF_FAIL_MSG("Unexpected sizeof wchar_t"); - return cvf::String(); -} - - -} // namespace cvfqt - - diff --git a/VisualizationModules/LibGuiQt/cvfqtUtils.h b/VisualizationModules/LibGuiQt/cvfqtUtils.h deleted file mode 100644 index 6b45dc6d67..0000000000 --- a/VisualizationModules/LibGuiQt/cvfqtUtils.h +++ /dev/null @@ -1,41 +0,0 @@ -//################################################################################################## -// -// Custom Visualization Core library -// Copyright (C) 2011-2012 Ceetron AS -// -// This library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at <> -// for more details. -// -//################################################################################################## - -#pragma once - -#include "cvfString.h" - -#include - -namespace cvfqt { - - -//================================================================================================== -// -// Static helper class for CeeViz/Qt interop -// -//================================================================================================== -class Utils -{ -public: - static QString toQString(const cvf::String& ceeString); - static cvf::String fromQString(const QString& qtString); -}; - -}