ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecv2DViewportLabel.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 // Local
11 #include "ecv2DViewportObject.h"
12 
15 public:
17  explicit cc2DViewportLabel(QString name = QString());
18 
19  // inherited from ccHObject
20  virtual CV_CLASS_ENUM getClassID() const override {
22  }
23  virtual bool isSerializable() const override { return true; }
24 
26  const float* roi() const { return m_roi; }
27 
29  void setRoi(const float* roi);
30 
31  void clear2Dviews();
32 
33  void updateLabel();
34 
35  void update2DLabelView(CC_DRAW_CONTEXT& context, bool updateScreen = true);
36 
37 protected:
38  // inherited from ccHObject
39  bool toFile_MeOnly(QFile& out, short dataVersion) const override;
40  short minimumFileVersion_MeOnly() const override;
41  bool fromFile_MeOnly(QFile& in,
42  short dataVersion,
43  int flags,
44  LoadedIDMap& oldToNewIDMap) override;
45 
47  virtual void drawMeOnly(CC_DRAW_CONTEXT& context) override;
48 
50 
52  float m_roi[4];
53 };
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
Definition: CVTypes.h:97
#define CV_DB_LIB_API
Definition: CV_db.h:15
std::string name
2D viewport label
void setRoi(const float *roi)
Sets ROI (relative to screen)
virtual void drawMeOnly(CC_DRAW_CONTEXT &context) override
Draws the entity only (not its children)
bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads own object data.
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
cc2DViewportLabel(QString name=QString())
Default constructor.
void update2DLabelView(CC_DRAW_CONTEXT &context, bool updateScreen=true)
const float * roi() const
Returns ROI (relative to screen)
short minimumFileVersion_MeOnly() const override
virtual bool isSerializable() const override
Returns whether object is serializable of not.
virtual CV_CLASS_ENUM getClassID() const override
Returns class ID.
2D viewport object
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
ImGuiContext * context
Definition: Window.cpp:76
@ VIEWPORT_2D_LABEL
Definition: CVTypes.h:142
Display context.