Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : : #ifndef _CHART2_EXPLICITSCALEVALUES_HXX
20 : : #define _CHART2_EXPLICITSCALEVALUES_HXX
21 : :
22 : : #include "chartviewdllapi.hxx"
23 : : #include <com/sun/star/chart/TimeInterval.hpp>
24 : : #include <com/sun/star/chart/TimeUnit.hpp>
25 : : #include <com/sun/star/chart2/AxisOrientation.hpp>
26 : : #include <com/sun/star/chart2/AxisType.hpp>
27 : : #include <com/sun/star/chart2/XScaling.hpp>
28 : : #include <tools/date.hxx>
29 : : #include <vector>
30 : : //.............................................................................
31 : : namespace chart
32 : : {
33 : : //.............................................................................
34 : :
35 : : //-----------------------------------------------------------------------------
36 : : /** This structure contains the explicit values for a scale like Minimum and Maximum.
37 : : See also ::com::sun::star::chart2::ScaleData.
38 : : */
39 : :
40 : 196067 : struct OOO_DLLPUBLIC_CHARTVIEW ExplicitScaleData
41 : : {
42 : : ExplicitScaleData();
43 : :
44 : : double Minimum;
45 : : double Maximum;
46 : : double Origin;
47 : :
48 : : ::com::sun::star::chart2::AxisOrientation Orientation;
49 : :
50 : : ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling > Scaling;
51 : :
52 : : sal_Int32 AxisType;//see ::com::sun::star::chart2::AxisType
53 : : bool ShiftedCategoryPosition;
54 : : sal_Int32 TimeResolution; //constant of type <type>::com::sun::star::chart::TimeUnit</type>
55 : : Date NullDate;
56 : : };
57 : :
58 : : struct OOO_DLLPUBLIC_CHARTVIEW ExplicitSubIncrement
59 : : {
60 : : ExplicitSubIncrement();
61 : :
62 : : /** Numbers of intervals between two superior ticks. For an axis
63 : : this usually means, that <code>IntervalCount - 1</code>
64 : : sub-tick-marks are displayed between two superior ticks.
65 : :
66 : : */
67 : : sal_Int32 IntervalCount;
68 : :
69 : : /** If <TRUE/>, the distance between two sub-tick-marks on the
70 : : screen is always the same. If <FALSE/>, the distances may
71 : : differ depending on the <type>XScaling</type>.
72 : : */
73 : : bool PostEquidistant;
74 : : };
75 : :
76 : : /** describes how tickmarks are positioned on the scale of an axis.
77 : : */
78 : 87359 : struct OOO_DLLPUBLIC_CHARTVIEW ExplicitIncrementData
79 : : {
80 : : ExplicitIncrementData();
81 : :
82 : : /** the following two members are only for date-time axis
83 : : */
84 : : ::com::sun::star::chart::TimeInterval MajorTimeInterval;
85 : : ::com::sun::star::chart::TimeInterval MinorTimeInterval;
86 : :
87 : : /** the other members are for *not* date-time axis
88 : : */
89 : :
90 : : /** <member>Distance</member> describes the distance between two
91 : : neighboring main tickmarks on a <type>Scale</type> of an axis.
92 : : All neighboring main tickmarks have the same constant distance.
93 : :
94 : : <p>If the Scale has a <type>XScaling</type> the <member>Distance</member>
95 : : may be measured in two different ways - that is - before or after the
96 : : scaling is applied.</p>
97 : :
98 : : <p>On a logarithmic scale for example the distance between two main
99 : : tickmarks is typically measured after the scaling is applied:
100 : : Distance = log(tick2)-log(tick1)
101 : : ( log(1000)-log(100)==log(100)-log(10)==log(10)-log(1)==1==Distance ).
102 : : The resulting tickmarks will always look equidistant on the screen.
103 : : The other possibility is to have a Distance = tick2-tick1 measured constant
104 : : before a scaling is applied, which may lead to non equidistant tickmarks
105 : : on the screen.</p>
106 : :
107 : : <p><member>PostEquidistant</member> rules whether the <member>Distance</member>
108 : : is meant to be a value before or after scaling.</p>
109 : : */
110 : : double Distance;
111 : :
112 : : /**
113 : : <member>PostEquidistant</member> rules whether the member <member>Distance</member>
114 : : describes a distance before or after the scaling is applied.
115 : :
116 : : <p>If <member>PostEquidistant</member> equals <TRUE/> <member>Distance</member>
117 : : is given in values after <type>XScaling</type> is applied, thus resulting
118 : : main tickmarks will always look equidistant on the screen.
119 : : If <member>PostEquidistant</member> equals <FALSE/> <member>Distance</member>
120 : : is given in values before <type>XScaling</type> is applied.</p>
121 : : */
122 : : bool PostEquidistant;
123 : :
124 : : /** The <member>BaseValue</member> gives a starting point on the scale
125 : : to which all further main tickmarks are relatively positioned.
126 : :
127 : : <p>The <member>BaseValue</member> is always a value on the scale before
128 : : a possible scaling is applied. If the given value is not valid in the
129 : : associated scaling the minimum of the scaling is assumed,
130 : : if there is no minimum any other obvious value will be assumed.</p>
131 : :
132 : : <p>E.g.: assume a scale from 0 to 6 with identical scaling.
133 : : Further assume this Increment to have Distance==2 and PostEquidistant==false.
134 : : Setting BaseValue=0 would lead to main tickmarks 0; 2; 4; 6;
135 : : Setting BaseValue=1,3 would lead to main tickmarks 1,3; 3,3; 5,3;
136 : : Setting BaseValue=-0,7 would also lead to main tickmarks 1,3; 3,3; 5,3;
137 : : And setting BaseValue to 2, -2, 4, -4 etc. in this example
138 : : leads to the same result as BaseValue=0.</p>
139 : : */
140 : : double BaseValue;
141 : :
142 : : /** <member>SubIncrements</member> describes the positioning of further
143 : : sub tickmarks on the scale of an axis.
144 : :
145 : : <p>The first SubIncrement in this sequence determines how the
146 : : distance between two neighboring main tickmarks is divided for positioning
147 : : of further sub tickmarks. Every following SubIncrement determines the
148 : : positions of subsequent tickmarks in relation to their parent tickmarks
149 : : iven by the preceding SubIncrement.</p>
150 : : */
151 : : ::std::vector< ExplicitSubIncrement > SubIncrements;
152 : : };
153 : :
154 : : //.............................................................................
155 : : } //namespace chart
156 : : //.............................................................................
157 : : #endif
158 : :
159 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|