ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccMapWindow.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // CV_DB_LIB
11 #include <ecvDisplayTools.h>
12 #include <ecvScalarField.h>
13 
15 class ccMapWindow : public QWidget {
16 public:
18  explicit ccMapWindow(QWidget* parent = 0)
19  : QWidget(parent), m_sfForRampDisplay(0), m_showSF(true) {}
20 
23 
25 
28  if (m_sfForRampDisplay != sf) {
30 
31  m_sfForRampDisplay = sf;
32 
34  }
35  }
36 
38  void showSF(bool state) { m_showSF = state; }
39 
41  bool sfShown() const { return m_showSF; }
42 
45  return m_sfForRampDisplay;
46  }
47 
48  // inherited fro ecvDisplayTools
51 
52  if (m_showSF) {
53  // override sf that will be used for color ramp display
54  context.sfColorScaleToDisplay = m_sfForRampDisplay;
55  }
56  }
57 
58 protected:
61 
63  bool m_showSF;
64 };
virtual void link()
Increase counter.
Definition: CVShareable.cpp:33
virtual void release()
Decrease counter and deletes object when 0.
Definition: CVShareable.cpp:35
2D map display window
Definition: ccMapWindow.h:15
bool sfShown() const
Returns whether associated SF should be shown or not.
Definition: ccMapWindow.h:41
ccScalarField * m_sfForRampDisplay
Associated scalar field.
Definition: ccMapWindow.h:60
virtual void getContext(CC_DRAW_CONTEXT &context)
Definition: ccMapWindow.h:49
bool m_showSF
Whether to show or not the associated SF.
Definition: ccMapWindow.h:63
ccMapWindow(QWidget *parent=0)
Default constructor.
Definition: ccMapWindow.h:18
virtual ~ccMapWindow()
Destructor.
Definition: ccMapWindow.h:22
void showSF(bool state)
Whether to show associated SF or not.
Definition: ccMapWindow.h:38
void setAssociatedScalarField(ccScalarField *sf)
Sets associated scalar-field.
Definition: ccMapWindow.h:27
ccScalarField * getAssociatedScalarField() const
Returns associated scalar field.
Definition: ccMapWindow.h:44
A scalar field associated to display-related parameters.
static void GetContext(CC_DRAW_CONTEXT &CONTEXT)
Returns context information.
ImGuiContext * context
Definition: Window.cpp:76
Display context.