Back to index

salome-gui  6.5.0
VTKViewer_MarkerWidget.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef VTKVIEWER_MARKERWIDGET_H
00021 #define VTKVIEWER_MARKERWIDGET_H
00022 
00023 #include "VTKViewer.h"
00024 #include "VTKViewer_MarkerDef.h"
00025 
00026 #include <QWidget>
00027 
00028 class QButtonGroup;
00029 class QStackedWidget;
00030 
00031 class QtxComboBox;
00032 
00037 class VTKVIEWER_EXPORT VTKViewer_MarkerWidget : public QWidget
00038 {
00039   Q_OBJECT
00040 
00041 public:
00042   VTKViewer_MarkerWidget( QWidget* );
00043   virtual ~VTKViewer_MarkerWidget();
00044 
00045   void             setCustomMarkerMap( VTK::MarkerMap );
00046   VTK::MarkerMap   getCustomMarkerMap();
00047 
00048   void             setStandardMarker( VTK::MarkerType, VTK::MarkerScale );
00049   void             setCustomMarker( int );
00050   VTK::MarkerType  getMarkerType() const;
00051   VTK::MarkerScale getStandardMarkerScale() const;
00052   int              getCustomMarkerID() const;
00053 
00054   void             addExtraStdMarker( VTK::MarkerType, const QPixmap& );
00055 
00056 private:
00057   void             init();
00058   void             addTexture( int, bool = false );
00059   QPixmap          markerFromData( const VTK::MarkerData& );
00060 
00061 private slots:
00062   void             onStdMarkerChanged( int );
00063   void             onBrowse();
00064 
00065 private:
00066   QButtonGroup*    myTypeGroup;
00067   QStackedWidget*  myWGStack;
00068   QtxComboBox*     myStdTypeCombo;
00069   QtxComboBox*     myStdScaleCombo;
00070   QtxComboBox*     myCustomTypeCombo;
00071 
00072   VTK::MarkerMap   myCustomMarkerMap;
00073 
00074   QList<VTK::MarkerType> myExtraMarkerList;
00075 };
00076 
00077 #endif