1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef VTKVIEWER_FRAMEDTEXTACTOR_H
21 #define VTKVIEWER_FRAMEDTEXTACTOR_H
23 #include "VTKViewer.h"
25 #include <vtkActor2D.h>
28 class vtkPolyDataMapper2D;
32 class vtkTextProperty;
36 class VTKVIEWER_EXPORT VTKViewer_FramedTextActor : public vtkActor2D
39 enum ModePosition { BelowPoint = 0, TopLeft, TopRight, BottomLeft, BottomRight };
40 enum LayoutType { Vertical = 0, Horizontal };
43 vtkTypeMacro(VTKViewer_FramedTextActor,vtkActor2D);
44 static VTKViewer_FramedTextActor *New();
46 virtual int RenderOpaqueGeometry(vtkViewport*);
47 virtual int RenderTranslucentGeometry(vtkViewport*) { return 0; }
48 virtual int RenderOverlay(vtkViewport*);
49 virtual void ReleaseGraphicsResources(vtkWindow*);
51 virtual void SetVisibility(int);
52 virtual int GetVisibility();
53 virtual void SetPickable(int);
54 virtual int GetPickable();
56 virtual void GetSize(vtkRenderer* theRenderer, int theSize[2]) const;
58 void SetText(const char* theText);
61 void SetModePosition(const int theMode);
62 int GetModePosition() const;
64 void SetLayoutType(const int theType);
65 int GetLayoutType() const;
67 void SetWorldPoint(const double theWorldPoint[4]);
68 const double* GetWorldPoint() const;
70 void SetDistance(const double theDistance);
71 double GetDistance() const;
73 void SetMoveFrameFlag(const int flag);
74 int GetMoveFrameFlag() const;
76 void SetForegroundColor(const double r,
79 void GetForegroundColor(double& r,
83 void SetBackgroundColor(const double r,
86 void GetBackgroundColor(double& r,
90 void SetTransparency(const double theTransparency);
91 double GetTransparency() const;
93 void SetTextMargin(const int theMargin);
94 int GetTextMargin() const;
96 void SetOffset(const int theOffset[2]);
99 VTKViewer_FramedTextActor();
100 ~VTKViewer_FramedTextActor();
104 vtkPolyDataMapper2D* myBarMapper;
105 vtkActor2D* myBarActor;
107 vtkTextProperty* myTextProperty;
108 vtkTextMapper* myTextMapper;
109 vtkActor2D* myTextActor;
111 vtkTimeStamp myBuildTime;
117 double myWorldPoint[4];
119 double myTransparency;
123 int myHorizontalOffset;
124 int myVerticalOffset;
127 VTKViewer_FramedTextActor(const VTKViewer_FramedTextActor&); // Not implemented.
128 void operator=(const VTKViewer_FramedTextActor&); // Not implemented.