Commit b69d27ed authored by Dave DeMarle's avatar Dave DeMarle

Merge branch 'add-cornerannotation-enum' into release

Change-Id: I647a0af5d3d76fa78d73ca7409dca7a1731c535b
parents 70bad0eb 84553179
......@@ -54,10 +54,10 @@ int TestCornerAnnotation( int argc, char * argv [] )
cornerAnnotation->SetLinearFontScaleFactor( 2 );
cornerAnnotation->SetNonlinearFontScaleFactor( 1 );
cornerAnnotation->SetMaximumFontSize( 20 );
cornerAnnotation->SetText( 0, "lower left" );
cornerAnnotation->SetText( 1, "lower right" );
cornerAnnotation->SetText( 2, "upper left" );
cornerAnnotation->SetText( 3, "upper right" );
cornerAnnotation->SetText( vtkCornerAnnotation::LowerLeft, "lower left" );
cornerAnnotation->SetText( vtkCornerAnnotation::LowerRight, "lower right" );
cornerAnnotation->SetText( vtkCornerAnnotation::UpperLeft, "upper left" );
cornerAnnotation->SetText( vtkCornerAnnotation::UpperRight, "upper right" );
cornerAnnotation->GetTextProperty()->SetColor( 1,0,0);
renderer->AddViewProp(cornerAnnotation);
......
......@@ -628,10 +628,10 @@ int vtkCornerAnnotation::HasTranslucentPolygonalGeometry()
//----------------------------------------------------------------------------
void vtkCornerAnnotation::SetTextActorsPosition(int vsize[2])
{
this->TextActor[0]->SetPosition(5, 5);
this->TextActor[1]->SetPosition(vsize[0] - 5, 5);
this->TextActor[2]->SetPosition(5, vsize[1] - 5);
this->TextActor[3]->SetPosition(vsize[0] - 5, vsize[1] - 5);
this->TextActor[LowerLeft]->SetPosition(5, 5);
this->TextActor[LowerRight]->SetPosition(vsize[0] - 5, 5);
this->TextActor[UpperLeft]->SetPosition(5, vsize[1] - 5);
this->TextActor[UpperRight]->SetPosition(vsize[0] - 5, vsize[1] - 5);
}
//----------------------------------------------------------------------------
......
......@@ -96,8 +96,20 @@ public:
// resources to release.
virtual void ReleaseGraphicsResources(vtkWindow *);
// Description:
// Position used to get or set the corner annotation text.
// \sa GetText(), SetText()
enum TextPosition
{
LowerLeft = 0, ///< Uses the lower left corner.
LowerRight, ///< Uses the lower right corner.
UpperLeft, ///< Uses the upper left corner.
UpperRight ///< Uses the upper right corner.
};
// Description:
// Set/Get the text to be displayed for each corner
// \sa TextPosition
void SetText(int i, const char *text);
const char* GetText(int i);
void ClearAllTexts();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment