Point Cloud Library (PCL)  1.7.1
interactor.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2010, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage, Inc. nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  * $Id: interactor.h 2050 2011-08-12 15:26:19Z bouffa $
35  *
36  */
37 #ifndef PCL_PCL_VISUALIZER_INTERACTOR_H_
38 #define PCL_PCL_VISUALIZER_INTERACTOR_H_
39 
40 #include <pcl/pcl_macros.h>
41 
42 #include <vtkConfigure.h>
43 #include <vtkObjectFactory.h>
44 #ifdef _WIN32
45 # include <vtkWin32RenderWindowInteractor.h>
46 #else
47 #include <vtkConfigure.h>
48 #if defined VTK_USE_CARBON
49 # include <vtkCarbonRenderWindowInteractor.h>
50 #elif defined VTK_USE_COCOA
51 # include <vtkCocoaRenderWindowInteractor.h>
52 #else
53 // Stupid X.h defines Complex, Bool, Success globally (!)
54 # include <vtkXRenderWindowInteractor.h>
55 # undef Complex
56 # undef Bool
57 # undef Success
58 # undef Status
59 #endif
60 #endif
61 
62 namespace pcl
63 {
64  namespace visualization
65  {
66  /** \brief The PCLVisualizer interactor */
67 #ifdef _WIN32
68  class PCL_EXPORTS PCLVisualizerInteractor : public vtkWin32RenderWindowInteractor
69 #elif defined VTK_USE_CARBON
70  class PCLVisualizerInteractor : public vtkCarbonRenderWindowInteractor
71 #elif defined VTK_USE_COCOA
72  class PCLVisualizerInteractor : public vtkCocoaRenderWindowInteractor
73 #else
74  class PCLVisualizerInteractor : public vtkXRenderWindowInteractor
75 #endif
76  {
77  public:
78  static PCLVisualizerInteractor *New ();
79 
80 // void TerminateApp (void); // do nothing -> disable exit(0) on keys 'q', 'Q' or Esc
81  void stopLoop ();
82 
83  bool stopped;
84  int timer_id_;
85 
86 #if defined (_WIN32) && ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION <= 4))
87  int BreakLoopFlag; // if true quit the GetMessage loop
88 
89  virtual void
90  Start (); // Redefine the vtkWin32RenderWindowInteractor::Start method...
91 
92  vtkGetMacro (BreakLoopFlag, int);
93 
94  void
95  SetBreakLoopFlag (int); // Change the value of BreakLoopFlag
96 
97  void
98  BreakLoopFlagOff (); // set BreakLoopFlag to 0
99 
100  void
101  BreakLoopFlagOn (); // set BreakLoopFlag to 1 (quit)
102 #endif
103  };
104  }
105 }
106 
107 #endif
The PCLVisualizer interactor.
Definition: interactor.h:74