[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [labplot/histogram_chart] src: added new files: HistogramPriavte.h and histogramdockgeneraltab.ui
From: Anu Mittal <anu22mittal () gmail ! com>
Date: 2016-06-18 10:22:41
Message-ID: E1bEDOj-0007SQ-1H () code ! kde ! org
[Download RAW message or body]
Git commit 9c3abae2295d5400a7b0aa41f6d0f519d9348dd1 by Anu Mittal.
Committed on 18/06/2016 at 10:22.
Pushed by anumittal into branch 'histogram_chart'.
added new files: HistogramPriavte.h and histogramdockgeneraltab.ui
A +163 -0 src/backend/worksheet/plots/cartesian/HistogramPrivate.h [License: \
GPL (v2+)] A +104 -0 src/kdefrontend/ui/dockwidgets/histogramdockgeneraltab.ui
http://commits.kde.org/labplot/9c3abae2295d5400a7b0aa41f6d0f519d9348dd1
diff --git a/src/backend/worksheet/plots/cartesian/HistogramPrivate.h \
b/src/backend/worksheet/plots/cartesian/HistogramPrivate.h new file mode 100644
index 0000000..baed831
--- /dev/null
+++ b/src/backend/worksheet/plots/cartesian/HistogramPrivate.h
@@ -0,0 +1,163 @@
+/***************************************************************************
+ File : HistogramPrivate.h
+ Project : LabPlot
+ Description : Private members of Histogram
+ --------------------------------------------------------------------
+ Copyright : (C) 2010-2015 Alexander Semke (alexander.semke@web.de)
+ Copyright : (C) 2013 by Stefan Gerlach (stefan.gerlach@uni-konstanz.de)
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program 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 General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
+ * Boston, MA 02110-1301 USA *
+ * *
+ ***************************************************************************/
+
+#ifndef HISTOGRAMPRIVATE_H
+#define HISTOGRAMPRIVATE_H
+
+#include <vector>
+
+class HistogramPrivate: public QGraphicsItem {
+ public:
+ explicit HistogramPrivate(Histogram *owner);
+
+ QString name() const;
+ virtual QRectF boundingRect() const;
+ QPainterPath shape() const;
+
+ bool m_printing;
+ bool m_hovered;
+ bool m_suppressRecalc;
+ bool m_suppressRetransform;
+ QPixmap m_pixmap;
+ QImage m_hoverEffectImage;
+ QImage m_selectionEffectImage;
+ bool m_hoverEffectImageIsDirty;
+ bool m_selectionEffectImageIsDirty;
+
+ void retransform();
+ void updateLines();
+ void updateDropLines();
+ void updateSymbols();
+ void updateValues();
+ void updateFilling();
+ void updateErrorBars();
+ bool swapVisible(bool on);
+ void recalcShapeAndBoundingRect();
+ void drawSymbols(QPainter*);
+ void drawValues(QPainter*);
+ void drawFilling(QPainter*);
+ void draw(QPainter*);
+ void updatePixmap();
+
+ virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget* widget = \
0); +
+ //data columns
+ const AbstractColumn* xColumn;
+ const AbstractColumn* yColumn;
+ QString xColumnPath;
+ QString yColumnPath;
+
+ //line
+ Histogram::LineType lineType;
+ bool lineSkipGaps;
+ int lineInterpolationPointsCount;
+ QPen linePen;
+ qreal lineOpacity;
+
+ //drop lines
+ Histogram::DropLineType dropLineType;
+ QPen dropLinePen;
+ qreal dropLineOpacity;
+
+ //symbols
+ Symbol::Style symbolsStyle;
+ QBrush symbolsBrush;
+ QPen symbolsPen;
+ qreal symbolsOpacity;
+ qreal symbolsRotationAngle;
+ qreal symbolsSize;
+
+ //values
+ Histogram::ValuesType valuesType;
+ const AbstractColumn* valuesColumn;
+ QString valuesColumnPath;
+ Histogram::ValuesPosition valuesPosition;
+ qreal valuesDistance;
+ qreal valuesRotationAngle;
+ qreal valuesOpacity;
+ QString valuesPrefix;
+ QString valuesSuffix;
+ QFont valuesFont;
+ QColor valuesColor;
+
+ //filling
+ Histogram::FillingPosition fillingPosition;
+ PlotArea::BackgroundType fillingType;
+ PlotArea::BackgroundColorStyle fillingColorStyle;
+ PlotArea::BackgroundImageStyle fillingImageStyle;
+ Qt::BrushStyle fillingBrushStyle;
+ QColor fillingFirstColor;
+ QColor fillingSecondColor;
+ QString fillingFileName;
+ qreal fillingOpacity;
+
+ //error bars
+ Histogram::ErrorType xErrorType;
+ const AbstractColumn* xErrorPlusColumn;
+ QString xErrorPlusColumnPath;
+ const AbstractColumn* xErrorMinusColumn;
+ QString xErrorMinusColumnPath;
+
+ Histogram::ErrorType yErrorType;
+ const AbstractColumn* yErrorPlusColumn;
+ QString yErrorPlusColumnPath;
+ const AbstractColumn* yErrorMinusColumn;
+ QString yErrorMinusColumnPath;
+
+ Histogram::ErrorBarsType errorBarsType;
+ double errorBarsCapSize;
+ QPen errorBarsPen;
+ qreal errorBarsOpacity;
+
+ QPainterPath linePath;
+ QPainterPath dropLinePath;
+ QPainterPath valuesPath;
+ QPainterPath errorBarsPath;
+ QPainterPath symbolsPath;
+ QRectF boundingRectangle;
+ QPainterPath curveShape;
+ QList<QLineF> lines;
+ QList<QPointF> symbolPointsLogical; //points in logical coordinates
+ QList<QPointF> symbolPointsScene; //points in scene coordinates
+ std::vector<bool> visiblePoints; //vector of the size of symbolPointsLogical with \
true of false for the points currently visible or not in the plot + QList<QPointF> \
valuesPoints; + std::vector<bool> connectedPointsLogical; //vector of the size of \
symbolPointsLogical with true for points connected with the consecutive point and \
+ //false otherwise (don't connect because of a gap (NAN) \
in-between) + QList<QString> valuesStrings;
+ QList<QPolygonF> fillPolygons;
+
+ Histogram* const q;
+
+ private:
+ void contextMenuEvent(QGraphicsSceneContextMenuEvent*);
+ virtual void hoverEnterEvent(QGraphicsSceneHoverEvent*);
+ virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent*);
+ QImage blurred(const QImage& image, const QRect& rect, int radius, bool \
alphaOnly); +};
+
+#endif
diff --git a/src/kdefrontend/ui/dockwidgets/histogramdockgeneraltab.ui \
b/src/kdefrontend/ui/dockwidgets/histogramdockgeneraltab.ui new file mode 100644
index 0000000..5ad0143
--- /dev/null
+++ b/src/kdefrontend/ui/dockwidgets/histogramdockgeneraltab.ui
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>HistogramDockGeneralTab</class>
+ <widget class="QWidget" name="HistogramDockGeneralTab">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>367</width>
+ <height>165</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="lName">
+ <property name="text">
+ <string>Name</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>10</width>
+ <height>23</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="2">
+ <widget class="KLineEdit" name="leName"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="lComment">
+ <property name="text">
+ <string>Comment</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="KLineEdit" name="leComment"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="lXColumn">
+ <property name="text">
+ <string>x-data</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="lYColumn">
+ <property name="text">
+ <string>y-data</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <spacer name="verticalSpacerGeneral">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>24</width>
+ <height>18</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="5" column="0">
+ <widget class="QCheckBox" name="chkVisible">
+ <property name="text">
+ <string>visible</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>KLineEdit</class>
+ <extends>QLineEdit</extends>
+ <header>klineedit.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic