summaryrefslogtreecommitdiff
path: root/utils/sceneviewer/clipviewpanel.cpp
blob: 209ad3e3f3a2893c1c7bbcfcca68b85d596e957c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================

#include "ClipViewPanel.h"
#include "dme_controls/dmedageditpanel.h"
#include "tier1/KeyValues.h"

#include "movieobjects/dmedag.h"
#include "movieobjects/dmemesh.h"
#include "movieobjects/dmevertexdata.h"
#include "vstdlib/random.h"

using namespace vgui;



//-----------------------------------------------------------------------------
// Constructor, destructor
//-----------------------------------------------------------------------------
CClipViewPanel::CClipViewPanel( vgui::Panel *pParent, const char *pName ) :
	BaseClass( pParent, pName )
{
	m_pClipViewPreview = new CDmeDagEditPanel( this, "ClipViewPreview" );

	SetVisible( true );
	SetMinimizeButtonVisible( false );
	SetMaximizeButtonVisible( false );
	SetMinimizeToSysTrayButtonVisible( false );
	SetCloseButtonVisible( false );
								 
	SetTitle( "3d View", true );

//	LoadControlSettings( "resource/SceneViewer_ClipView.res" );
}

CClipViewPanel::~CClipViewPanel()
{
}


//-----------------------------------------------------------------------------
// Scheme settings
//-----------------------------------------------------------------------------
void CClipViewPanel::ApplySchemeSettings( vgui::IScheme *pScheme )
{
	BaseClass::ApplySchemeSettings( pScheme );
	SetBorder( pScheme->GetBorder( "MenuBorder") );
}


//-----------------------------------------------------------------------------
// Stores the clip
//-----------------------------------------------------------------------------
void CClipViewPanel::SetScene( CDmeDag *pScene )
{
	m_pClipViewPreview->SetDmeElement( pScene );
}

CDmeDag *CClipViewPanel::GetScene( )
{
	return m_pClipViewPreview->GetDmeElement( );
}


//-----------------------------------------------------------------------------
// Sets animation
//-----------------------------------------------------------------------------
void CClipViewPanel::SetAnimationList( CDmeAnimationList *pAnimationList )
{
	m_pClipViewPreview->SetAnimationList( pAnimationList );
}

void CClipViewPanel::SetVertexAnimationList( CDmeAnimationList *pAnimationList )
{
	m_pClipViewPreview->SetVertexAnimationList( pAnimationList );
}

void CClipViewPanel::SetCombinationOperator( CDmeCombinationOperator *pComboOp )
{
	m_pClipViewPreview->SetCombinationOperator( pComboOp );
}

void CClipViewPanel::RefreshCombinationOperator()
{
	m_pClipViewPreview->RefreshCombinationOperator();
}


//-----------------------------------------------------------------------------
// performs the layout
//-----------------------------------------------------------------------------
void CClipViewPanel::PerformLayout()
{
	BaseClass::PerformLayout();

	int x, y, w, h;
	GetClientArea( x, y, w, h );
	m_pClipViewPreview->SetBounds( x, y, w, h );
}