1*4f506f19SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*4f506f19SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*4f506f19SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*4f506f19SAndrew Rist * distributed with this work for additional information 6*4f506f19SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*4f506f19SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*4f506f19SAndrew Rist * "License"); you may not use this file except in compliance 9*4f506f19SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*4f506f19SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*4f506f19SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*4f506f19SAndrew Rist * software distributed under the License is distributed on an 15*4f506f19SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*4f506f19SAndrew Rist * KIND, either express or implied. See the License for the 17*4f506f19SAndrew Rist * specific language governing permissions and limitations 18*4f506f19SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*4f506f19SAndrew Rist *************************************************************/ 21*4f506f19SAndrew Rist 22*4f506f19SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX 25cdf0e10cSrcweir #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX 26cdf0e10cSrcweir 27090f0eb8SEike Rathke #include <drawinglayer/drawinglayerdllapi.h> 28cdf0e10cSrcweir #include <drawinglayer/primitive3d/baseprimitive3d.hxx> 29cdf0e10cSrcweir #include <basegfx/color/bcolor.hxx> 30cdf0e10cSrcweir #include <basegfx/polygon/b3dpolygon.hxx> 31cdf0e10cSrcweir #include <drawinglayer/attribute/lineattribute.hxx> 32cdf0e10cSrcweir #include <drawinglayer/attribute/strokeattribute.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 35cdf0e10cSrcweir 36cdf0e10cSrcweir namespace drawinglayer 37cdf0e10cSrcweir { 38cdf0e10cSrcweir namespace primitive3d 39cdf0e10cSrcweir { 40cdf0e10cSrcweir /** PolygonHairlinePrimitive3D class 41cdf0e10cSrcweir 42cdf0e10cSrcweir This primitive defines a Hairline in 3D. Since hairlines are view-dependent, 43cdf0e10cSrcweir this primitive is view-dependent, too. 44cdf0e10cSrcweir 45cdf0e10cSrcweir This is one of the non-decomposable 3D primitives, so a renderer 46cdf0e10cSrcweir should proccess it. 47cdf0e10cSrcweir */ 48090f0eb8SEike Rathke class DRAWINGLAYER_DLLPUBLIC PolygonHairlinePrimitive3D : public BasePrimitive3D 49cdf0e10cSrcweir { 50cdf0e10cSrcweir private: 51cdf0e10cSrcweir /// the hairline geometry 52cdf0e10cSrcweir basegfx::B3DPolygon maPolygon; 53cdf0e10cSrcweir 54cdf0e10cSrcweir /// the hairline color 55cdf0e10cSrcweir basegfx::BColor maBColor; 56cdf0e10cSrcweir 57cdf0e10cSrcweir public: 58cdf0e10cSrcweir /// constructor 59cdf0e10cSrcweir PolygonHairlinePrimitive3D( 60cdf0e10cSrcweir const basegfx::B3DPolygon& rPolygon, 61cdf0e10cSrcweir const basegfx::BColor& rBColor); 62cdf0e10cSrcweir 63cdf0e10cSrcweir /// data read access getB3DPolygon() const64cdf0e10cSrcweir const basegfx::B3DPolygon& getB3DPolygon() const { return maPolygon; } getBColor() const65cdf0e10cSrcweir const basegfx::BColor& getBColor() const { return maBColor; } 66cdf0e10cSrcweir 67cdf0e10cSrcweir /// compare operator 68cdf0e10cSrcweir virtual bool operator==(const BasePrimitive3D& rPrimitive) const; 69cdf0e10cSrcweir 70cdf0e10cSrcweir /// get range 71cdf0e10cSrcweir virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const; 72cdf0e10cSrcweir 73cdf0e10cSrcweir /// provide unique ID 74cdf0e10cSrcweir DeclPrimitrive3DIDBlock() 75cdf0e10cSrcweir }; 76cdf0e10cSrcweir } // end of namespace primitive3d 77cdf0e10cSrcweir } // end of namespace drawinglayer 78cdf0e10cSrcweir 79cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 80cdf0e10cSrcweir 81cdf0e10cSrcweir namespace drawinglayer 82cdf0e10cSrcweir { 83cdf0e10cSrcweir namespace primitive3d 84cdf0e10cSrcweir { 85cdf0e10cSrcweir /** PolygonStrokePrimitive3D class 86cdf0e10cSrcweir 87cdf0e10cSrcweir This primitive defines a 3D line with line width, line join, line color 88cdf0e10cSrcweir and stroke attributes. It will be decomposed dependent on the definition 89cdf0e10cSrcweir to the needed primitives, e.g. filled Tubes for fat lines. 90cdf0e10cSrcweir */ 91090f0eb8SEike Rathke class DRAWINGLAYER_DLLPUBLIC PolygonStrokePrimitive3D : public BufferedDecompositionPrimitive3D 92cdf0e10cSrcweir { 93cdf0e10cSrcweir private: 94cdf0e10cSrcweir /// the line geometry 95cdf0e10cSrcweir basegfx::B3DPolygon maPolygon; 96cdf0e10cSrcweir 97cdf0e10cSrcweir /// the line attributes like width, join and color 98cdf0e10cSrcweir attribute::LineAttribute maLineAttribute; 99cdf0e10cSrcweir 100cdf0e10cSrcweir /// the line stroking (if used) 101cdf0e10cSrcweir attribute::StrokeAttribute maStrokeAttribute; 102cdf0e10cSrcweir 103cdf0e10cSrcweir protected: 104cdf0e10cSrcweir /// local decomposition. 105cdf0e10cSrcweir virtual Primitive3DSequence create3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; 106cdf0e10cSrcweir 107cdf0e10cSrcweir public: 108cdf0e10cSrcweir /// constructor 109cdf0e10cSrcweir PolygonStrokePrimitive3D( 110cdf0e10cSrcweir const basegfx::B3DPolygon& rPolygon, 111cdf0e10cSrcweir const attribute::LineAttribute& rLineAttribute, 112cdf0e10cSrcweir const attribute::StrokeAttribute& rStrokeAttribute); 113cdf0e10cSrcweir 114cdf0e10cSrcweir /// constructor without stroking 115cdf0e10cSrcweir PolygonStrokePrimitive3D( 116cdf0e10cSrcweir const basegfx::B3DPolygon& rPolygon, 117cdf0e10cSrcweir const attribute::LineAttribute& rLineAttribute); 118cdf0e10cSrcweir 119cdf0e10cSrcweir /// data read access getB3DPolygon() const120cdf0e10cSrcweir basegfx::B3DPolygon getB3DPolygon() const { return maPolygon; } getLineAttribute() const121cdf0e10cSrcweir const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; } getStrokeAttribute() const122cdf0e10cSrcweir const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; } 123cdf0e10cSrcweir 124cdf0e10cSrcweir /// compare operator 125cdf0e10cSrcweir virtual bool operator==(const BasePrimitive3D& rPrimitive) const; 126cdf0e10cSrcweir 127cdf0e10cSrcweir /// provide unique ID 128cdf0e10cSrcweir DeclPrimitrive3DIDBlock() 129cdf0e10cSrcweir }; 130cdf0e10cSrcweir } // end of namespace primitive3d 131cdf0e10cSrcweir } // end of namespace drawinglayer 132cdf0e10cSrcweir 133cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 134cdf0e10cSrcweir 135cdf0e10cSrcweir #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_POLYGONPRIMITIVE3D_HXX 136cdf0e10cSrcweir 137cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////// 138cdf0e10cSrcweir // eof 139