IGSTK
Main Page
Namespaces
Classes
Files
File List
File Members
Source
igstkViewProxy.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Image Guided Surgery Software Toolkit
4
Module: $RCSfile: igstkViewProxy.h,v $
5
Language: C++
6
Date: $Date: 2008-05-01 21:58:22 $
7
Version: $Revision: 1.2 $
8
9
Copyright (c) ISC Insight Software Consortium. All rights reserved.
10
See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
11
12
This software is distributed WITHOUT ANY WARRANTY; without even
13
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14
PURPOSE. See the above copyright notices for more information.
15
16
=========================================================================*/
17
#ifndef __igstkViewProxy_h
18
#define __igstkViewProxy_h
19
20
#include "
igstkView.h
"
21
#include "
igstkViewProxyBase.h
"
22
23
namespace
igstk {
24
25
40
template
<
class
W
id
getType>
41
class
ViewProxy
:
public
ViewProxyBase
42
{
43
public
:
44
45
typedef
ViewProxy
Self
;
46
typedef
ViewProxyBase
Superclass
;
47
48
igstkTypeMacro
(
ViewProxy
,
ViewProxyBase
);
49
50
ViewProxy
( )
51
{
52
this->m_Widget = NULL;
53
}
54
55
ViewProxy
( WidgetType * widget )
56
{
57
this->m_Widget = widget;
58
}
59
60
virtual
~ViewProxy
() {}
61
63
void
Connect
(
View
* view )
64
{
65
vtkRenderer * renderer =
66
ViewProxyBase::GetRenderer
( view );
67
68
vtkRenderWindowInteractor * interactor =
69
ViewProxyBase::GetRenderWindowInteractor
( view );
70
71
this->m_Widget->SetRenderer( renderer );
72
this->m_Widget->SetRenderWindowInteractor( interactor );
73
74
// There is no need to call Widget->RequestSetView( view )
75
// because this Connect() method is normally called as a
76
// consequence of calling Widget->RequestSetView(). In other
77
// words, the view is already set in the Widget by the time
78
// the Connect method is called.
79
80
ViewProxyBase::InitializeInteractor
( view );
81
}
82
84
void
SetRenderWindowSize
(
View
* view,
int
width,
int
height )
85
{
86
ViewProxyBase::SetRenderWindowSize
( view, width, height );
87
88
}
89
91
void
SetPickedPointCoordinates
(
View
* view,
double
x,
double
y )
92
{
93
ViewProxyBase::SetPickedPointCoordinates
( view, x, y );
94
}
95
96
97
protected
:
98
99
private
:
100
WidgetType * m_Widget;
101
102
};
103
104
}
// end namespace igstk
105
106
#endif
Generated on Thu Mar 20 2014 13:04:04 for IGSTK by
1.8.1.2