Viewer.hpp
00001 //
00002 // Viewer Tool for SAL3D.
00003 // Copyright 2010 AQSENSE, S.L.
00004 //
00005 #if !defined (AQSENSE_SAL3DPP_VIEWER_HPP)
00006 #define AQSENSE_SAL3DPP_VIEWER_HPP
00007 
00008 #if defined (_MSC_VER) && (_MSC_VER >= 1020)
00009 #pragma once
00010 #endif
00011 
00012 #include <sal3dpp/RangeMap.hpp>
00013 #include <sal3dpp/COP.hpp>
00014 #include <sal3dpp/ZMap.hpp>
00015 #include <sal3d/viewer.h>
00016 
00017 namespace sal3d
00018 {
00057 namespace Viewer
00058 {
00074     inline void
00075     initialize()
00076     {
00077         Error e;
00078         sal3d_viewer_initialize(&e.e);
00079         if (e.e.value < 0)
00080             throw e;
00081     }
00082 
00096     inline void
00097     cleanup()
00098     {
00099         Error e;
00100         sal3d_viewer_cleanup(&e.e);
00101         if (e.e.value < 0)
00102             throw e;
00103     }
00104 
00120     inline void
00121     display(const sal3d::RangeMap &rm)
00122     {
00123         Error e;
00124         sal3d_viewer_add_range_map(rm.c_range_map(), &e.e);
00125         if (e.e.value < 0)
00126             throw e;
00127     }
00128 
00144     inline void
00145     display(const sal3d::COP &cop)
00146     {
00147         Error e;
00148         sal3d_viewer_add_cop(cop.c_cop(), &e.e);
00149         if (e.e.value < 0)
00150             throw e;
00151     }
00152 
00153 
00170     inline void
00171     display(const sal3d::COP &cop1, const sal3d::COP &cop2)
00172     {
00173         Error e;
00174         sal3d_viewer_add_cops(cop1.c_cop(), cop2.c_cop(), &e.e);
00175         if (e.e.value < 0)
00176             throw e;
00177     }
00178 
00194     inline void
00195     display(const sal3d::ZMap &zmap)
00196     {
00197         Error e;
00198         sal3d_viewer_add_zmap(zmap.c_zmap(), &e.e);
00199         if (e.e.value < 0)
00200             throw e;
00201     }
00202 
00215     inline void
00216     waitAllClosed()
00217     {
00218         Error e;
00219         sal3d_viewer_wait_all_closed(&e.e);
00220         if (e.e.value < 0)
00221             throw e;
00222     }
00223 }
00224 }
00225 
00226 #endif //AQSENSE_SAL3DPP_VIEWER_HPP