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