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 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_svx.hxx" 26 #include <svx/sdr/overlay/overlayhelpline.hxx> 27 #include <tools/gen.hxx> 28 #include <vcl/salbtype.hxx> 29 #include <vcl/outdev.hxx> 30 #include <basegfx/vector/b2dvector.hxx> 31 #include <svx/sdr/overlay/overlaytools.hxx> 32 #include <svx/sdr/overlay/overlaymanager.hxx> 33 34 ////////////////////////////////////////////////////////////////////////////// 35 36 namespace sdr 37 { 38 namespace overlay 39 { createOverlayObjectPrimitive2DSequence()40 drawinglayer::primitive2d::Primitive2DSequence OverlayHelplineStriped::createOverlayObjectPrimitive2DSequence() 41 { 42 drawinglayer::primitive2d::Primitive2DSequence aRetval; 43 44 if(getOverlayManager()) 45 { 46 const basegfx::BColor aRGBColorA(getOverlayManager()->getStripeColorA().getBColor()); 47 const basegfx::BColor aRGBColorB(getOverlayManager()->getStripeColorB().getBColor()); 48 const double fStripeLengthPixel(getOverlayManager()->getStripeLengthPixel()); 49 const drawinglayer::primitive2d::HelplineStyle aStyle( 50 SDRHELPLINE_POINT == getKind() ? drawinglayer::primitive2d::HELPLINESTYLE_POINT : 51 SDRHELPLINE_VERTICAL == getKind() ? drawinglayer::primitive2d::HELPLINESTYLE_VERTICAL : 52 drawinglayer::primitive2d::HELPLINESTYLE_HORIZONTAL); 53 54 const drawinglayer::primitive2d::Primitive2DReference aReference( 55 new drawinglayer::primitive2d::OverlayHelplineStripedPrimitive( 56 getBasePosition(), 57 aStyle, 58 aRGBColorA, 59 aRGBColorB, 60 fStripeLengthPixel)); 61 62 aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); 63 } 64 65 return aRetval; 66 } 67 stripeDefinitionHasChanged()68 void OverlayHelplineStriped::stripeDefinitionHasChanged() 69 { 70 // react on OverlayManager's stripe definition change 71 objectChange(); 72 } 73 OverlayHelplineStriped(const basegfx::B2DPoint & rBasePos,SdrHelpLineKind eNewKind)74 OverlayHelplineStriped::OverlayHelplineStriped( 75 const basegfx::B2DPoint& rBasePos, 76 SdrHelpLineKind eNewKind) 77 : OverlayObjectWithBasePosition(rBasePos, Color(COL_BLACK)), 78 meKind(eNewKind) 79 { 80 } 81 ~OverlayHelplineStriped()82 OverlayHelplineStriped::~OverlayHelplineStriped() 83 { 84 } 85 } // end of namespace overlay 86 } // end of namespace sdr 87 88 ////////////////////////////////////////////////////////////////////////////// 89 // eof 90