~ubuntu-branches/ubuntu/lucid/igstk/lucid

« back to all changes in this revision

Viewing changes to Examples/TrackingVolumeViewer/TrackingVolumeViewerQuadrantViews.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Dominique Belhachemi
  • Date: 2009-10-07 17:35:43 UTC
  • mfrom: (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091007173543-69eyhyjrh0bfoqe5
Tags: 4.2.0-2
* Fixed link issue (Closes: #549799)
* switch to quilt

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*=========================================================================
 
2
 
 
3
  Program:   Image Guided Surgery Software Toolkit
 
4
  Module:    $RCSfile: TrackingVolumeViewerQuadrantViews.cxx,v $
 
5
  Language:  C++
 
6
  Date:      $Date: 2009-01-30 20:48:03 $
 
7
  Version:   $Revision: 1.1 $
 
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
 
 
18
// generated by Fast Light User Interface Designer (fluid) version 1.0107
 
19
 
 
20
#include "TrackingVolumeViewerQuadrantViews.h"
 
21
 
 
22
namespace igstk
 
23
{
 
24
 
 
25
TrackingVolumeViewerQuadrantViews::TrackingVolumeViewerQuadrantViews(int X, int Y, int W, int H, const char *L)
 
26
  : Fl_Group(X, Y, W, H, L)
 
27
{
 
28
 
 
29
  m_Reporter = ::itk::Object::New();
 
30
 
 
31
  const int C = 5;    // Width of the vertical separator
 
32
 
 
33
  Fl_Group * parentGroup = this->parent();
 
34
 
 
35
  m_X = 150; // width of the control panel
 
36
  m_Y = 0;
 
37
 
 
38
  m_Width = parentGroup->w() - m_X;
 
39
  m_Height = parentGroup->h(); 
 
40
 
 
41
  m_WW = (int) (m_Width-2*C)/2;
 
42
  m_HH = (int) (m_Height-2*C)/2;
 
43
 
 
44
  // Create widgets
 
45
  typedef igstk::FLTKWidget   WidgetType;
 
46
 
 
47
  m_AxialWidget    = new WidgetType(X, Y, m_WW, m_HH, "Display 0");
 
48
  m_SagittalWidget = new WidgetType(X+m_WW+C, Y, m_WW, m_HH, "Display 1");
 
49
  m_CoronalWidget  = new WidgetType(X, Y+m_HH+C, m_WW, m_HH, "Display 2");
 
50
  m_3DWidget       = new WidgetType(X+m_WW+C, Y+m_HH+C, m_WW, m_HH, "Display 3");       
 
51
 
 
52
  // Create views
 
53
  m_AxialView    = ViewType2D::New();
 
54
  m_AxialView->RequestSetOrientation( View2D::Axial );
 
55
 
 
56
  m_SagittalView = ViewType2D::New();
 
57
  m_SagittalView->RequestSetOrientation( View2D::Sagittal );
 
58
 
 
59
  m_CoronalView  = ViewType2D::New();
 
60
  m_CoronalView->RequestSetOrientation( View2D::Coronal );
 
61
 
 
62
  m_3DView = ViewType3D::New();
 
63
 
 
64
  m_AxialWidget->RequestSetView( m_AxialView );
 
65
  m_SagittalWidget->RequestSetView( m_SagittalView );
 
66
  m_CoronalWidget->RequestSetView( m_CoronalView );
 
67
  m_3DWidget->RequestSetView( m_3DView );
 
68
 
 
69
  end();
 
70
}
 
71
 
 
72
TrackingVolumeViewerQuadrantViews::~TrackingVolumeViewerQuadrantViews()
 
73
{
 
74
  delete m_AxialWidget;
 
75
  delete m_SagittalWidget;
 
76
  delete m_CoronalWidget;
 
77
  delete m_3DWidget;
 
78
}
 
79
 
 
80
unsigned long TrackingVolumeViewerQuadrantViews::AddObserver(
 
81
  const ::itk::EventObject & event, ::itk::Command * observer )
 
82
{
 
83
  return m_Reporter->AddObserver( event, observer );
 
84
}
 
85
 
 
86
void TrackingVolumeViewerQuadrantViews::RemoveObserver( unsigned long tag )
 
87
{
 
88
  m_Reporter->RemoveObserver( tag );
 
89
}
 
90
 
 
91
void TrackingVolumeViewerQuadrantViews::RemoveAllObservers()
 
92
{
 
93
  m_Reporter->RemoveAllObservers();
 
94
}
 
95
 
 
96
 
 
97
} // end namespace igstk