MarkupPartLines.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: Visualization
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2014, 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 "CeeCore/Color3f.h"
19 #include "CeeCore/Vec3d.h"
20 #include "CeeCore/PtrRef.h"
21 
22 #include <vector>
23 
24 namespace cee {
25 class BoundingBox;
26 
27 namespace vis {
28 
29 //==================================================================================================
30 //
31 //
32 //
33 //==================================================================================================
34 class CEE_VIS_EXPORT MarkupPartLines : public MarkupPart
35 {
36 public:
37  MarkupPartLines();
38  MarkupPartLines(const Color3f& color, float lineWidth, bool alwaysVisible, float eyeLiftFactor);
39  virtual ~MarkupPartLines();
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 Color3f& color() const;
51  void setColor(const Color3f& color);
52 
53  float lineWidth() const;
54  void setLineWidth(float lineWidth);
55 
56  bool alwaysVisible() const;
57  void setAlwaysVisible(bool showAlways);
58 
59  float eyeLiftFactor() const;
60  void setEyeLiftFactor(float factor);
61 
62  void add(const Vec3d& vertex1, const Vec3d& vertex2);
63  void add(const std::vector<Vec3d>& vertices);
64  size_t count() const;
65  void removeAll();
66 
67  const std::vector<Vec3d>& vertices() const;
68 
69  static PtrRef<MarkupPartLines> create(const std::vector<Vec3d>& vertices, const Color3f& color, float lineWidth = 1.0f, bool alwaysVisible = false, float eyeLiftFactor = 0.0f);
70  static PtrRef<MarkupPartLines> create(const Vec3d& vertex1, const Vec3d& vertex2, const Color3f& color, float lineWidth = 1.0f, bool alwaysVisible = false, float eyeLiftFactor = 0.0f);
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_IMPL(MarkupPartLines);
78  CEE_DISALLOW_COPY_AND_ASSIGN(MarkupPartLines);
79 };
80 
81 } // namespace vis
82 } // namespace cee
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
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
Vector class for a 3D double vector.
Definition: Vec3d.h:26
A MarkupModel part for drawing lines.
Definition: MarkupPartLines.h:34
4 dimensional matrix.
Definition: Mat4d.h:26