Fix AngleAnnotationActor & TextAnnotationActor highlight disable bug.
This commit is contained in:
@@ -110,6 +110,9 @@ void AngleAnnotationActor::BuildShape() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AngleAnnotationActor::Highlight(int highlightOn) {
|
void AngleAnnotationActor::Highlight(int highlightOn) {
|
||||||
|
bool temp = highlightOn > 0;
|
||||||
|
if (temp == this->Highlighted) return;
|
||||||
|
this->Highlighted = temp;
|
||||||
if (this->Highlighted) {
|
if (this->Highlighted) {
|
||||||
actor2D->GetProperty()->SetColor(1.0, 1.0, 0.0);
|
actor2D->GetProperty()->SetColor(1.0, 1.0, 0.0);
|
||||||
textProperty->SetColor(1.0, 1.0, 0.0);
|
textProperty->SetColor(1.0, 1.0, 0.0);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void TextAnnotationActor::ResetTextProp() {
|
|||||||
mTextProperty->SetFrame(false);
|
mTextProperty->SetFrame(false);
|
||||||
//textProperty->SetFrameColor(1.0, 0.0, 0.0);
|
//textProperty->SetFrameColor(1.0, 0.0, 0.0);
|
||||||
mTextProperty->SetBackgroundColor(1.0, 0.0, 0.0);
|
mTextProperty->SetBackgroundColor(1.0, 0.0, 0.0);
|
||||||
mTextProperty->SetBackgroundOpacity(0.3);
|
mTextProperty->SetBackgroundOpacity(0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextAnnotationActor::TextAnnotationActor() {
|
TextAnnotationActor::TextAnnotationActor() {
|
||||||
@@ -148,3 +148,15 @@ bool TextAnnotationActor::onMeasureLeftButtonUp(vtkRenderWindowInteractor *iren)
|
|||||||
mIren = iren;
|
mIren = iren;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TextAnnotationActor::RenderWithState() {
|
||||||
|
if (this->Highlighted) {
|
||||||
|
mTextProperty->SetBackgroundRGBA(1.0, 1.0, 0.0,0.2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this->Selected) {
|
||||||
|
mTextProperty->SetBackgroundRGBA(1.0, 0.0, 0.0,0.2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mTextProperty->SetBackgroundRGBA(1.0, 1.0, 0.0,0.0);
|
||||||
|
}
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ vtkTypeMacro(TextAnnotationActor, DraggableActor);
|
|||||||
SetWorldPosition2(pos[0], pos[1], pos[2]);
|
SetWorldPosition2(pos[0], pos[1], pos[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderWithState();
|
||||||
|
|
||||||
bool onMeasureLeftButtonDown(vtkRenderWindowInteractor *) override;
|
bool onMeasureLeftButtonDown(vtkRenderWindowInteractor *) override;
|
||||||
|
|
||||||
void onMeasureMouseMove(vtkRenderWindowInteractor *) override;
|
void onMeasureMouseMove(vtkRenderWindowInteractor *) override;
|
||||||
|
|||||||
Reference in New Issue
Block a user