Skip to content

Libs/Analyze/MeshWorker.h

Worker class for parallel mesh reconstruction. More...

Namespaces

Name
shapeworks
User usage reporting (telemetry)

Classes

Name
class shapeworks::MeshWorker

Functions

Name
Q_DECLARE_METATYPE(vtkSmartPointer< vtkPolyData > )

Detailed Description

Worker class for parallel mesh reconstruction.

The MeshWorker implements each thread's mesh construction management

Functions Documentation

function Q_DECLARE_METATYPE

Q_DECLARE_METATYPE(
    vtkSmartPointer< vtkPolyData > 
)

Source code

#pragma once

#include <QObject>
#include <QWaitCondition>
#include <QMetaType>
#include <QRunnable>

#include "MeshWorkQueue.h"
#include "MeshCache.h"
#include "MeshGenerator.h"

Q_DECLARE_METATYPE(vtkSmartPointer<vtkPolyData>);

namespace shapeworks {

class MeshWorker : public QObject, public QRunnable {
Q_OBJECT

public:
  MeshWorker(MeshWorkQueue* queue, std::shared_ptr<MeshGenerator> generator);
  ~MeshWorker();

  void run();

Q_SIGNALS:
  void result_ready(const MeshWorkItem& item, MeshHandle mesh);
  void finished();

private:
  std::shared_ptr<MeshGenerator> mesh_generator_;
  MeshWorkQueue* queue_;
};
}

Updated on 2024-03-17 at 12:58:44 -0600