NorMIT-nav  22.09
An IGT application
cxViewRepCollection.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 #ifndef CXVIEWREPCOLLECTION_H
13 #define CXVIEWREPCOLLECTION_H
14 
15 #include <QObject>
16 #include "cxForwardDeclarations.h"
17 #include "cxView.h"
18 #include <QColor>
19 
20 namespace cx
21 {
22 
23 typedef boost::shared_ptr<class ViewRepCollection> ViewRepCollectionPtr;
24 
30 class ViewRepCollection : public View
31 {
32 Q_OBJECT
33 
34 public:
35  ViewRepCollection(vtkRenderWindowPtr renderWindow, const QString& uid, const QString& name = "");
36  virtual ~ViewRepCollection();
37 
38  void print(std::ostream& os);
39  virtual void printSelf(std::ostream & os, Indent indent);
40  virtual void clear();
41 
42  // Implement pure virtuals in base class
43  virtual vtkRenderWindowPtr getRenderWindow() const { return mRenderWindow; }
44 
45  virtual View::Type getType() const
46  {
47  return mType;
48  }
49  virtual void setType(View::Type type)
50  {
51  mType = type;
52  }
53  virtual QString getTypeString() const;
54  virtual QString getUid();
55  virtual QString getName();
56  virtual vtkRendererPtr getRenderer() const;
57  virtual void addRep(const RepPtr& rep);
58  virtual void removeRep(const RepPtr& rep);
59  virtual bool hasRep(const RepPtr& rep) const;
60  virtual std::vector<RepPtr> getReps();
61  virtual void removeReps();
62  virtual void setBackgroundColor(QColor color);
63 
64  virtual void setModified();
65  int computeTotalMTime();
66 
68  QString mUid;
69  QString mName;
72  std::vector<RepPtr> mReps;
73  typedef std::vector<RepPtr>::iterator RepsIter;
75  boost::weak_ptr<class View> mSelf;
76 };
77 
78 } // namespace cx
79 
80 #endif // CXVIEWREPCOLLECTION_H
cx::ViewRepCollection::mBackgroundColor
QColor mBackgroundColor
Definition: cxViewRepCollection.h:67
cx::ViewRepCollection::getReps
virtual std::vector< RepPtr > getReps()
Returns all reps in the view.
Definition: cxViewRepCollection.cpp:140
cx::ViewRepCollection::computeTotalMTime
int computeTotalMTime()
Definition: cxViewRepCollection.cpp:198
cx::ViewRepCollection::mReps
std::vector< RepPtr > mReps
Storage for internal reps.
Definition: cxViewRepCollection.h:72
vtkRenderWindowPtr
vtkSmartPointer< class vtkRenderWindow > vtkRenderWindowPtr
Definition: vtkForwardDeclarations.h:124
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxForwardDeclarations.h
cx::ViewRepCollection::removeRep
virtual void removeRep(const RepPtr &rep)
Removes and disconnects the rep from the view.
Definition: cxViewRepCollection.cpp:127
cx::ViewRepCollection::mName
QString mName
The view's name.
Definition: cxViewRepCollection.h:69
cx::View::getRenderWindow
virtual vtkRenderWindowPtr getRenderWindow() const =0
cx::ViewRepCollection::setModified
virtual void setModified()
Definition: cxViewRepCollection.cpp:192
cx::ViewRepCollection::hasRep
virtual bool hasRep(const RepPtr &rep) const
Checks if the view already have the rep.
Definition: cxViewRepCollection.cpp:145
cx::ViewRepCollectionPtr
boost::shared_ptr< class ViewRepCollection > ViewRepCollectionPtr
Definition: cxViewRepCollection.h:23
cx::ViewRepCollection::getRenderer
virtual vtkRendererPtr getRenderer() const
Get the renderer used by this View.
Definition: cxViewRepCollection.cpp:76
cx::ViewRepCollection::setBackgroundColor
virtual void setBackgroundColor(QColor color)
Definition: cxViewRepCollection.cpp:92
cx::RepPtr
boost::shared_ptr< class Rep > RepPtr
Definition: cxRepManager.h:24
cxView.h
cx::ViewRepCollection
Definition: cxViewRepCollection.h:30
cx::ViewRepCollection::getUid
virtual QString getUid()
Get a views unique id.
Definition: cxViewRepCollection.cpp:66
cx::ViewRepCollection::mRenderWindow
vtkRenderWindowPtr mRenderWindow
Definition: cxViewRepCollection.h:70
cx::ViewRepCollection::ViewRepCollection
ViewRepCollection(vtkRenderWindowPtr renderWindow, const QString &uid, const QString &name="")
constructor
Definition: cxViewRepCollection.cpp:26
cx::ViewRepCollection::mSelf
boost::weak_ptr< class View > mSelf
Definition: cxViewRepCollection.h:75
cx::ViewRepCollection::~ViewRepCollection
virtual ~ViewRepCollection()
Definition: cxViewRepCollection.cpp:42
cx::ViewRepCollection::clear
virtual void clear()
Removes everything in the view, inluding reps.
Definition: cxViewRepCollection.cpp:106
cx::View
Definition: cxView.h:48
cx::ViewRepCollection::getTypeString
virtual QString getTypeString() const
Definition: cxViewRepCollection.cpp:50
cx::Indent
Formatting class for debug printing of the ssc library.
Definition: cxIndent.h:28
cx::ViewRepCollection::mUid
QString mUid
The view's unique id.
Definition: cxViewRepCollection.h:68
cx::ViewRepCollection::mType
View::Type mType
Definition: cxViewRepCollection.h:74
cx::ViewRepCollection::getName
virtual QString getName()
Get a views name.
Definition: cxViewRepCollection.cpp:71
cx::ViewRepCollection::setType
virtual void setType(View::Type type)
Definition: cxViewRepCollection.h:49
cx::ViewRepCollection::print
void print(std::ostream &os)
Definition: cxViewRepCollection.cpp:150
vtkRendererPtr
vtkSmartPointer< class vtkRenderer > vtkRendererPtr
Definition: vtkForwardDeclarations.h:122
cx::ViewRepCollection::RepsIter
std::vector< RepPtr >::iterator RepsIter
Iterator typedef for the internal rep vector.
Definition: cxViewRepCollection.h:73
cx::View::Type
Type
Definition: cxView.h:52
cx::ViewRepCollection::addRep
virtual void addRep(const RepPtr &rep)
Adds and connects a rep to the view.
Definition: cxViewRepCollection.cpp:81
cx::ViewRepCollection::removeReps
virtual void removeReps()
Removes all reps in the view.
Definition: cxViewRepCollection.cpp:118
cx::ViewRepCollection::mRenderer
vtkRendererPtr mRenderer
Definition: cxViewRepCollection.h:71
cx::ViewRepCollection::getType
virtual View::Type getType() const
Definition: cxViewRepCollection.h:45
cx::ViewRepCollection::printSelf
virtual void printSelf(std::ostream &os, Indent indent)
Definition: cxViewRepCollection.cpp:156