forked from daviddoria/vtkFrameRateWidget
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvtkFrameRateRepresentation.cxx
More file actions
116 lines (91 loc) · 3.33 KB
/
vtkFrameRateRepresentation.cxx
File metadata and controls
116 lines (91 loc) · 3.33 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkFrameRateRepresentation.cxx,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkFrameRateRepresentation.h"
#include "vtkActor.h"
#include "vtkTextActor.h"
#include "vtkPolyDataMapper.h"
#include "vtkPolyData.h"
#include "vtkCallbackCommand.h"
#include "vtkPolyData.h"
#include "vtkProperty.h"
#include "vtkTextProperty.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "vtkInteractorObserver.h"
#include "vtkMath.h"
#include "vtkAssemblyPath.h"
#include "vtkWindow.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkFrameRateRepresentation, "$Revision: 1.9 $");
vtkStandardNewMacro(vtkFrameRateRepresentation);
//----------------------------------------------------------------------------
vtkFrameRateRepresentation::vtkFrameRateRepresentation()
{
this->TextActor = vtkSmartPointer<vtkTextActor>::New();
this->TextActor->GetTextProperty()->SetFontSize ( 24 );
this->TextActor->SetPosition2 ( 10, 40 );
this->TextActor->SetInput ( "Frame Rate" );
this->TextActor->GetTextProperty()->SetColor ( 1.0,0.0,0.0 );
if(!this->Renderer)
{
cout << "Render is NULL" << endl;
}
}
//----------------------------------------------------------------------------
vtkFrameRateRepresentation::~vtkFrameRateRepresentation()
{
}
//----------------------------------------------------------------------------
void vtkFrameRateRepresentation::BuildRepresentation()
{
//frameRateWidget->SetRenderer(renderer);
//this->SetRenderer(renderer);
/*
// Rebuild only if necessary
if ( this->GetMTime() > this->BuildTime ||
(this->Renderer && this->Renderer->GetVTKWindow() &&
(this->Renderer->GetVTKWindow()->GetMTime() > this->BuildTime ||
this->Renderer->GetActiveCamera()->GetMTime() > this->BuildTime)) )
{
this->BuildTime.Modified();
}
*/
}
//----------------------------------------------------------------------------
void vtkFrameRateRepresentation::ReleaseGraphicsResources(vtkWindow *w)
{
}
//----------------------------------------------------------------------------
int vtkFrameRateRepresentation::RenderOpaqueGeometry(vtkViewport *v)
{
int count=0;
this->BuildRepresentation();
return count;
}
//----------------------------------------------------------------------------
int vtkFrameRateRepresentation::RenderTranslucentPolygonalGeometry(vtkViewport *v)
{
int count=0;
this->BuildRepresentation();
return count;
}
//----------------------------------------------------------------------------
int vtkFrameRateRepresentation::HasTranslucentPolygonalGeometry()
{
int result=0;
this->BuildRepresentation();
return result;
}
//----------------------------------------------------------------------------
void vtkFrameRateRepresentation::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}