37 lines
1.3 KiB
C++
37 lines
1.3 KiB
C++
//
|
|
// Created by Krad on 2022/8/26.
|
|
//
|
|
|
|
#include "MarginCornerAnnotation.h"
|
|
|
|
#include <vtkObjectFactory.h>
|
|
|
|
vtkStandardNewMacro(MarginCornerAnnotation);
|
|
|
|
MarginCornerAnnotation::MarginCornerAnnotation():vtkCornerAnnotation() {
|
|
|
|
}
|
|
|
|
MarginCornerAnnotation::~MarginCornerAnnotation() {
|
|
|
|
}
|
|
|
|
void MarginCornerAnnotation::SetTextActorsPosition(const int *vsize) {
|
|
this->TextActor[LowerLeft]->SetPosition ( margins[0], margins[3] );
|
|
this->TextActor[LowerRight]->SetPosition ( vsize[0] - margins[3], margins[2] );
|
|
this->TextActor[UpperLeft]->SetPosition ( margins[1], vsize[1] - margins[0] );
|
|
this->TextActor[UpperRight]->SetPosition ( vsize[0] - margins[2], vsize[1] - margins[1] );
|
|
|
|
this->TextActor[LowerEdge]->SetPosition ( vsize[0]/2, margins[3] );
|
|
this->TextActor[UpperEdge]->SetPosition ( vsize[0]/2, vsize[1] - margins[1] );
|
|
this->TextActor[LeftEdge]->SetPosition ( margins[0], vsize[1]/2 );
|
|
this->TextActor[RightEdge]->SetPosition ( vsize[0] - margins[2], vsize[1]/2 );
|
|
}
|
|
|
|
void MarginCornerAnnotation::SetMargin(int left, int top, int right, int bottom) {
|
|
margins[0]= left;
|
|
margins[1]= top;
|
|
margins[2]= right;
|
|
margins[3]= bottom;
|
|
}
|