OpenMS
BaseVisualizer.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg$
6 // $Authors: Marc Sturm $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // OpenMS_GUI config
12 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13 
14 namespace OpenMS
15 {
26  template <typename ObjectType>
27  class OPENMS_GUI_DLLAPI BaseVisualizer
28  {
29 public:
30 
32  void load(ObjectType& o)
33  {
34  ptr_ = &o;
35  temp_ = o;
36 
37  update_();
38  }
39 
40  virtual ~BaseVisualizer() {}
41 
42 protected:
43 
45  ObjectType* ptr_;
47  ObjectType temp_;
48 
49 protected:
50 
52  virtual void update_()
53  {
54  }
55 
56  };
57 
58 
59 }
A base class for all visualizer classes.
Definition: BaseVisualizer.h:28
ObjectType temp_
Copy of current object used to restore the original values.
Definition: BaseVisualizer.h:47
void load(ObjectType &o)
Loads the object that is to be edited.
Definition: BaseVisualizer.h:32
virtual ~BaseVisualizer()
Definition: BaseVisualizer.h:40
virtual void update_()
Updates the GUI from the temp_ variable.
Definition: BaseVisualizer.h:52
ObjectType * ptr_
Pointer to the object that is currently edited.
Definition: BaseVisualizer.h:45
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19