Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef SALOME_ACTOR_H
00030 #define SALOME_ACTOR_H
00031
00032 #include "SVTK_SelectionEvent.h"
00033 #include "SVTK_Selector.h"
00034 #include "SVTK.h"
00035
00036 class Handle(SALOME_InteractiveObject);
00037
00038
00039
00040 #undef min
00041 #undef max
00042
00043 #include <VTKViewer_Actor.h>
00044 #include <VTKViewer_MarkerDef.h>
00045
00046 #include <vtkSmartPointer.h>
00047
00048 class vtkAbstractPicker;
00049 class vtkPointPicker;
00050 class vtkCellPicker;
00051 class vtkOutlineSource;
00052 class vtkInteractorStyle;
00053 class vtkRenderWindowInteractor;
00054
00055 class VTKViewer_FramedTextActor;
00056
00057 class SVTK_Actor;
00058 class SVTK_RectPicker;
00059 class SVTK_InteractorStyle;
00060
00061 SVTK_EXPORT extern int SALOME_POINT_SIZE;
00062 SVTK_EXPORT extern int SALOME_LINE_WIDTH;
00063
00064 #ifdef WIN32
00065 #pragma warning ( disable:4251 )
00066 #endif
00067
00069
00074 class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor
00075 {
00076 public:
00077 static SALOME_Actor* New();
00078
00079 vtkTypeMacro(SALOME_Actor,VTKViewer_Actor);
00080
00081
00083 virtual
00084 Standard_Boolean
00085 hasIO();
00086
00088 virtual
00089 const Handle(SALOME_InteractiveObject)&
00090 getIO();
00091
00093 virtual
00094 void
00095 setIO(const Handle(SALOME_InteractiveObject)& theIO);
00096
00098 virtual
00099 void
00100 setName(const char* theName);
00101
00102
00104 virtual
00105 void
00106 SetTransform(VTKViewer_Transform* theTransform);
00107
00109 virtual
00110 void
00111 SetPosition(vtkFloatingPointType _arg1,
00112 vtkFloatingPointType _arg2,
00113 vtkFloatingPointType _arg3);
00114
00116 virtual
00117 void
00118 SetPosition(vtkFloatingPointType _arg[3]);
00119
00120
00122 virtual
00123 void
00124 SetVisibility( int );
00125
00127 virtual
00128 bool
00129 ShouldBeDisplayed();
00130
00131
00133 virtual
00134 void
00135 AddToRender(vtkRenderer* theRendere);
00136
00138 virtual
00139 void
00140 RemoveFromRender(vtkRenderer* theRendere);
00141
00143 vtkRenderer*
00144 GetRenderer();
00145
00146
00148 virtual
00149 void
00150 SetInteractor(vtkRenderWindowInteractor* theInteractor);
00151
00153 virtual
00154 void
00155 Update();
00156
00157
00159 virtual
00160 void
00161 SetSelector(SVTK_Selector* theSelector);
00162
00164 virtual
00165 void
00166 highlight(bool theHighlight);
00167
00169 virtual
00170 void
00171 Highlight(bool theHighlight);
00172
00173
00175 virtual
00176 bool
00177 PreHighlight(vtkInteractorStyle* theInteractorStyle,
00178 SVTK_SelectionEvent* theSelectionEvent,
00179 bool theIsHighlight);
00180
00182 virtual
00183 bool
00184 Highlight(vtkInteractorStyle* theInteractorStyle,
00185 SVTK_SelectionEvent* theSelectionEvent,
00186 bool theIsHighlight);
00187
00188
00190 virtual
00191 bool
00192 IsDisplayNameActor() const;
00193
00195 virtual
00196 void
00197 SetIsDisplayNameActor(bool theIsDisplayNameActor);
00198
00200 virtual
00201 void
00202 SetNameActorText(const char* theText);
00203
00205 virtual
00206 void
00207 SetNameActorOffset(int theOffset[2]);
00208
00210 virtual
00211 void
00212 GetNameActorSize(vtkRenderer* theRenderer, int theSize[2]) const;
00213
00215 virtual
00216 void
00217 UpdateNameActors();
00218
00219
00221 virtual
00222 void
00223 SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
00224
00226 virtual
00227 void
00228 SetMarkerTexture( int, VTK::MarkerTexture );
00229
00231 virtual
00232 VTK::MarkerType
00233 GetMarkerType();
00234
00236 virtual
00237 VTK::MarkerScale
00238 GetMarkerScale();
00239
00241 virtual
00242 int
00243 GetMarkerTexture();
00244
00245
00247 void
00248 SetPointPicker(vtkPointPicker* thePointPicker);
00249
00251 void
00252 SetCellPicker(vtkCellPicker* theCellPicker);
00253
00255 void
00256 SetPointRectPicker(SVTK_RectPicker* theRectPicker);
00257
00259 void
00260 SetCellRectPicker(SVTK_RectPicker* theRectPicker);
00261
00262
00264 void
00265 SetPreHighlightProperty(vtkProperty* theProperty);
00266
00268 void
00269 SetHighlightProperty(vtkProperty* theProperty);
00270
00271 protected:
00272
00273 vtkRenderWindowInteractor* myInteractor;
00274 vtkRenderer* myRenderer;
00275
00276 Handle(SALOME_InteractiveObject) myIO;
00277
00278 SALOME_Actor();
00279 ~SALOME_Actor();
00280
00281 protected:
00282 Selection_Mode mySelectionMode;
00283 vtkSmartPointer<SVTK_Selector> mySelector;
00284
00285
00286
00287 vtkSmartPointer<vtkPointPicker> myPointPicker;
00288 vtkSmartPointer<vtkCellPicker> myCellPicker;
00289
00290 vtkSmartPointer<SVTK_RectPicker> myPointRectPicker;
00291 vtkSmartPointer<SVTK_RectPicker> myCellRectPicker;
00292
00293 vtkSmartPointer<SVTK_Actor> myPreHighlightActor;
00294 vtkSmartPointer<SVTK_Actor> myHighlightActor;
00295
00296 vtkSmartPointer<VTKViewer_Actor> myOutlineActor;
00297 vtkSmartPointer<vtkOutlineSource> myOutline;
00298
00299 bool myIsDisplayNameActor;
00300 vtkSmartPointer<VTKViewer_FramedTextActor> myNameActor;
00301 };
00302
00303 namespace SVTK
00304 {
00305 class SVTK_EXPORT TPickLimiter
00306 {
00307 vtkAbstractPicker* myPicker;
00308 public:
00309 TPickLimiter(vtkAbstractPicker*, SALOME_Actor*);
00310 ~TPickLimiter();
00311 };
00312 }
00313
00314 #ifdef WIN32
00315 #pragma warning ( default:4251 )
00316 #endif
00317
00318 #endif // SALOME_ACTOR_H