Team Fortress 2 Source Code as on 22/4/2020
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.

102 lines
2.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #include "ClipViewPanel.h"
  8. #include "dme_controls/dmedageditpanel.h"
  9. #include "tier1/KeyValues.h"
  10. #include "movieobjects/dmedag.h"
  11. #include "movieobjects/dmemesh.h"
  12. #include "movieobjects/dmevertexdata.h"
  13. #include "vstdlib/random.h"
  14. using namespace vgui;
  15. //-----------------------------------------------------------------------------
  16. // Constructor, destructor
  17. //-----------------------------------------------------------------------------
  18. CClipViewPanel::CClipViewPanel( vgui::Panel *pParent, const char *pName ) :
  19. BaseClass( pParent, pName )
  20. {
  21. m_pClipViewPreview = new CDmeDagEditPanel( this, "ClipViewPreview" );
  22. SetVisible( true );
  23. SetMinimizeButtonVisible( false );
  24. SetMaximizeButtonVisible( false );
  25. SetMinimizeToSysTrayButtonVisible( false );
  26. SetCloseButtonVisible( false );
  27. SetTitle( "3d View", true );
  28. // LoadControlSettings( "resource/SceneViewer_ClipView.res" );
  29. }
  30. CClipViewPanel::~CClipViewPanel()
  31. {
  32. }
  33. //-----------------------------------------------------------------------------
  34. // Scheme settings
  35. //-----------------------------------------------------------------------------
  36. void CClipViewPanel::ApplySchemeSettings( vgui::IScheme *pScheme )
  37. {
  38. BaseClass::ApplySchemeSettings( pScheme );
  39. SetBorder( pScheme->GetBorder( "MenuBorder") );
  40. }
  41. //-----------------------------------------------------------------------------
  42. // Stores the clip
  43. //-----------------------------------------------------------------------------
  44. void CClipViewPanel::SetScene( CDmeDag *pScene )
  45. {
  46. m_pClipViewPreview->SetDmeElement( pScene );
  47. }
  48. CDmeDag *CClipViewPanel::GetScene( )
  49. {
  50. return m_pClipViewPreview->GetDmeElement( );
  51. }
  52. //-----------------------------------------------------------------------------
  53. // Sets animation
  54. //-----------------------------------------------------------------------------
  55. void CClipViewPanel::SetAnimationList( CDmeAnimationList *pAnimationList )
  56. {
  57. m_pClipViewPreview->SetAnimationList( pAnimationList );
  58. }
  59. void CClipViewPanel::SetVertexAnimationList( CDmeAnimationList *pAnimationList )
  60. {
  61. m_pClipViewPreview->SetVertexAnimationList( pAnimationList );
  62. }
  63. void CClipViewPanel::SetCombinationOperator( CDmeCombinationOperator *pComboOp )
  64. {
  65. m_pClipViewPreview->SetCombinationOperator( pComboOp );
  66. }
  67. void CClipViewPanel::RefreshCombinationOperator()
  68. {
  69. m_pClipViewPreview->RefreshCombinationOperator();
  70. }
  71. //-----------------------------------------------------------------------------
  72. // performs the layout
  73. //-----------------------------------------------------------------------------
  74. void CClipViewPanel::PerformLayout()
  75. {
  76. BaseClass::PerformLayout();
  77. int x, y, w, h;
  78. GetClientArea( x, y, w, h );
  79. m_pClipViewPreview->SetBounds( x, y, w, h );
  80. }