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_VIEW_INC_SHAPEFACTORY_HXX
20 : #define INCLUDED_CHART2_SOURCE_VIEW_INC_SHAPEFACTORY_HXX
21 :
22 : #include "AbstractShapeFactory.hxx"
23 :
24 : namespace chart
25 : {
26 :
27 0 : class ShapeFactory : public AbstractShapeFactory
28 : {
29 : friend class AbstractShapeFactory;
30 :
31 28 : ShapeFactory(::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> xFactory)
32 28 : {m_xShapeFactory = xFactory;}
33 :
34 : public:
35 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
36 : createGroup2D(
37 : const ::com::sun::star::uno::Reference<
38 : ::com::sun::star::drawing::XShapes >& xTarget
39 : , const OUString& aName = OUString() ) SAL_OVERRIDE;
40 :
41 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
42 : createGroup3D(
43 : const ::com::sun::star::uno::Reference<
44 : ::com::sun::star::drawing::XShapes >& xTarget
45 : , const OUString& aName = OUString() ) SAL_OVERRIDE;
46 :
47 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
48 : createCube( const ::com::sun::star::uno::Reference<
49 : ::com::sun::star::drawing::XShapes >& xTarget
50 : , const ::com::sun::star::drawing::Position3D& rPosition
51 : , const ::com::sun::star::drawing::Direction3D& rSize
52 : , sal_Int32 nRotateZAngleHundredthDegree
53 : , const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSourceProp
54 : , const tPropertyNameMap& rPropertyNameMap
55 : , bool bRounded = false) SAL_OVERRIDE;
56 :
57 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
58 : createCylinder( const ::com::sun::star::uno::Reference<
59 : ::com::sun::star::drawing::XShapes >& xTarget
60 : , const ::com::sun::star::drawing::Position3D& rPosition
61 : , const ::com::sun::star::drawing::Direction3D& rSize
62 : , sal_Int32 nRotateZAngleHundredthDegree ) SAL_OVERRIDE;
63 :
64 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
65 : createPyramid( const ::com::sun::star::uno::Reference<
66 : ::com::sun::star::drawing::XShapes >& xTarget
67 : , const ::com::sun::star::drawing::Position3D& rPosition
68 : , const ::com::sun::star::drawing::Direction3D& rSize
69 : , double fTopHeight
70 : , bool bRotateZ
71 : , const ::com::sun::star::uno::Reference<
72 : ::com::sun::star::beans::XPropertySet >& xSourceProp
73 : , const tPropertyNameMap& rPropertyNameMap) SAL_OVERRIDE;
74 :
75 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
76 : createCone( const ::com::sun::star::uno::Reference<
77 : ::com::sun::star::drawing::XShapes >& xTarget
78 : , const ::com::sun::star::drawing::Position3D& rPosition
79 : , const ::com::sun::star::drawing::Direction3D& rSize
80 : , double fTopHeight, sal_Int32 nRotateZAngleHundredthDegree ) SAL_OVERRIDE;
81 :
82 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
83 : createPieSegment2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
84 : , double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree
85 : , double fUnitCircleInnerRadius, double fUnitCircleOuterRadius
86 : , const ::com::sun::star::drawing::Direction3D& rOffset
87 : , const ::com::sun::star::drawing::HomogenMatrix& rUnitCircleToScene ) SAL_OVERRIDE;
88 :
89 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
90 : createPieSegment( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
91 : , double fUnitCircleStartAngleDegree, double fUnitCircleWidthAngleDegree
92 : , double fUnitCircleInnerRadius, double fUnitCircleOuterRadius
93 : , const ::com::sun::star::drawing::Direction3D& rOffset
94 : , const ::com::sun::star::drawing::HomogenMatrix& rUnitCircleToScene
95 : , double fDepth ) SAL_OVERRIDE;
96 :
97 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
98 : createStripe( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
99 : , const Stripe& rStripe
100 : , const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSourceProp
101 : , const tPropertyNameMap& rPropertyNameMap
102 : , bool bDoubleSided = true
103 : , short nRotatedTexture = 0 //0 to 7 are the different possibilities
104 : , bool bFlatNormals=true ) SAL_OVERRIDE;
105 :
106 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
107 : createArea3D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
108 : , const ::com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygon
109 : , double fDepth) SAL_OVERRIDE;
110 :
111 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
112 : createArea2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
113 : , const ::com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygon) SAL_OVERRIDE;
114 :
115 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
116 : createSymbol2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
117 : , const ::com::sun::star::drawing::Position3D& rPos
118 : , const ::com::sun::star::drawing::Direction3D& rSize
119 : , sal_Int32 nStandardSymbol
120 : , sal_Int32 nBorderColor=0
121 : , sal_Int32 nFillColor=0 ) SAL_OVERRIDE;
122 :
123 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
124 : createGraphic2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
125 : , const ::com::sun::star::drawing::Position3D& rPos
126 : , const ::com::sun::star::drawing::Direction3D& rSize
127 : , const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& xGraphic ) SAL_OVERRIDE;
128 :
129 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
130 : createLine2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
131 : , const ::com::sun::star::drawing::PointSequenceSequence& rPoints
132 : , const VLineProperties* pLineProperties = NULL ) SAL_OVERRIDE;
133 :
134 : virtual com::sun::star::uno::Reference< com::sun::star::drawing::XShape >
135 : createLine ( const ::com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& xTarget,
136 : const com::sun::star::awt::Size& rSize, const com::sun::star::awt::Point& rPosition ) SAL_OVERRIDE;
137 :
138 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
139 : createLine3D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
140 : , const ::com::sun::star::drawing::PolyPolygonShape3D& rPoints
141 : , const VLineProperties& rLineProperties ) SAL_OVERRIDE;
142 :
143 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
144 : createCircle2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
145 : , const ::com::sun::star::drawing::Position3D& rPos
146 : , const ::com::sun::star::drawing::Direction3D& rSize ) SAL_OVERRIDE;
147 :
148 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
149 : createCircle( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
150 : , const ::com::sun::star::awt::Size& rSize
151 : , const ::com::sun::star::awt::Point& rPosition ) SAL_OVERRIDE;
152 :
153 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
154 : createText( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget2D
155 : , const OUString& rText
156 : , const tNameSequence& rPropNames
157 : , const tAnySequence& rPropValues
158 : , const ::com::sun::star::uno::Any& rATransformation
159 : ) SAL_OVERRIDE;
160 :
161 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
162 : createText( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget2D,
163 : const com::sun::star::awt::Size& rSize,
164 : const com::sun::star::awt::Point& rPosition,
165 : com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::chart2::XFormattedString > >& xFormattedString,
166 : const com::sun::star::uno::Reference<
167 : com::sun::star::beans::XPropertySet > & xTextProperties,
168 : double nRotation, const OUString& aName ) SAL_OVERRIDE;
169 :
170 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
171 : createInvisibleRectangle(
172 : const ::com::sun::star::uno::Reference<
173 : ::com::sun::star::drawing::XShapes >& xTarget
174 : , const ::com::sun::star::awt::Size& rSize ) SAL_OVERRIDE;
175 :
176 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
177 : createRectangle(
178 : const com::sun::star::uno::Reference<
179 : com::sun::star::drawing::XShapes >& xTarget,
180 : const com::sun::star::awt::Size& rSize,
181 : const com::sun::star::awt::Point& rPosition,
182 : const tNameSequence& rPropNames,
183 : const tAnySequence& rPropValues,
184 : StackPosition ePos = Top ) SAL_OVERRIDE;
185 :
186 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
187 : createRectangle(
188 : const ::com::sun::star::uno::Reference<
189 : ::com::sun::star::drawing::XShapes >& xTarget ) SAL_OVERRIDE;
190 :
191 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
192 : getOrCreateChartRootShape( const ::com::sun::star::uno::Reference<
193 : ::com::sun::star::drawing::XDrawPage>& xPage ) SAL_OVERRIDE;
194 :
195 : virtual void setPageSize( com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > xChartShapes, const com::sun::star::awt::Size& rSize ) SAL_OVERRIDE;
196 :
197 : /**
198 : * not necessary right now
199 : */
200 680 : virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >, bool ) SAL_OVERRIDE {}
201 :
202 680 : virtual bool preRender(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >, OpenGLWindow*) SAL_OVERRIDE { return true; }
203 680 : virtual void postRender(OpenGLWindow*) SAL_OVERRIDE {}
204 :
205 886 : virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > ) SAL_OVERRIDE {}
206 :
207 : private:
208 : ShapeFactory();
209 :
210 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
211 : impl_createCube( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
212 : , const ::com::sun::star::drawing::Position3D& rPosition
213 : , const ::com::sun::star::drawing::Direction3D& rSize, sal_Int32 nRotateZAngleHundredthDegree
214 : , bool bRounded );
215 :
216 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
217 : impl_createConeOrCylinder( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
218 : , const ::com::sun::star::drawing::Position3D& rPosition
219 : , const ::com::sun::star::drawing::Direction3D& rSize
220 : , double fTopHeight, sal_Int32 nRotateZAngleHundredthDegree
221 : , bool bCylinder = false);
222 : };
223 :
224 : } //namespace chart
225 : #endif
226 :
227 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|