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