This file is indexed.

/usr/include/IGSTK/igstkView.h is in libigstk4-dev 4.4.0-6.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
/*=========================================================================

  Program:   Image Guided Surgery Software Toolkit
  Module:    $RCSfile: igstkView.h,v $
  Language:  C++
  Date:      $Date: 2008-02-11 01:41:51 $
  Version:   $Revision: 1.35 $

  Copyright (c) ISC  Insight Software Consortium.  All rights reserved.
  See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __igstkView_h
#define __igstkView_h

#ifdef _MSC_VER
#pragma warning ( disable : 4018 )
//Warning about: identifier was truncated to '255' characters in the debug
//information (MVC6.0 Debug)
#pragma warning( disable : 4284 )
#endif

// VTK declarations
class vtkRenderWindow;
class vtkCamera;
class vtkProp;
class vtkInteractorStyle;
class vtkRenderer;
class vtkWorldPointPicker;


// ITK headers
#include "itkCommand.h"

// IGSTK headers
#include "igstkLogger.h"
#include "igstkObject.h"
#include "igstkMacros.h"
#include "igstkStateMachine.h"
#include "igstkPulseGenerator.h"
#include "igstkObjectRepresentation.h"   
#include "igstkEvents.h"   
#include "igstkAnnotation2D.h"   
#include "igstkRenderWindowInteractor.h"   

#include "igstkCoordinateSystemInterfaceMacros.h"

namespace igstk {

/** \class View
 *  
 *  \brief Display graphical representations of surgical scenes.
 * 
 *  The functionality of the View class is to aggregate all the graphical
 *  representations of spatial objects into one scene. igstk::View2D and
 *  igstk::View3D classes are derived from this class for 2D and 3D viewing
 *  capabilities. The view class encapsulate VTK classes into a restrictive
 *  API subjected to control of a state machine.
 *
 * \image html igstkView.png  "State Machine Diagram"
 * \image latex igstkView.eps "State Machine Diagram" 
 *
 * \sa View2D
 * \sa View3D
 *
 * \ingroup Object
 * \ingroup View
 */
class View : public Object 
{

public:

  /** Macro with standard traits declarations. */
   igstkStandardClassTraitsMacro( View, Object );
 
  /** Set the desired frequency for refreshing the view. It is not worth to
   * attempt to go faster than your monitor, nor more than double than your
   * trackers */
  void SetRefreshRate( double frequency );
 
  /** Add an object representation to the list of children and associate it
   * with a specific view. */ 
  void RequestAddObject( ObjectRepresentation* object ); 

  /** Add annotation to the view */
  void RequestAddAnnotation2D( Annotation2D::Pointer  annotation ); 

  /** Remove the object passed as arguments from the list of children, only 
   * if it is associated to a particular view. */ 
  void RequestRemoveObject( ObjectRepresentation* object ); 

  /** Request to save a screen shot into a file. The file format MUST be PNG
   * in order to have lossless compression. This method will trigger an extra
   * rendering of the scene in order to ensure that the image is fresh.
   * */
  void RequestSaveScreenShot( const std::string & filename );

  /** Print the object information in a stream. */
  void Print( std::ostream& os, ::itk::Indent indent=0) const;

  /** Set up variables, types and methods related to the Logger */
  igstkLoggerMacro()

  /** Request to return the camera to a known position */
  void RequestResetCamera();
  
  /** Request Start the periodic refreshing of the view */
  void RequestStart();

  /** Request Stopping the periodic refreshing of the view */
  void RequestStop();

  /** Set Camera position */
  void SetCameraPosition( double x, double y, double z);
  
  /** Set camera focal point */
  void SetCameraFocalPoint( double x, double y, double z);

  /** Set Camera View Up vector */
  void SetCameraViewUp( double vx, double vy, double vz);

  /** Set Clipping range */
  void SetCameraClippingRange( double dNear, double dFar );

  /** Turn on/off parallel projection */
  void SetCameraParallelProjection( bool flag );

  /** Set renderer background color */
  void SetRendererBackgroundColor(
                    double red, double green, double blue );

  /** Set camera zoom factor */
  void SetCameraZoomFactor( double rate );

  friend class ViewProxyBase;

protected:

  View( );
  virtual ~View( void );

  /** Print the object information in a stream. */
  virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
 
  /** Set the interactor style in the derived classes */
  void SetInteractorStyle( vtkInteractorStyle * style );

  /** Set the size of the render window */
  void RequestSetRenderWindowSize( int width, int height );
 
  /** Request initialize the RenderWindow interactor */
  void RequestInitializeRenderWindowInteractor();

  /** Sets the coordinates of the point picked */
  void SetPickedPointCoordinates( double xPosition, double yPosition );

private:

  /** Get renderer */ 
  vtkRenderer *  GetRenderer() const;
 
  /** Get render window */
  vtkRenderWindow * GetRenderWindow() const;

  /** Get render window interactor */
  RenderWindowInteractor *  GetRenderWindowInteractor() const;

  /** Initialize the interactor */
  void InitializeRenderWindowInteractorProcessing();

  /** Add and remove vtk Actors. Intended to be called only by the state
   * machine */
  void AddActorProcessing();
  void RemoveActorProcessing();

