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_POLYGONPRIMITIVE3D_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive3d/baseprimitive3d.hxx>
35 : : #include <basegfx/color/bcolor.hxx>
36 : : #include <basegfx/polygon/b3dpolygon.hxx>
37 : : #include <drawinglayer/attribute/lineattribute.hxx>
38 : : #include <drawinglayer/attribute/strokeattribute.hxx>
39 : :
40 : : //////////////////////////////////////////////////////////////////////////////
41 : :
42 : : namespace drawinglayer
43 : : {
44 : : namespace primitive3d
45 : : {
46 : : /** PolygonHairlinePrimitive3D class
47 : :
48 : : This primitive defines a Hairline in 3D. Since hairlines are view-dependent,
49 : : this primitive is view-dependent, too.
50 : :
51 : : This is one of the non-decomposable 3D primitives, so a renderer
52 : : should proccess it.
53 : : */
54 [ + - ][ - + ]: 1508 : class DRAWINGLAYER_DLLPUBLIC PolygonHairlinePrimitive3D : public BasePrimitive3D
55 : : {
56 : : private:
57 : : /// the hairline geometry
58 : : basegfx::B3DPolygon maPolygon;
59 : :
60 : : /// the hairline color
61 : : basegfx::BColor maBColor;
62 : :
63 : : public:
64 : : /// constructor
65 : : PolygonHairlinePrimitive3D(
66 : : const basegfx::B3DPolygon& rPolygon,
67 : : const basegfx::BColor& rBColor);
68 : :
69 : : /// data read access
70 : 30 : const basegfx::B3DPolygon& getB3DPolygon() const { return maPolygon; }
71 : 30 : const basegfx::BColor& getBColor() const { return maBColor; }
72 : :
73 : : /// compare operator
74 : : virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
75 : :
76 : : /// get range
77 : : virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
78 : :
79 : : /// provide unique ID
80 : : DeclPrimitrive3DIDBlock()
81 : : };
82 : : } // end of namespace primitive3d
83 : : } // end of namespace drawinglayer
84 : :
85 : : //////////////////////////////////////////////////////////////////////////////
86 : :
87 : : namespace drawinglayer
88 : : {
89 : : namespace primitive3d
90 : : {
91 : : /** PolygonStrokePrimitive3D class
92 : :
93 : : This primitive defines a 3D line with line width, line join, line color
94 : : and stroke attributes. It will be decomposed dependent on the definition
95 : : to the needed primitives, e.g. filled Tubes for fat lines.
96 : : */
97 [ + - ][ + - ]: 36 : class DRAWINGLAYER_DLLPUBLIC PolygonStrokePrimitive3D : public BufferedDecompositionPrimitive3D
[ + - ][ - + ]
98 : : {
99 : : private:
100 : : /// the line geometry
101 : : basegfx::B3DPolygon maPolygon;
102 : :
103 : : /// the line attributes like width, join and color
104 : : attribute::LineAttribute maLineAttribute;
105 : :
106 : : /// the line stroking (if used)
107 : : attribute::StrokeAttribute maStrokeAttribute;
108 : :
109 : : protected:
110 : : /// local decomposition.
111 : : virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
112 : :
113 : : public:
114 : : /// constructor
115 : : PolygonStrokePrimitive3D(
116 : : const basegfx::B3DPolygon& rPolygon,
117 : : const attribute::LineAttribute& rLineAttribute,
118 : : const attribute::StrokeAttribute& rStrokeAttribute);
119 : :
120 : : /// data read access
121 : 36 : basegfx::B3DPolygon getB3DPolygon() const { return maPolygon; }
122 : 36 : const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; }
123 : 18 : const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
124 : :
125 : : /// compare operator
126 : : virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
127 : :
128 : : /// provide unique ID
129 : : DeclPrimitrive3DIDBlock()
130 : : };
131 : : } // end of namespace primitive3d
132 : : } // end of namespace drawinglayer
133 : :
134 : : //////////////////////////////////////////////////////////////////////////////
135 : :
136 : : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX
137 : :
138 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|