Add VolRulerAnnotationActor.

This commit is contained in:
Krad
2022-11-25 10:46:30 +08:00
parent 7065c76bc5
commit 18d54e39c7
4 changed files with 65 additions and 2 deletions

View File

@@ -75,4 +75,8 @@ void RulerAnnotationActor::selfCalibCb(vtkObject *, unsigned long, void *data) {
calibrationWidget *w = new calibrationWidget(this, interactor); calibrationWidget *w = new calibrationWidget(this, interactor);
w->exec(); w->exec();
delete w; delete w;
} }
vtkProp *RulerAnnotationActor::GetProp() {
return this;
}

View File

@@ -14,12 +14,14 @@ class RulerAnnotationActor : public LineAnnotationActor {
public: public:
static RulerAnnotationActor *New(); static RulerAnnotationActor *New();
vtkTypeMacro(RulerAnnotationActor, LineAnnotationActor); vtkTypeMacro(RulerAnnotationActor, LineAnnotationActor);
void BuildShape() override; void BuildShape() override;
NextMeasureMacro(RulerAnnotationActor); NextMeasureMacro(RulerAnnotationActor);
vtkProp* GetProp() ;
void setCalibration(double s) { void setCalibration(double s) {
isCalibration = true; isCalibration = true;
calibDistance = s; calibDistance = s;

View File

@@ -0,0 +1,23 @@
//
// Created by Krad on 2022/11/23.
//
#include "VolRulerAnnotationActor.h"
#include <vtkObjectFactory.h>
#include <vtkPoints.h>
#include "Rendering/Core/ControlPointActor.h"
vtkStandardNewMacro(VolRulerAnnotationActor)
VolRulerAnnotationActor::VolRulerAnnotationActor() {
MapMode = MapToWorld;
controlP1->SetMapMode(MapToWorld);
controlP2->SetMapMode(MapToWorld);
}
VolRulerAnnotationActor::~VolRulerAnnotationActor() {
}

View File

@@ -0,0 +1,34 @@
//
// Created by Krad on 2022/11/23.
//
#ifndef OMEGAV_VOLRULERANNOTATIONACTOR_H
#define OMEGAV_VOLRULERANNOTATIONACTOR_H
#include "RulerAnnotationActor.h"
class VolRulerAnnotationActor:public RulerAnnotationActor {
public:
//@{
/**
* Standard methods for instances of this class.
*/
static VolRulerAnnotationActor *New();
vtkTypeMacro(VolRulerAnnotationActor, RulerAnnotationActor);
protected:
VolRulerAnnotationActor();
~VolRulerAnnotationActor() override;
public:
private:
VolRulerAnnotationActor(const VolRulerAnnotationActor&) = delete;
void operator=(const VolRulerAnnotationActor&) = delete;
};
#endif //OMEGAV_VOLRULERANNOTATIONACTOR_H