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 INCLUDED_CHART2_SOURCE_INC_CHARTVIEW_EXPLICITSCALEVALUES_HXX
20 : #define INCLUDED_CHART2_SOURCE_INC_CHARTVIEW_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 : namespace chart
31 : {
32 :
33 : /** This structure contains the explicit values for a scale like Minimum and Maximum.
34 : See also ::com::sun::star::chart2::ScaleData.
35 : */
36 282876 : struct OOO_DLLPUBLIC_CHARTVIEW ExplicitScaleData
37 : {
38 : ExplicitScaleData();
39 :
40 : double Minimum;
41 : double Maximum;
42 : double Origin;
43 :
44 : ::com::sun::star::chart2::AxisOrientation Orientation;
45 :
46 : ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling > Scaling;
47 :
48 : sal_Int32 AxisType;//see ::com::sun::star::chart2::AxisType
49 : bool ShiftedCategoryPosition;
50 : sal_Int32 TimeResolution; //constant of type <type>::com::sun::star::chart::TimeUnit</type>
51 : Date NullDate;
52 : };
53 :
54 : struct OOO_DLLPUBLIC_CHARTVIEW ExplicitSubIncrement
55 : {
56 : ExplicitSubIncrement();
57 :
58 : /** Numbers of intervals between two superior ticks. For an axis
59 : this usually means, that <code>IntervalCount - 1</code>
60 : sub-tick-marks are displayed between two superior ticks.
61 :
62 : */
63 : sal_Int32 IntervalCount;
64 :
65 : /** If <TRUE/>, the distance between two sub-tick-marks on the
66 : screen is always the same. If <FALSE/>, the distances may
67 : differ depending on the <type>XScaling</type>.
68 : */
69 : bool PostEquidistant;
70 : };
71 :
72 : /** describes how tickmarks are positioned on the scale of an axis.
73 : */
74 164628 : struct OOO_DLLPUBLIC_CHARTVIEW ExplicitIncrementData
75 : {
76 : ExplicitIncrementData();
77 :
78 : /** the following two members are only for date-time axis
79 : */
80 : ::com::sun::star::chart::TimeInterval MajorTimeInterval;
81 : ::com::sun::star::chart::TimeInterval MinorTimeInterval;
82 :
83 : /** the other members are for *not* date-time axis
84 : */
85 :
86 : /** <member>Distance</member> describes the distance between two
87 : neighboring main tickmarks on a <type>Scale</type> of an axis.
88 : All neighboring main tickmarks have the same constant distance.
89 :
90 : <p>If the Scale has a <type>XScaling</type> the <member>Distance</member>
91 : may be measured in two different ways - that is - before or after the
92 : scaling is applied.</p>
93 :
94 : <p>On a logarithmic scale for example the distance between two main
95 : tickmarks is typically measured after the scaling is applied:
96 : Distance = log(tick2)-log(tick1)
97 : ( log(1000)-log(100)==log(100)-log(10)==log(10)-log(1)==1==Distance ).
98 : The resulting tickmarks will always look equidistant on the screen.
99 : The other possibility is to have a Distance = tick2-tick1 measured constant
100 : before a scaling is applied, which may lead to non equidistant tickmarks
101 : on the screen.</p>
102 :
103 : <p><member>PostEquidistant</member> rules whether the <member>Distance</member>
104 : is meant to be a value before or after scaling.</p>
105 : */
106 : double Distance;
107 :
108 : /**
109 : <member>PostEquidistant</member> rules whether the member <member>Distance</member>
110 : describes a distance before or after the scaling is applied.
111 :
112 : <p>If <member>PostEquidistant</member> equals <TRUE/> <member>Distance</member>
113 : is given in values after <type>XScaling</type> is applied, thus resulting
114 : main tickmarks will always look equidistant on the screen.
115 : If <member>PostEquidistant</member> equals <FALSE/> <member>Distance</member>
116 : is given in values before <type>XScaling</type> is applied.</p>
117 : */
118 : bool PostEquidistant;
119 :
120 : /** The <member>BaseValue</member> gives a starting point on the scale
121 : to which all further main tickmarks are relatively positioned.
122 :
123 : <p>The <member>BaseValue</member> is always a value on the scale before
124 : a possible scaling is applied. If the given value is not valid in the
125 : associated scaling the minimum of the scaling is assumed,
126 : if there is no minimum any other obvious value will be assumed.</p>
127 :
128 : <p>E.g.: assume a scale from 0 to 6 with identical scaling.
129 : Further assume this Increment to have Distance==2 and PostEquidistant==false.
130 : Setting BaseValue=0 would lead to main tickmarks 0; 2; 4; 6;
131 : Setting BaseValue=1,3 would lead to main tickmarks 1,3; 3,3; 5,3;
132 : Setting BaseValue=-0,7 would also lead to main tickmarks 1,3; 3,3; 5,3;
133 : And setting BaseValue to 2, -2, 4, -4 etc. in this example
134 : leads to the same result as BaseValue=0.</p>
135 : */
136 : double BaseValue;
137 :
138 : /** <member>SubIncrements</member> describes the positioning of further
139 : sub tickmarks on the scale of an axis.
140 :
141 : <p>The first SubIncrement in this sequence determines how the
142 : distance between two neighboring main tickmarks is divided for positioning
143 : of further sub tickmarks. Every following SubIncrement determines the
144 : positions of subsequent tickmarks in relation to their parent tickmarks
145 : iven by the preceding SubIncrement.</p>
146 : */
147 : ::std::vector< ExplicitSubIncrement > SubIncrements;
148 : };
149 :
150 : } //namespace chart
151 : #endif
152 :
153 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|