File indexing completed on 2024-12-15 04:02:28

0001 /*
0002  * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
0003  *
0004  * This file is part of the KD Chart library.
0005  *
0006  * SPDX-License-Identifier: GPL-2.0-or-later
0007  */
0008 
0009 #ifndef KCHARTABSTRACTCARTESIANDIAGRAM_P_H
0010 #define KCHARTABSTRACTCARTESIANDIAGRAM_P_H
0011 
0012 //
0013 //  W A R N I N G
0014 //  -------------
0015 //
0016 // This file is not part of the KD Chart API.  It exists purely as an
0017 // implementation detail.  This header file may change from version to
0018 // version without notice, or even be removed.
0019 //
0020 // We mean it.
0021 //
0022 
0023 #include "KChartAbstractCartesianDiagram.h"
0024 
0025 #include <KChartAbstractDiagram_p.h>
0026 #include <KChartAbstractThreeDAttributes.h>
0027 #include <KChartGridAttributes.h>
0028 #include "KChartMath_p.h"
0029 
0030 
0031 namespace KChart {
0032 
0033   class CartesianCoordinatePlane;
0034   class AbstractCartesianDiagram;
0035 
0036 /**
0037  * \internal
0038  */
0039 class Q_DECL_HIDDEN AbstractCartesianDiagram::Private : public AbstractDiagram::Private
0040 {
0041     friend class AbstractCartesianDiagram;
0042 public:
0043     Private();
0044     ~Private() override;
0045 
0046     Private( const Private& rhs ) :
0047         AbstractDiagram::Private( rhs ),
0048         // Do not copy axes and reference diagrams.
0049         axesList(),
0050         referenceDiagram( nullptr ),
0051         referenceDiagramOffset()
0052         {
0053         }
0054 
0055     /** \reimpl */
0056     CartesianDiagramDataCompressor::AggregatedDataValueAttributes aggregatedAttrs(
0057             const QModelIndex & index,
0058             const CartesianDiagramDataCompressor::CachePosition * position ) const override
0059     {
0060         if ( position )
0061             return compressor.aggregatedAttrs( diagram, index, *position );
0062         CartesianDiagramDataCompressor::AggregatedDataValueAttributes allAttrs;
0063         allAttrs[index] = diagram->dataValueAttributes( index );
0064         return allAttrs;
0065     }
0066 
0067    CartesianAxisList axesList;
0068 
0069    AbstractCartesianDiagram* referenceDiagram;
0070    QPointF referenceDiagramOffset;
0071 
0072    mutable CartesianDiagramDataCompressor compressor;
0073 };
0074 
0075 KCHART_IMPL_DERIVED_DIAGRAM( AbstractCartesianDiagram, AbstractDiagram, CartesianCoordinatePlane )
0076 
0077 }
0078 #endif /* KCHARTABSTRACTCARTESIANDIAGRAM_P_H */