X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlot2d%2FPlot2d_ViewFrame.h;h=dadf7cb6c634420db76f75d8c121b7043675b5aa;hb=5204b0c67ebf51714353b53f585ff7aafe70af30;hp=c8ea7bd2fa67a8c71763de29c9007718ff684481;hpb=034a705024b224972c148e1e3834c5ee38df184b;p=modules%2Fgui.git diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index c8ea7bd2f..dadf7cb6c 100755 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 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 @@ -39,6 +39,8 @@ #include #include #include +#include +#include #include #include @@ -74,6 +76,7 @@ public: virtual ~Plot2d_ViewFrame(); void Init(); + void SetPreference(); enum ObjectType { MainTitle, XTitle, YTitle, Y2Title, XAxis, YAxis, Y2Axis }; @@ -186,14 +189,20 @@ public: void showLegend( bool, bool = true ); void setLegendPos( int ); int getLegendPos() const; + void setLegendSymbolType( int ); + int getLegendSymbolType() const; void setLegendFont( const QFont& ); QFont getLegendFont() const; void setLegendFontColor( const QColor& ); QColor getLegendFontColor() const; + void setSelectedLegendFontColor( const QColor& ); + QColor getSelectedLegendFontColor() const; void setMarkerSize( const int, bool = true ); int getMarkerSize() const; virtual void setBackgroundColor( const QColor& ); QColor backgroundColor() const; + virtual void setSelectionColor( const QColor& ); + QColor selectionColor() const; void setXGrid( bool, const int, bool, const int, bool = true ); void setYGrid( bool, const int, bool, const int, bool, const int, bool, const int, bool = true ); @@ -232,8 +241,7 @@ public: void setEnableAxis( QwtPlot::Axis, bool ); virtual bool print( const QString&, const QString& ) const; - void printPlot( QPainter*, const QRect&, - const QwtPlotPrintFilter& = QwtPlotPrintFilter() ) const; + void printPlot( QPainter*, const QRectF& ) const; QString getVisualParameters(); void setVisualParameters( const QString& ); @@ -294,7 +302,7 @@ signals: void vpNormRModeChanged(); void vpCurveChanged(); void contextMenuRequested( QContextMenuEvent* ); - void legendClicked( QwtPlotItem* ); + void clicked (const QVariant&, int ); protected: Plot2d_Plot2d* myPlot; @@ -304,10 +312,13 @@ protected: int myCurveType; bool myShowLegend; int myLegendPos; + int myLegendSymbolType; QFont myLegendFont; QColor myLegendColor; + QColor mySelectedLegendFontColor; int myMarkerSize; QColor myBackground; + QColor mySelectionColor; QString myTitle, myXTitle, myYTitle, myY2Title; bool myTitleEnabled, myXTitleEnabled, myYTitleEnabled, myY2TitleEnabled; bool myXGridMajorEnabled, myYGridMajorEnabled, myY2GridMajorEnabled; @@ -343,26 +354,27 @@ public: Plot2d_Plot2d( QWidget* ); virtual ~Plot2d_Plot2d(); - void setLogScale( int, bool ); + void setLogScale( int, bool ); - void replot(); - QwtLegend* getLegend(); - QSize sizeHint() const; - QSize minimumSizeHint() const; - void defaultPicker(); - void setPickerMousePattern( int, int = Qt::NoButton ); - void setPicker( Plot2d_QwtPlotPicker *picker); + void replot(); + QwtAbstractLegend* getLegend(); + QSize sizeHint() const; + QSize minimumSizeHint() const; + void defaultPicker(); + void setPickerMousePattern( int, int = Qt::NoButton ); + void setPicker( Plot2d_QwtPlotPicker *picker); Plot2d_QwtPlotPicker* getPicker() { return myPicker; } Plot2d_AxisScaleDraw* getScaleDraw() { return myScaleDraw; } QList getSeparationLineList() { return mySeparationLineList; } void clearSeparationLineList(); - QwtPlotMarker *createMarkerAndTooltip( QwtSymbol symbol, - double X, - double Y, - QString & tooltip, - Plot2d_QwtPlotPicker *picker); + void setLegendSymbolType( const int ); + int getLegendSymbolType(); + QwtPlotMarker *createMarkerAndTooltip( QwtSymbol* symbol, + double X, + double Y, + QString & tooltip, + Plot2d_QwtPlotPicker *picker); - bool polished() const; QwtPlotGrid* grid() const; QwtPlotZoomer* zoomer() const; @@ -380,17 +392,9 @@ public: void createSeparationLine( double Xpos); - -public slots: - virtual void polish(); - -protected slots: - void onScaleDivChanged(); - protected: QwtPlotGrid* myGrid; QList myColors; - bool myIsPolished; QwtPlotZoomer* myPlotZoomer; Plot2d_AxisScaleDraw* myScaleDraw; // The point picker associated with the graphic view @@ -398,13 +402,13 @@ protected: private: // List of verticals segments between two curves QList mySeparationLineList; + int myLegendSymbolType; }; class Plot2d_ScaleDraw: public QwtScaleDraw { public: Plot2d_ScaleDraw( char f = 'g', int prec = 6 ); - Plot2d_ScaleDraw( const QwtScaleDraw& scaleDraw, char f = 'g', int prec = 6 ); virtual QwtText label( double value ) const; @@ -450,6 +454,8 @@ public: void applyTicks(); + double extent( const QFont &font ) const; + protected: void drawLabel( QPainter* painter, double value) const; @@ -486,7 +492,6 @@ public: Plot2d_QwtPlotPicker( int xAxis, int yAxis, - int selectionFlags, RubberBand rubberBand, DisplayMode trackerMode, QwtPlotCanvas *canvas); @@ -502,7 +507,7 @@ public: protected: - virtual QwtText trackerText( const QwtDoublePoint & pos ) const; + virtual QwtText trackerText( const QPoint & pos ) const; };