|
NorMIT-nav
2023.01.05-dev+develop.0da12
An IGT application
|
Go to the documentation of this file.
14 #include <vtkImageActor.h>
15 #include <vtkImageData.h>
16 #include "vtkRenderWindow.h"
17 #include "vtkRenderer.h"
31 myuid = QString::number(
reinterpret_cast<long>(
this));
61 return "ViewRealTime";
88 rep->connectToView(
mSelf.lock());
122 (*it)->disconnectFromView(
mSelf.lock());
131 if (it ==
mReps.end())
136 rep->disconnectFromView(
mSelf.lock());
147 return std::count(
mReps.begin(),
mReps.end(), rep);
158 os << indent <<
"mUid: " <<
mUid << std::endl;
159 os << indent <<
"mName: " <<
mName << std::endl;
160 os << indent <<
"NumberOfReps: " <<
mReps.size() << std::endl;
162 for (
unsigned i = 0; i <
mReps.size(); ++i)
164 os << indent <<
"<Rep child " << i <<
">" << std::endl;
166 os << indent <<
"</Rep child " << i <<
">" << std::endl;
171 os << indent <<
"<RenderWindow>" << std::endl;
173 os << indent <<
"</RenderWindow>" << std::endl;
174 os << indent <<
"<Renderer>" << std::endl;
176 os << indent <<
"</Renderer>" << std::endl;
177 os << indent <<
"<Props>" << std::endl;
178 vtkPropCollection* collection =
mRenderer->GetViewProps();
179 collection->InitTraversal();
180 vtkProp* prop = collection->GetNextProp();
183 os << indent << indent <<
"<Prop>" << std::endl;
184 prop->PrintSelf(os, indent.
getVtkIndent().GetNextIndent().GetNextIndent());
185 os << indent << indent <<
"</Prop>" << std::endl;
186 prop = collection->GetNextProp();
188 os << indent <<
"</Props>" << std::endl;
200 unsigned long hash = 0;
204 vtkPropCollection* props = this->
getRenderer()->GetViewProps();
205 props->InitTraversal();
206 for (vtkProp* prop = props->GetNextProp(); prop != NULL; prop = props->GetNextProp())
208 vtkImageActor* imageActor = vtkImageActor::SafeDownCast(prop);
209 if (imageActor && imageActor->GetInput())
211 hash += imageActor->GetInput()->GetMTime();
213 hash += prop->GetMTime();
214 hash += prop->GetRedrawMTime();
virtual std::vector< RepPtr > getReps()
Returns all reps in the view.
std::vector< RepPtr > mReps
Storage for internal reps.
vtkSmartPointer< class vtkRenderWindow > vtkRenderWindowPtr
Namespace for all CustusX production code.
virtual void removeRep(const RepPtr &rep)
Removes and disconnects the rep from the view.
QString mName
The view's name.
virtual vtkRenderWindowPtr getRenderWindow() const =0
virtual void setModified()
virtual bool hasRep(const RepPtr &rep) const
Checks if the view already have the rep.
virtual vtkRendererPtr getRenderer() const
Get the renderer used by this View.
virtual void setBackgroundColor(QColor color)
boost::shared_ptr< class Rep > RepPtr
vtkIndent getVtkIndent() const
virtual QString getUid()
Get a views unique id.
vtkRenderWindowPtr mRenderWindow
bool includeDetails() const
ViewRepCollection(vtkRenderWindowPtr renderWindow, const QString &uid, const QString &name="")
constructor
boost::weak_ptr< class View > mSelf
virtual ~ViewRepCollection()
virtual void clear()
Removes everything in the view, inluding reps.
virtual QString getTypeString() const
Formatting class for debug printing of the ssc library.
QString mUid
The view's unique id.
virtual QString getName()
Get a views name.
void print(std::ostream &os)
vtkSmartPointer< class vtkRenderer > vtkRendererPtr
std::vector< RepPtr >::iterator RepsIter
Iterator typedef for the internal rep vector.
virtual void addRep(const RepPtr &rep)
Adds and connects a rep to the view.
virtual void removeReps()
Removes all reps in the view.
virtual View::Type getType() const
virtual void printSelf(std::ostream &os, Indent indent)