-// SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
+// SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
// File : SALOME_Actor.h
// Author : Nicolas REJNERI
-// Module : SALOME
-// $Header$
#ifndef SALOME_ACTOR_H
#define SALOME_ACTOR_H
#include "SVTK_Selector.h"
#include "SVTK.h"
-#include "SALOME_InteractiveObject.hxx"
+class Handle(SALOME_InteractiveObject);
// undefining min and max because CASCADE's defines them and
// it clashes with std::min(), std::max()
#undef min
#undef max
-#include "VTKViewer_Actor.h"
+#include <VTKViewer_Actor.h>
+#include <VTKViewer_MarkerDef.h>
#include <vtkSmartPointer.h>
+class vtkAbstractPicker;
class vtkPointPicker;
class vtkCellPicker;
class vtkOutlineSource;
class vtkInteractorStyle;
class vtkRenderWindowInteractor;
+class VTKViewer_FramedTextActor;
+
class SVTK_Actor;
-class SVTK_RectPicker;
+class SVTK_AreaPicker;
class SVTK_InteractorStyle;
-extern int SALOME_POINT_SIZE;
-extern int SALOME_LINE_WIDTH;
+SVTK_EXPORT extern int SALOME_POINT_SIZE;
+SVTK_EXPORT extern int SALOME_LINE_WIDTH;
+
+#ifdef WIN32
+#pragma warning ( disable:4251 )
+#endif
//! The class is a basic one for all SALOME VTK presentation.
/*!
//! Apply additional position
virtual
void
- SetPosition(float _arg1, float _arg2, float _arg3);
+ SetPosition(double _arg1,
+ double _arg2,
+ double _arg3);
//! Apply additional position
virtual
void
- SetPosition(float _arg[3]);
+ SetPosition(double _arg[3]);
//----------------------------------------------------------------------------
//! Visibility management
void
SetVisibility( int );
+ //! Gets know whether the actor should be displayed or not
+ virtual
+ bool
+ ShouldBeDisplayed();
+
//----------------------------------------------------------------------------
//! To publish the actor an all its internal devices
virtual
virtual
bool
PreHighlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
//! To process highlight (called from #SVTK_InteractorStyle)
virtual
bool
Highlight(vtkInteractorStyle* theInteractorStyle,
- SVTK_SelectionEvent* theSelectionEvent,
- bool theIsHighlight);
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
+
+ //----------------------------------------------------------------------------
+ //! To get flag of displaying of name actor
+ virtual
+ bool
+ IsDisplayNameActor() const;
+
+ //! To set flag of displaying of name actor
+ virtual
+ void
+ SetIsDisplayNameActor(bool theIsDisplayNameActor);
+
+ //! To set text of name actor
+ virtual
+ void
+ SetNameActorText(const char* theText);
+
+ //! To set offset of name actor
+ virtual
+ void
+ SetNameActorOffset(int theOffset[2]);
+
+ //! To get size of name actor
+ virtual
+ void
+ GetNameActorSize(vtkRenderer* theRenderer, int theSize[2]) const;
+
+ //! To update visibility of name actors
+ virtual
+ void
+ UpdateNameActors();
+
+ //----------------------------------------------------------------------------
+ //! Set standard point marker
+ virtual
+ void
+ SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
+
+ //! Set custom point marker
+ virtual
+ void
+ SetMarkerTexture( int, VTK::MarkerTexture );
+
+ //! Get type of the point marker
+ virtual
+ VTK::MarkerType
+ GetMarkerType();
+
+ //! Get scale of the point marker
+ virtual
+ VTK::MarkerScale
+ GetMarkerScale();
+
+ //! Get texture identifier of the point marker
+ virtual
+ int
+ GetMarkerTexture();
//----------------------------------------------------------------------------
//! To set up a picker for nodal selection (initialized by #SVTK_Renderer::AddActor)
//! To set up a picker for point rectangle selection (initialized by #SVTK_Renderer::AddActor)
void
- SetPointRectPicker(SVTK_RectPicker* theRectPicker);
+ SetPointAreaPicker(SVTK_AreaPicker* theAreaPicker);
//! To set up a picker for cell rectangle selection (initialized by #SVTK_Renderer::AddActor)
void
- SetCellRectPicker(SVTK_RectPicker* theRectPicker);
+ SetCellAreaPicker(SVTK_AreaPicker* theAreaPicker);
+
+ //----------------------------------------------------------------------------
+ //! To find a gravity center of object
+ double* GetGravityCenter( int );
//----------------------------------------------------------------------------
//! To set up a prehighlight property (initialized by #SVTK_Renderer::AddActor)
vtkSmartPointer<vtkPointPicker> myPointPicker;
vtkSmartPointer<vtkCellPicker> myCellPicker;
- vtkSmartPointer<SVTK_RectPicker> myPointRectPicker;
- vtkSmartPointer<SVTK_RectPicker> myCellRectPicker;
+ vtkSmartPointer<SVTK_AreaPicker> myPointAreaPicker;
+ vtkSmartPointer<SVTK_AreaPicker> myCellAreaPicker;
vtkSmartPointer<SVTK_Actor> myPreHighlightActor;
vtkSmartPointer<SVTK_Actor> myHighlightActor;
vtkSmartPointer<VTKViewer_Actor> myOutlineActor;
vtkSmartPointer<vtkOutlineSource> myOutline;
+
+ bool myIsDisplayNameActor;
+ vtkSmartPointer<VTKViewer_FramedTextActor> myNameActor;
};
+namespace SVTK
+{
+ class SVTK_EXPORT TPickLimiter
+ {
+ vtkAbstractPicker* myPicker;
+ public:
+ TPickLimiter(vtkAbstractPicker*, SALOME_Actor*);
+ ~TPickLimiter();
+ };
+}
+
+#ifdef WIN32
+#pragma warning ( default:4251 )
+#endif
+
#endif // SALOME_ACTOR_H