------------------------------------------------------------------------------ Determines scale and position for the 2D Title. Currently, title can only be centered with respect to its axis. ------------------------------------------------------------------------------
| 893 | // title can only be centered with respect to its axis. |
| 894 | //------------------------------------------------------------------------------ |
| 895 | void vtkAxisActor::BuildTitle2D(vtkViewport* viewport, bool force) |
| 896 | { |
| 897 | if (!this->NeedBuild2D && !force && !this->TitleVisibility) |
| 898 | { |
| 899 | return; |
| 900 | } |
| 901 | |
| 902 | this->UpdateTitleActorProperty(); |
| 903 | |
| 904 | double scenePos[3]; |
| 905 | this->TitleProp->GetReferencePosition(scenePos); |
| 906 | |
| 907 | double position[2]; |
| 908 | this->Get2DPosition(viewport, 1., scenePos, position); |
| 909 | |
| 910 | if (this->SaveTitlePosition > 0) |
| 911 | { |
| 912 | if (this->SaveTitlePosition == 1) |
| 913 | { |
| 914 | this->TitleConstantPosition[0] = position[0]; |
| 915 | this->TitleConstantPosition[1] = position[1]; |
| 916 | this->SaveTitlePosition = 2; |
| 917 | } |
| 918 | position[0] = this->TitleConstantPosition[0]; |
| 919 | position[1] = this->TitleConstantPosition[1]; |
| 920 | } |
| 921 | |
| 922 | this->TitleProp->SetDisplayPosition(position[0], position[1]); |
| 923 | this->TitleProp->RotateActor2DFromAxisProjection(this->GetPoint1(), this->GetPoint2()); |
| 924 | } |
| 925 | |
| 926 | //------------------------------------------------------------------------------ |
| 927 | void vtkAxisActor::Get2DPosition( |
no test coverage detected