Blue Brain BioExplorer
ClipPlane.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2024, EPFL/Blue Brain Project
3  * All rights reserved. Do not distribute without permission.
4  * Responsible Author: Juan Hernando <juan.hernando@epfl.ch>
5  *
6  * This file is part of Blue Brain BioExplorer <https://github.com/BlueBrain/BioExplorer>
7  *
8  * This library is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License version 3.0 as published
10  * by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #pragma once
23 
26 
27 SERIALIZATION_ACCESS(ClipPlane)
28 
29 namespace core
30 {
31 class ClipPlane : public BaseObject
32 {
33 public:
38  ClipPlane(const Plane& plane)
39  : _id(_nextID++)
40  , _plane(plane)
41  {
42  }
43 
47  ClipPlane() = default;
48 
54  ClipPlane(const size_t id, const Plane& plane);
55 
60  size_t getID() const { return _id; }
61 
66  const Plane& getPlane() const { return _plane; };
67 
72  void setPlane(const Plane& plane) { _updateValue(_plane, plane); }
73 
74 private:
75  static size_t _nextID;
76  size_t _id = 0;
77  Plane _plane = {{0}};
78 
82  SERIALIZATION_FRIEND(ClipPlane);
83 };
84 } // namespace core
#define SERIALIZATION_ACCESS(type)
Definition: Macros.h:25
void _updateValue(T &member, const T &newValue, const bool triggerCallback=true)
Definition: BaseObject.h:87
ClipPlane(const Plane &plane)
Constructor.
Definition: ClipPlane.h:38
const Plane & getPlane() const
Returns the constant reference to the Plane object of this clip plane object.
Definition: ClipPlane.h:66
void setPlane(const Plane &plane)
Sets the Plane object of this clip plane object.
Definition: ClipPlane.h:72
size_t getID() const
Returns id of this clip plane object.
Definition: ClipPlane.h:60
ClipPlane(const size_t id, const Plane &plane)
Constructor with id and plane defined internally.
ClipPlane()=default
Default constructor defined internally.
std::array< double, 4 > Plane
Definition: Types.h:308
@ plane
Definition: CommonTypes.h:39