1 // Copyright (C) 2007-2016 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;
37 class VTKVIEWER_EXPORT VTKViewer_FramedTextActor : public vtkActor2D
40 enum ModePosition { BelowPoint = 0, TopLeft, TopRight, BottomLeft, BottomRight };
41 enum LayoutType { Vertical = 0, Horizontal };
44 vtkTypeMacro(VTKViewer_FramedTextActor,vtkActor2D);
45 static VTKViewer_FramedTextActor *New();
47 virtual int RenderOpaqueGeometry(vtkViewport*);
48 virtual int RenderTranslucentGeometry(vtkViewport*) { return 0; }
49 virtual int RenderOverlay(vtkViewport*);
50 virtual void ReleaseGraphicsResources(vtkWindow*);
52 virtual void SetVisibility(int);
53 virtual int GetVisibility();
54 virtual void SetPickable(int);
55 virtual int GetPickable();
57 virtual void GetSize(vtkRenderer* vport, double theSize[2]) const;
59 void SetText(const char* theText);
62 void SetModePosition(const int theMode);
63 int GetModePosition() const;
65 void SetLayoutType(const int theType);
66 int GetLayoutType() const;
68 void SetWorldPoint(const double theWorldPoint[4]);
69 const double* GetWorldPoint() const;
71 void SetDistance(const double theDistance);
72 double GetDistance() const;
74 void SetMoveFrameFlag(const int flag);
75 int GetMoveFrameFlag() const;
77 void SetForegroundColor(const double r,
80 void GetForegroundColor(double& r,
84 void SetBackgroundColor(const double r,
87 void GetBackgroundColor(double& r,
91 void SetTransparency(const double theTransparency);
92 double GetTransparency() const;
94 void SetTextMargin(const int theMargin);
95 int GetTextMargin() const;
97 void SetOffset(const double theOffset[2]);
100 VTKViewer_FramedTextActor();
101 ~VTKViewer_FramedTextActor();
105 vtkPolyDataMapper2D* myBarMapper;
106 vtkActor2D* myBarActor;
108 vtkTextProperty* myTextProperty;
109 vtkTextActor* 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.