Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxDisplayTextRep.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 
13 #ifndef CXDISPLAYTEXTREP_H_
14 #define CXDISPLAYTEXTREP_H_
15 
16 #include "cxResourceVisualizationExport.h"
17 
18 #include <vector>
19 #include "cxRepImpl.h"
20 #include "cxVector3D.h"
21 #include "vtkForwardDeclarations.h"
22 #include "cxBoundingBox3D.h"
23 class QColor;
24 
25 namespace cx
26 {
27 typedef boost::shared_ptr<class TextDisplay> TextDisplayPtr;
28 
29 typedef boost::shared_ptr<class DisplayTextRep> DisplayTextRepPtr;
30 
42 class cxResourceVisualization_EXPORT DisplayTextRep : public RepImpl
43 {
44 public:
45  static DisplayTextRepPtr New(const QString& uid="");
46  virtual QString getType() const{ return "vm::DisplayTextRep";}
47  TextDisplayPtr addText(const QColor& color, const QString& text, const Vector3D& pos, int maxWidth=0, vtkViewport *vp=NULL);
48  void setText(unsigned i, const QString& text);
49  void setColor(const QColor& color );
50  void setFontSize(int size);
51  virtual ~DisplayTextRep();
52 
53 protected:
55  virtual void addRepActorsToViewRenderer(ViewPtr view);
56  virtual void removeRepActorsFromViewRenderer(ViewPtr view);
57 
58  std::vector<TextDisplayPtr> mDisplayText;
59 };
60 
61 }//end namespace
62 
63 #endif /*CXDISPLAYTEXTREP_H_*/
boost::shared_ptr< class View > ViewPtr
boost::shared_ptr< class TextDisplay > TextDisplayPtr
Default implementation of Rep.
Definition: cxRepImpl.h:42
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
virtual QString getType() const
Display a number of text strings.
boost::shared_ptr< class DisplayTextRep > DisplayTextRepPtr
std::vector< TextDisplayPtr > mDisplayText
Namespace for all CustusX production code.