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_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX 25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX 26 27 #include <drawinglayer/drawinglayerdllapi.h> 28 #include <drawinglayer/primitive2d/groupprimitive2d.hxx> 29 #include <basegfx/matrix/b2dhommatrix.hxx> 30 31 ////////////////////////////////////////////////////////////////////////////// 32 33 namespace drawinglayer 34 { 35 namespace primitive2d 36 { 37 /** TransformPrimitive2D class 38 39 This is one of the basic grouping primitives and it provides 40 embedding a sequence of primitives (a geometry) into a 41 transformation. All renderers have to handle this, usually by 42 building a current transformation stack (linear combination) 43 and applying this to all to-be-rendered geometry. If not handling 44 this, the output will be mostly wrong since this primitive is 45 widely used. 46 47 It does transform by embedding an existing geometry into a 48 transformation as Child-content. This allows re-usage of the 49 refcounted Uno-Api primitives and their existung, buffered 50 decompositions. 51 52 It could e.g. be used to show a single object geometry in 1000 53 different, transformed states without the need to create those 54 thousand primitive contents. 55 */ 56 class DRAWINGLAYER_DLLPUBLIC TransformPrimitive2D : public GroupPrimitive2D 57 { 58 private: 59 // the transformation to apply to the child geometry 60 basegfx::B2DHomMatrix maTransformation; 61 62 public: 63 /// constructor 64 TransformPrimitive2D( 65 const basegfx::B2DHomMatrix& rTransformation, 66 const Primitive2DSequence& rChildren); 67 68 /// data read access getTransformation() const69 const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; } 70 71 /// compare operator 72 virtual bool operator==(const BasePrimitive2D& rPrimitive) const; 73 74 /// get range 75 virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; 76 77 /// provide unique ID 78 DeclPrimitrive2DIDBlock() 79 }; 80 } // end of namespace primitive2d 81 } // end of namespace drawinglayer 82 83 ////////////////////////////////////////////////////////////////////////////// 84 85 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX 86 87 ////////////////////////////////////////////////////////////////////////////// 88 // eof 89