MarkupPartText3d.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: Visualization
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2015, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeVisualization/Base.h"
16 #include "CeeCore/RefCountedObject.h"
17 #include "CeeVisualization/MarkupPart.h"
18 #include "CeeVisualization/MarkupText3dItem.h"
19 #include "CeeCore/Color3f.h"
20 #include "CeeCore/Str.h"
21 #include "CeeCore/Vec3d.h"
22 #include "CeeCore/PtrRef.h"
23 
24 namespace cee {
25 class BoundingBox;
26 
27 namespace vis {
28 class Font;
29 
30 //==================================================================================================
31 //
32 //
33 //
34 //==================================================================================================
35 class CEE_VIS_EXPORT MarkupPartText3d: public MarkupPart
36 {
37 public:
39  virtual ~MarkupPartText3d();
40 
41  virtual PartType type() const;
42  virtual BoundingBox boundingBox() const;
43 
44  virtual void setPriority(int priority);
45  virtual int priority() const;
46 
47  virtual const Mat4d& transformation() const;
48  virtual void setTransformation(const Mat4d& matrix);
49 
50  const Font* font() const;
51  void setFont(Font* labelFont);
52 
53  const Color3f& textColor() const;
54  void setTextColor(const Color3f& color);
55 
56  float eyeLiftFactor() const;
57  void setEyeLiftFactor(float factor);
58 
59  unsigned int maximumNumberOfLabelsToDraw() const;
60  void setMaximumNumberOfLabelsToDraw(unsigned int maximumNumberToDraw);
61 
62  size_t count() const;
63  MarkupText3dItem textItem(size_t index) const;
64  size_t add(const MarkupText3dItem& item);
65  size_t add(const Str& text, const Vec3d& position, const Vec3d& directionVector, const Vec3d& upVector, double textHeight);
66  void set(size_t index, const MarkupText3dItem& item);
67  void remove(size_t index);
68  void removeAll();
69 
70  static PtrRef<MarkupPartText3d> create(const Str& text, const Color3f& color, const Vec3d& position, const Vec3d& directionVector, const Vec3d& upVector, double textHeight);
71 
72 protected:
73  virtual bool internal_preRenderUpdatePart(bool forceUpdate, cvf::OpenGLContext* cvfContext, MarkupClippingData* clippingData);
74  virtual cvf::Part* internal_cvfPart();
75 
76 private:
77  CEE_PRIVATE_F(MarkupModel);
78  CEE_PRIVATE_IMPL(MarkupPartText3d);
79  CEE_DISALLOW_COPY_AND_ASSIGN(MarkupPartText3d);
80 };
81 
82 } // namespace vis
83 } // namespace cee
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
A general unicode based string class.
Definition: Str.h:28
Model used for drawing labels, arrows, lines, points, triangles and glyphs.
Definition: MarkupModel.h:31
Smart pointer class used for handling reference counted objects (that derive from Object)...
Definition: PtrRef.h:26
PartType
Enum specifying the type of MarkupPart.
Definition: MarkupPart.h:39
Base class for MarkupModel Parts.
Definition: MarkupPart.h:35
Axis-aligned bounding box.
Definition: BoundingBox.h:27
Class for storing an RGB color triplet.
Definition: Color3f.h:25
A MarkupModel part for drawing text positioned and oriented in 3D.
Definition: MarkupPartText3d.h:35
Vector class for a 3D double vector.
Definition: Vec3d.h:26
An item for a MarkupPartText3d.
Definition: MarkupText3dItem.h:31
A font used for text drawing.
Definition: Font.h:30
4 dimensional matrix.
Definition: Mat4d.h:26