From 803c0f7ab00aaeab2fd13b510ed11765c672b15b Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 29 Jun 2017 22:33:32 +0200 Subject: [PATCH] #1670 Add VecIjk to AppFwk --- Fwk/AppFwk/CommonCode/CMakeLists.txt | 2 + Fwk/AppFwk/CommonCode/cafVecIjk.cpp | 73 ++++++++++++++++++++++++++++ Fwk/AppFwk/CommonCode/cafVecIjk.h | 59 ++++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 Fwk/AppFwk/CommonCode/cafVecIjk.cpp create mode 100644 Fwk/AppFwk/CommonCode/cafVecIjk.h diff --git a/Fwk/AppFwk/CommonCode/CMakeLists.txt b/Fwk/AppFwk/CommonCode/CMakeLists.txt index 8ea50bb5d9..ec5a12cd61 100644 --- a/Fwk/AppFwk/CommonCode/CMakeLists.txt +++ b/Fwk/AppFwk/CommonCode/CMakeLists.txt @@ -49,6 +49,8 @@ add_library( ${PROJECT_NAME} cvfStructGridGeometryGenerator.cpp cvfStructGridGeometryGenerator.h cvfStructGridScalarDataAccess.h + cafVecIjk.cpp + cafVecIjk.h ${MOC_FILES_CPP} ) diff --git a/Fwk/AppFwk/CommonCode/cafVecIjk.cpp b/Fwk/AppFwk/CommonCode/cafVecIjk.cpp new file mode 100644 index 0000000000..16d60de3b4 --- /dev/null +++ b/Fwk/AppFwk/CommonCode/cafVecIjk.cpp @@ -0,0 +1,73 @@ +//################################################################################################## +// +// Custom Visualization Core library +// Copyright (C) 2017 Ceetron Solutions AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; 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 "cafVecIjk.h" + +namespace caf { + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +VecIjk::VecIjk(size_t i, size_t j, size_t k) +{ + m_values = { i, j, k }; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +size_t VecIjk::i() const +{ + return m_values[0]; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +size_t VecIjk::j() const +{ + return m_values[1]; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +size_t VecIjk::k() const +{ + return m_values[2]; +} + +}; //namespace caf \ No newline at end of file diff --git a/Fwk/AppFwk/CommonCode/cafVecIjk.h b/Fwk/AppFwk/CommonCode/cafVecIjk.h new file mode 100644 index 0000000000..6bfcf3f9cb --- /dev/null +++ b/Fwk/AppFwk/CommonCode/cafVecIjk.h @@ -0,0 +1,59 @@ +//################################################################################################## +// +// Custom Visualization Core library +// Copyright (C) 2017 Ceetron Solutions AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; 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 + +namespace caf +{ + +class VecIjk +{ +public: + VecIjk(size_t i, size_t j, size_t k); + + size_t i() const; + size_t j() const; + size_t k() const; + +private: + std::array m_values; +}; + +} +