Version: 9.16.0
VTKViewer_FramedTextActor.h
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
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.
7//
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.
12//
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
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef VTKVIEWER_FRAMEDTEXTACTOR_H
21#define VTKVIEWER_FRAMEDTEXTACTOR_H
22
23#include "VTKViewer.h"
24
25#include <vtkActor2D.h>
26
27class vtkPolyData;
28class vtkPolyDataMapper2D;
29class vtkRenderer;
30class vtkTimeStamp;
31class vtkTextMapper;
32class vtkTextProperty;
33class vtkViewport;
34class vtkWindow;
35class vtkTextActor;
36
38{
39public:
40 enum ModePosition { BelowPoint = 0, TopLeft, TopRight, BottomLeft, BottomRight };
42
43public:
45 static VTKViewer_FramedTextActor *New();
46
47 virtual int RenderOpaqueGeometry(vtkViewport*);
48 virtual int RenderTranslucentGeometry(vtkViewport*) { return 0; }
49 virtual int RenderOverlay(vtkViewport*);
50 virtual void ReleaseGraphicsResources(vtkWindow*);
51
52 virtual void SetVisibility(int);
53 virtual int GetVisibility();
54 virtual void SetPickable(int);
55 virtual int GetPickable();
56
57 virtual void GetSize(vtkRenderer* vport, double theSize[2]) const;
58
59 void SetText(const char* theText);
60 char* GetText();
61
62 void SetModePosition(const int theMode);
63 int GetModePosition() const;
64
65 void SetLayoutType(const int theType);
66 int GetLayoutType() const;
67
68 void SetWorldPoint(const double theWorldPoint[4]);
69 const double* GetWorldPoint() const;
70
71 void SetDistance(const double theDistance);
72 double GetDistance() const;
73
74 void SetMoveFrameFlag(const int flag);
75 int GetMoveFrameFlag() const;
76
77 void SetForegroundColor(const double r,
78 const double g,
79 const double b);
80 void GetForegroundColor(double& r,
81 double& g,
82 double& b);
83
84 void SetBackgroundColor(const double r,
85 const double g,
86 const double b);
87 void GetBackgroundColor(double& r,
88 double& g,
89 double& b);
90
91 void SetTransparency(const double theTransparency);
92 double GetTransparency() const;
93
94 void SetTextMargin(const int theMargin);
95 int GetTextMargin() const;
96
97 void SetOffset(const double theOffset[2]);
98
99protected:
102
103protected:
104 vtkPolyData* myBar;
105 vtkPolyDataMapper2D* myBarMapper;
107
108 vtkTextProperty* myTextProperty;
110
111 vtkTimeStamp myBuildTime;
112
116
117 double myWorldPoint[4];
120
122
125
126private:
128 void operator=(const VTKViewer_FramedTextActor&); // Not implemented.
129};
130
131#endif
@ Vertical
Vertical orientation.
Definition: SalomePyQt.h:149
@ Horizontal
Horizontal orientation.
Definition: SalomePyQt.h:148
#define VTKVIEWER_EXPORT
Definition: VTKViewer.h:33
vtkTextActor
Definition: VTKViewer_Trihedron.cxx:110
Definition: VTKViewer_FramedTextActor.h:38
int myMoveFrameFlag
Definition: VTKViewer_FramedTextActor.h:115
int myLayoutType
Definition: VTKViewer_FramedTextActor.h:114
int myTextMargin
Definition: VTKViewer_FramedTextActor.h:121
virtual int RenderTranslucentGeometry(vtkViewport *)
Definition: VTKViewer_FramedTextActor.h:48
vtkPolyData * myBar
Definition: VTKViewer_FramedTextActor.h:104
double myTransparency
Definition: VTKViewer_FramedTextActor.h:119
void operator=(const VTKViewer_FramedTextActor &)
vtkActor2D * myBarActor
Definition: VTKViewer_FramedTextActor.h:106
int myHorizontalOffset
Definition: VTKViewer_FramedTextActor.h:123
LayoutType
Definition: VTKViewer_FramedTextActor.h:41
double myDistance
Definition: VTKViewer_FramedTextActor.h:118
vtkTypeMacro(VTKViewer_FramedTextActor, vtkActor2D) static VTKViewer_FramedTextActor *New()
vtkTextActor * myTextActor
Definition: VTKViewer_FramedTextActor.h:109
vtkPolyDataMapper2D * myBarMapper
Definition: VTKViewer_FramedTextActor.h:105
int myModePosition
Definition: VTKViewer_FramedTextActor.h:113
int myVerticalOffset
Definition: VTKViewer_FramedTextActor.h:124
vtkTextProperty * myTextProperty
Definition: VTKViewer_FramedTextActor.h:108
ModePosition
Definition: VTKViewer_FramedTextActor.h:40
VTKViewer_FramedTextActor(const VTKViewer_FramedTextActor &)
vtkTimeStamp myBuildTime
Definition: VTKViewer_FramedTextActor.h:111