00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 // SMESH SMESHGUI : GUI for SMESH component 00024 // File : SMESHGUI_PatternWidget.h 00025 // Author : Michael ZORIN, Open CASCADE S.A.S. 00026 // 00027 #ifndef SMESHGUI_PATTERNWIDGET_H 00028 #define SMESHGUI_PATTERNWIDGET_H 00029 00030 // SMESH includes 00031 #include "SMESH_SMESHGUI.hxx" 00032 00033 // Qt includes 00034 #include <QFrame> 00035 #include <QVector> 00036 00037 // IDL includes 00038 #include <SALOMEconfig.h> 00039 #include CORBA_SERVER_HEADER(SMESH_Mesh) 00040 00041 typedef QVector<SMESH::PointStruct> PointVector; 00042 typedef QVector< QVector<int> > ConnectivityVector; 00043 00044 //================================================================================= 00045 // class : SMESHGUI_PatternWidget 00046 // purpose : 00047 //================================================================================= 00048 class SMESHGUI_EXPORT SMESHGUI_PatternWidget : public QFrame 00049 { 00050 Q_OBJECT 00051 00052 public: 00053 SMESHGUI_PatternWidget( QWidget* = 0 ); 00054 ~SMESHGUI_PatternWidget(); 00055 00056 void SetPoints( const PointVector&, 00057 const QVector<int>&, 00058 const ConnectivityVector& ); 00059 00060 private: 00061 PointVector myPoints; 00062 QVector<int> myKeys; 00063 ConnectivityVector myConnections; 00064 00065 double myMinU, myMaxU, myMinV, myMaxV; 00066 00067 protected: 00068 void paintEvent( QPaintEvent* ); 00069 00070 private: 00071 QPoint mapCoords( const double, const double ); 00072 }; 00073 00074 #endif // SMESHGUI_PATTERNWIDGET_H