You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.4 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
  5. * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. /**
  25. * @file render_3d_base.cpp
  26. * @brief implements the initialization of the base class
  27. */
  28. #include "render_3d_base.h"
  29. #include <wx/log.h>
  30. /**
  31. * Trace mask used to enable or disable the trace output of this class.
  32. *
  33. * The debug output can be turned on by setting the WXTRACE environment variable to
  34. * "KI_TRACE_3D_RENDER". See the wxWidgets documentation on wxLogTrace for
  35. * more information.
  36. *
  37. * @ingroup trace_env_vars
  38. */
  39. const wxChar* RENDER_3D_BASE::m_logTrace = wxT( "KI_TRACE_3D_RENDER" );
  40. RENDER_3D_BASE::RENDER_3D_BASE( EDA_3D_CANVAS* aCanvas, BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera ) :
  41. m_boardAdapter( aBoardAdapter ),
  42. m_camera( aCamera )
  43. {
  44. wxLogTrace( m_logTrace, wxT( "RENDER_3D_BASE::RENDER_3D_BASE" ) );
  45. m_canvas = aCanvas;
  46. m_is_opengl_initialized = false;
  47. m_windowSize = wxSize( -1, -1 );
  48. m_reloadRequested = true;
  49. }
  50. RENDER_3D_BASE::~RENDER_3D_BASE()
  51. {
  52. }
  53. void RENDER_3D_BASE::SetBusyIndicatorFactory( BUSY_INDICATOR::FACTORY aNewFactory )
  54. {
  55. m_busyIndicatorFactory = aNewFactory;
  56. }
  57. std::unique_ptr<BUSY_INDICATOR> RENDER_3D_BASE::CreateBusyIndicator() const
  58. {
  59. std::unique_ptr<BUSY_INDICATOR> busy;
  60. if( m_busyIndicatorFactory )
  61. busy = m_busyIndicatorFactory();
  62. return busy;
  63. }