xref: /AOO41X/main/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx (revision 4f506f19cd544df9572ed8c88b6bdbc6c8f33210)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX
25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX
26 
27 #include <drawinglayer/drawinglayerdllapi.h>
28 #include <drawinglayer/primitive3d/sdrprimitive3d.hxx>
29 
30 //////////////////////////////////////////////////////////////////////////////
31 
32 namespace drawinglayer
33 {
34     namespace primitive3d
35     {
36         /** SdrSpherePrimitive3D class
37 
38             This 3D primitive expands the SdrPrimitive3D to a 3D sphere definition.
39             The sphere is implicitely in unit coordinates and the given transformation
40             defines it's geometry in space.
41          */
42         class DRAWINGLAYER_DLLPUBLIC SdrSpherePrimitive3D : public SdrPrimitive3D
43         {
44         private:
45             /// additional geometry definitions
46             sal_uInt32                                  mnHorizontalSegments;
47             sal_uInt32                                  mnVerticalSegments;
48 
49         protected:
50             /// local decomposition.
51             virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
52 
53         public:
54             /// constructor
55             SdrSpherePrimitive3D(
56                 const basegfx::B3DHomMatrix& rTransform,
57                 const basegfx::B2DVector& rTextureSize,
58                 const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
59                 const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
60                 sal_uInt32 nHorizontalSegments,
61                 sal_uInt32 nVerticalSegments);
62 
63             /// data read access
getHorizontalSegments() const64             sal_uInt32 getHorizontalSegments() const { return mnHorizontalSegments; }
getVerticalSegments() const65             sal_uInt32 getVerticalSegments() const { return mnVerticalSegments; }
66 
67             /// compare operator
68             virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
69 
70             /// get range
71             virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
72 
73             /// provide unique ID
74             DeclPrimitrive3DIDBlock()
75         };
76     } // end of namespace primitive3d
77 } // end of namespace drawinglayer
78 
79 //////////////////////////////////////////////////////////////////////////////
80 
81 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_SDRSPHEREPRIMITIVE3D_HXX
82 
83 //////////////////////////////////////////////////////////////////////////////
84 // eof
85