Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive3d/textureprimitive3d.hxx>
35 : : #include <drawinglayer/attribute/fillhatchattribute.hxx>
36 : :
37 : : //////////////////////////////////////////////////////////////////////////////
38 : :
39 : : namespace drawinglayer
40 : : {
41 : : namespace primitive3d
42 : : {
43 : : /** HatchTexturePrimitive3D class
44 : :
45 : : HatchTexturePrimitive3D is derived from GroupPrimitive3D, but implements
46 : : a decomposition which is complicated enough for buffering. Since the group
47 : : primitive has no default buffering, it is necessary here to add a local
48 : : buffering mechanism for the decomposition
49 : : */
50 [ + - ][ + - ]: 16 : class DRAWINGLAYER_DLLPUBLIC HatchTexturePrimitive3D : public TexturePrimitive3D
[ - + ]
51 : : {
52 : : private:
53 : : /// the hatch definition
54 : : attribute::FillHatchAttribute maHatch;
55 : :
56 : : /// the buffered decomposed hatch
57 : : Primitive3DSequence maBuffered3DDecomposition;
58 : :
59 : : protected:
60 : : /// helper: local decomposition
61 : : Primitive3DSequence impCreate3DDecomposition() const;
62 : :
63 : : /// local access methods to maBufferedDecomposition
64 : 16 : const Primitive3DSequence& getBuffered3DDecomposition() const { return maBuffered3DDecomposition; }
65 : 8 : void setBuffered3DDecomposition(const Primitive3DSequence& rNew) { maBuffered3DDecomposition = rNew; }
66 : :
67 : : public:
68 : : /// constructor
69 : : HatchTexturePrimitive3D(
70 : : const attribute::FillHatchAttribute& rHatch,
71 : : const Primitive3DSequence& rChildren,
72 : : const basegfx::B2DVector& rTextureSize,
73 : : bool bModulate,
74 : : bool bFilter);
75 : :
76 : : /// data read access
77 : 72 : const attribute::FillHatchAttribute& getHatch() const { return maHatch; }
78 : :
79 : : /// compare operator
80 : : virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
81 : :
82 : : /// local decomposition.
83 : : virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
84 : :
85 : : /// provide unique ID
86 : : DeclPrimitrive3DIDBlock()
87 : : };
88 : : } // end of namespace primitive3d
89 : : } // end of namespace drawinglayer
90 : :
91 : : //////////////////////////////////////////////////////////////////////////////
92 : :
93 : : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
94 : :
95 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|