  /** Add annotation */
  void AddAnnotation2DProcessing();

  /** Add and remove RepresentationObject classes */
  void AddObjectProcessing();
  void RemoveObjectProcessing();

  /** Method that will refresh the view.. and the GUI */
  void RefreshRender();

  /** Request add actor */
  void RequestAddActor( vtkProp * actor );

  /** Request remove actor */
  void RequestRemoveActor( vtkProp * actor );
  
  /** Report any invalid request to the logger */
  void ReportInvalidRequestProcessing();

  /** Save a screenshot of the current rendered scene while in Idle state */
  void SaveScreenShotWhileIdleProcessing();
  
  /** Save a screenshot of the current rendered scene while
   *  in InteractorInitialized state */
  void SaveScreenShotWhileInteractorInitializedProcessing();
  
  /** Save a screenshot of the current rendered scene while in Refreshing
   * state */
  void SaveScreenShotWhileRefreshingProcessing();

  /** Save a screenshot. This method is the actual implementation of the
   * process of saving the screenshot. This method is invoked from
   * SaveScreenShotWhileIdleProcessing and
   * SaveScreenShotWhileRefreshingProcessing */
  void SaveScreenShot();
  
  /** Reports when a filename for the screen shot is not valid */
  void ReportInvalidScreenShotFileNameProcessing();

  /** Set render window size */
  void SetRenderWindowSizeProcessing(); 

  /** Report invalid render window size. */
  void ReportInvalidRenderWindowSizeProcessing();
 
  /** This should be called by the state machine */
  void StartProcessing();
  void StopProcessing();
  
  /** Reset the settings of the camera */  
  void ResetCameraProcessing();
  
private:
 
  vtkRenderWindow       * m_RenderWindow;
  vtkRenderer           * m_Renderer;
  vtkCamera             * m_Camera;
  vtkWorldPointPicker   * m_PointPicker;

  /** Render Window Interactor */
  RenderWindowInteractor  * m_RenderWindowInteractor;

  /** Member variables for holding temptative arguments of functions.
   *  This is needed for implementing a layer of security that decouples
   *  user invokations from the actual state of this class */
  vtkProp            * m_ActorToBeAdded;
  vtkProp            * m_ActorToBeRemoved;

  Annotation2D::Pointer       m_Annotation2DToBeAdded; 
  
  typedef itk::SimpleMemberCommand< Self >   ObserverType;

  PulseGenerator::Pointer   m_PulseGenerator;
  ObserverType::Pointer     m_PulseObserver;

  /** Object representation types */
  typedef ObjectRepresentation::Pointer     ObjectPointer;
  typedef std::list< ObjectPointer >        ObjectListType; 
  typedef ObjectListType::const_iterator    ObjectListConstIterator;

  /** List of the children object plug to the spatial object. */
  ObjectListType m_Objects; 
 
  // Arguments for methods to be invoked by the state machine.
  ObjectRepresentation::Pointer m_ObjectToBeAdded;
  ObjectRepresentation::Pointer m_ObjectToBeRemoved;
  ObjectListType::iterator      m_IteratorToObjectToBeRemoved;
  std::string                   m_ScreenShotFileName;
  int                           m_RenderWindowWidthToBeSet;
  int                           m_RenderWindowHeightToBeSet;
 
  /** Inputs to the State Machine */
  igstkDeclareInputMacro( ValidAddActor );
  igstkDeclareInputMacro( NullAddActor );
  igstkDeclareInputMacro( ValidRemoveActor );
  igstkDeclareInputMacro( NullRemoveActor );
  igstkDeclareInputMacro( ValidAddObject );
  igstkDeclareInputMacro( NullAddObject );
  igstkDeclareInputMacro( ValidAddAnnotation2D );
  igstkDeclareInputMacro( NullAddAnnotation2D );
  igstkDeclareInputMacro( ExistingAddObject );
  igstkDeclareInputMacro( ValidRemoveObject );
  igstkDeclareInputMacro( InexistingRemoveObject );
  igstkDeclareInputMacro( NullRemoveObject );
  igstkDeclareInputMacro( ResetCamera );
  igstkDeclareInputMacro( StartRefreshing );
  igstkDeclareInputMacro( StopRefreshing );
  igstkDeclareInputMacro( ValidScreenShotFileName );
  igstkDeclareInputMacro( InvalidScreenShotFileName );
  igstkDeclareInputMacro( ValidRenderWindowSize );
  igstkDeclareInputMacro( InValidRenderWindowSize );
  igstkDeclareInputMacro( InitializeInteractor );

  /** States for the State Machine */
  igstkDeclareStateMacro( Idle );
  igstkDeclareStateMacro( InteractorInitialized );
  igstkDeclareStateMacro( Refreshing );

  View(const View& ); // purposely not implemented
  View& operator=(const View& ); // purposely not implemented

  /** Define the coordinate system interface*/
  igstkCoordinateSystemClassInterfaceMacro();

  /** Additional coordinate system used for defining 
   *  picking transforms with respect to the View's 
   *  coordinate system. */
  CoordinateSystem::Pointer  m_PickerCoordinateSystem;
};

std::ostream& operator<<(std::ostream& os, const View& o);

} // end namespace igstk

#endif