perf: improve polygon render performance
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <vtkTextProperty.h>
|
||||
#include <vtkPolygon.h>
|
||||
#include <vtkLine.h>
|
||||
#include <vtkCamera.h>
|
||||
|
||||
#include <QFile>
|
||||
#include <QCoreApplication>
|
||||
@@ -30,6 +31,9 @@ void OpenPolyAnnotationActor::SetRenderer(vtkRenderer *ren) {
|
||||
|
||||
void OpenPolyAnnotationActor::BuildShape() {
|
||||
if (!BaseDataPoints->GetNumberOfPoints()) return;
|
||||
QString stamp = QString("%1-%2").arg(BaseDataPoints->GetMTime())
|
||||
.arg(Renderer->GetActiveCamera()->GetMTime());
|
||||
if (mRenderTime == stamp) return;
|
||||
RebuildRenderPoint();
|
||||
vtkNew<vtkPolyLineSource> source;
|
||||
source->SetClosed(this->Closed);
|
||||
|
||||
@@ -83,6 +83,7 @@ protected:
|
||||
|
||||
vtkTextProperty *textProperty;
|
||||
bool measured;
|
||||
QString mRenderTime;
|
||||
QString mUnitmm ;
|
||||
QString mUnitcm ;
|
||||
QString mUnitmm2;
|
||||
|
||||
Reference in New Issue
Block a user