1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef _SVDOEDGE_HXX 29*cdf0e10cSrcweir #define _SVDOEDGE_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <svx/svdotext.hxx> 32*cdf0e10cSrcweir #include <svx/svdglue.hxx> 33*cdf0e10cSrcweir #include "svx/svxdllapi.h" 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir //************************************************************ 36*cdf0e10cSrcweir // Vorausdeklarationen 37*cdf0e10cSrcweir //************************************************************ 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir class SdrDragMethod; 40*cdf0e10cSrcweir class SdrPageView; 41*cdf0e10cSrcweir 42*cdf0e10cSrcweir namespace sdr { namespace properties { 43*cdf0e10cSrcweir class ConnectorProperties; 44*cdf0e10cSrcweir }} 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir //************************************************************ 47*cdf0e10cSrcweir // Hilfsklasse SdrObjConnection 48*cdf0e10cSrcweir //************************************************************ 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir class SdrObjConnection 51*cdf0e10cSrcweir { 52*cdf0e10cSrcweir friend class SdrEdgeObj; 53*cdf0e10cSrcweir friend class ImpEdgeHdl; 54*cdf0e10cSrcweir friend class SdrCreateView; 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir protected: 57*cdf0e10cSrcweir Point aObjOfs; // Wird beim Draggen eines Knotens gesetzt 58*cdf0e10cSrcweir SdrObject* pObj; // Referenziertes Objekt 59*cdf0e10cSrcweir long nXDist; // Hor. Objektabstand wenn bXDistOvr=TRUE 60*cdf0e10cSrcweir long nYDist; // Vert. Objektabstand wenn bYDistOvr=TRUE 61*cdf0e10cSrcweir sal_uInt16 nConId; // Konnektornummer 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir // bitfield 64*cdf0e10cSrcweir unsigned bBestConn : 1; // sal_True= es wird der guenstigste Konnektor gesucht 65*cdf0e10cSrcweir unsigned bBestVertex : 1; // sal_True= es wird der guenstigste Scheitelpunkt zum konnekten gesucht 66*cdf0e10cSrcweir unsigned bXDistOvr : 1; // sal_True= Hor. Objektabstand wurde gedragt (Overwrite) 67*cdf0e10cSrcweir unsigned bYDistOvr : 1; // sal_True= Vert. Objektabstand wurde gedragt (Overwrite) 68*cdf0e10cSrcweir unsigned bAutoVertex : 1; // AutoConnector am Scheitelpunkt nCon 69*cdf0e10cSrcweir unsigned bAutoCorner : 1; // AutoConnector am Eckpunkt nCon 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir public: 72*cdf0e10cSrcweir SdrObjConnection() { ResetVars(); } 73*cdf0e10cSrcweir SVX_DLLPUBLIC ~SdrObjConnection(); 74*cdf0e10cSrcweir 75*cdf0e10cSrcweir void ResetVars(); 76*cdf0e10cSrcweir FASTBOOL TakeGluePoint(SdrGluePoint& rGP, FASTBOOL bSetAbsolutePos) const; 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir inline void SetBestConnection( sal_Bool rB ) { bBestConn = rB; }; 79*cdf0e10cSrcweir inline void SetBestVertex( sal_Bool rB ) { bBestVertex = rB; }; 80*cdf0e10cSrcweir inline void SetAutoVertex( sal_Bool rB ) { bAutoVertex = rB; }; 81*cdf0e10cSrcweir inline void SetConnectorId( sal_uInt16 nId ) { nConId = nId; }; 82*cdf0e10cSrcweir 83*cdf0e10cSrcweir inline sal_Bool IsBestConnection() const { return bBestConn; }; 84*cdf0e10cSrcweir inline sal_Bool IsBestVertex() const { return bBestVertex; }; 85*cdf0e10cSrcweir inline sal_Bool IsAutoVertex() const { return bAutoVertex; }; 86*cdf0e10cSrcweir inline sal_uInt16 GetConnectorId() const { return nConId; }; 87*cdf0e10cSrcweir inline SdrObject* GetObject() const { return pObj; } 88*cdf0e10cSrcweir }; 89*cdf0e10cSrcweir 90*cdf0e10cSrcweir //************************************************************ 91*cdf0e10cSrcweir // Hilfsklasse SdrEdgeInfoRec 92*cdf0e10cSrcweir //************************************************************ 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir enum SdrEdgeLineCode {OBJ1LINE2,OBJ1LINE3,OBJ2LINE2,OBJ2LINE3,MIDDLELINE}; 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir class SdrEdgeInfoRec 97*cdf0e10cSrcweir { 98*cdf0e10cSrcweir public: 99*cdf0e10cSrcweir // Die 5 Distanzen werden beim draggen bzw. per SetAttr gesetzt und von 100*cdf0e10cSrcweir // ImpCalcEdgeTrack ausgewertet. Per Get/SetAttr/Get/SetStyleSh werden 101*cdf0e10cSrcweir // jedoch nur 0-3 longs transportiert. 102*cdf0e10cSrcweir Point aObj1Line2; 103*cdf0e10cSrcweir Point aObj1Line3; 104*cdf0e10cSrcweir Point aObj2Line2; 105*cdf0e10cSrcweir Point aObj2Line3; 106*cdf0e10cSrcweir Point aMiddleLine; 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir // Nachfolgende Werte werden von ImpCalcEdgeTrack gesetzt 109*cdf0e10cSrcweir long nAngle1; // Austrittswinkel am Obj1 110*cdf0e10cSrcweir long nAngle2; // Austrittswinkel am Obj2 111*cdf0e10cSrcweir sal_uInt16 nObj1Lines; // 1..3 112*cdf0e10cSrcweir sal_uInt16 nObj2Lines; // 1..3 113*cdf0e10cSrcweir sal_uInt16 nMiddleLine; // 0xFFFF=keine, sonst Punktnummer des Linienbeginns 114*cdf0e10cSrcweir char cOrthoForm; // Form des Ortho-Verbindes, z.B. 'Z','U',I','L','S',... 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir public: 117*cdf0e10cSrcweir SdrEdgeInfoRec() 118*cdf0e10cSrcweir : nAngle1(0), 119*cdf0e10cSrcweir nAngle2(0), 120*cdf0e10cSrcweir nObj1Lines(0), 121*cdf0e10cSrcweir nObj2Lines(0), 122*cdf0e10cSrcweir nMiddleLine(0xFFFF), 123*cdf0e10cSrcweir cOrthoForm(0) 124*cdf0e10cSrcweir {} 125*cdf0e10cSrcweir 126*cdf0e10cSrcweir Point& ImpGetLineVersatzPoint(SdrEdgeLineCode eLineCode); 127*cdf0e10cSrcweir const Point& ImpGetLineVersatzPoint(SdrEdgeLineCode eLineCode) const { return ((SdrEdgeInfoRec*)this)->ImpGetLineVersatzPoint(eLineCode); } 128*cdf0e10cSrcweir sal_uInt16 ImpGetPolyIdx(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const; 129*cdf0e10cSrcweir FASTBOOL ImpIsHorzLine(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const; 130*cdf0e10cSrcweir void ImpSetLineVersatz(SdrEdgeLineCode eLineCode, const XPolygon& rXP, long nVal); 131*cdf0e10cSrcweir long ImpGetLineVersatz(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const; 132*cdf0e10cSrcweir }; 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir //************************************************************ 135*cdf0e10cSrcweir // Hilfsklasse SdrEdgeObjGeoData 136*cdf0e10cSrcweir //************************************************************ 137*cdf0e10cSrcweir 138*cdf0e10cSrcweir class SdrEdgeObjGeoData : public SdrTextObjGeoData 139*cdf0e10cSrcweir { 140*cdf0e10cSrcweir public: 141*cdf0e10cSrcweir SdrObjConnection aCon1; // Verbindungszustand des Linienanfangs 142*cdf0e10cSrcweir SdrObjConnection aCon2; // Verbindungszustand des Linienendes 143*cdf0e10cSrcweir XPolygon* pEdgeTrack; 144*cdf0e10cSrcweir sal_Bool bEdgeTrackDirty;// sal_True=Verbindungsverlauf muss neu berechnet werden. 145*cdf0e10cSrcweir sal_Bool bEdgeTrackUserDefined; 146*cdf0e10cSrcweir SdrEdgeInfoRec aEdgeInfo; 147*cdf0e10cSrcweir 148*cdf0e10cSrcweir public: 149*cdf0e10cSrcweir SdrEdgeObjGeoData(); 150*cdf0e10cSrcweir virtual ~SdrEdgeObjGeoData(); 151*cdf0e10cSrcweir }; 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir //************************************************************ 154*cdf0e10cSrcweir // Hilfsklasse SdrEdgeObj 155*cdf0e10cSrcweir //************************************************************ 156*cdf0e10cSrcweir 157*cdf0e10cSrcweir class SVX_DLLPUBLIC SdrEdgeObj : public SdrTextObj 158*cdf0e10cSrcweir { 159*cdf0e10cSrcweir private: 160*cdf0e10cSrcweir // to allow sdr::properties::ConnectorProperties access to ImpSetAttrToEdgeInfo() 161*cdf0e10cSrcweir friend class sdr::properties::ConnectorProperties; 162*cdf0e10cSrcweir 163*cdf0e10cSrcweir friend class SdrCreateView; 164*cdf0e10cSrcweir friend class ImpEdgeHdl; 165*cdf0e10cSrcweir 166*cdf0e10cSrcweir protected: 167*cdf0e10cSrcweir virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); 168*cdf0e10cSrcweir virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); 169*cdf0e10cSrcweir 170*cdf0e10cSrcweir SdrObjConnection aCon1; // Verbindungszustand des Linienanfangs 171*cdf0e10cSrcweir SdrObjConnection aCon2; // Verbindungszustand des Linienendes 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir XPolygon* pEdgeTrack; 174*cdf0e10cSrcweir sal_uInt16 nNotifyingCount; // Verrieglung 175*cdf0e10cSrcweir SdrEdgeInfoRec aEdgeInfo; 176*cdf0e10cSrcweir 177*cdf0e10cSrcweir // bitfield 178*cdf0e10cSrcweir unsigned bEdgeTrackDirty : 1; // sal_True=Verbindungsverlauf muss neu berechnet werden. 179*cdf0e10cSrcweir unsigned bEdgeTrackUserDefined : 1; 180*cdf0e10cSrcweir 181*cdf0e10cSrcweir // #109007# 182*cdf0e10cSrcweir // Bool to allow supporession of default connects at object 183*cdf0e10cSrcweir // inside test (HitTest) and object center test (see ImpFindConnector()) 184*cdf0e10cSrcweir unsigned mbSuppressDefaultConnect : 1; 185*cdf0e10cSrcweir 186*cdf0e10cSrcweir // #110649# 187*cdf0e10cSrcweir // Flag value for avoiding death loops when calculating BoundRects 188*cdf0e10cSrcweir // from circularly connected connectors. A coloring algorythm is used 189*cdf0e10cSrcweir // here. When the GetCurrentBoundRect() calculation of a SdrEdgeObj 190*cdf0e10cSrcweir // is running, the flag is set, else it is always sal_False. 191*cdf0e10cSrcweir unsigned mbBoundRectCalculationRunning : 1; 192*cdf0e10cSrcweir 193*cdf0e10cSrcweir public: 194*cdf0e10cSrcweir // #109007# 195*cdf0e10cSrcweir // Interface to default connect suppression 196*cdf0e10cSrcweir void SetSuppressDefaultConnect(sal_Bool bNew) { mbSuppressDefaultConnect = bNew; } 197*cdf0e10cSrcweir sal_Bool GetSuppressDefaultConnect() const { return mbSuppressDefaultConnect; } 198*cdf0e10cSrcweir 199*cdf0e10cSrcweir // #110649# 200*cdf0e10cSrcweir sal_Bool IsBoundRectCalculationRunning() const { return mbBoundRectCalculationRunning; } 201*cdf0e10cSrcweir 202*cdf0e10cSrcweir protected: 203*cdf0e10cSrcweir virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint); 204*cdf0e10cSrcweir 205*cdf0e10cSrcweir XPolygon ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, const Rectangle& rRect, const Point& rCenter) const; 206*cdf0e10cSrcweir void ImpRecalcEdgeTrack(); // Neuberechnung des Verbindungsverlaufs 207*cdf0e10cSrcweir XPolygon ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& rCon1, SdrObjConnection& rCon2, SdrEdgeInfoRec* pInfo) const; 208*cdf0e10cSrcweir XPolygon ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rectangle& rBoundRect1, const Rectangle& rBewareRect1, 209*cdf0e10cSrcweir const Point& rPt2, long nAngle2, const Rectangle& rBoundRect2, const Rectangle& rBewareRect2, 210*cdf0e10cSrcweir sal_uIntPtr* pnQuality, SdrEdgeInfoRec* pInfo) const; 211*cdf0e10cSrcweir static FASTBOOL ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut=NULL); 212*cdf0e10cSrcweir sal_uInt16 ImpCalcEscAngle(SdrObject* pObj, const Point& aPt2) const; 213*cdf0e10cSrcweir FASTBOOL ImpStripPolyPoints(XPolygon& rXP) const; // entfernen ueberfluessiger Punkte 214*cdf0e10cSrcweir void ImpSetTailPoint(FASTBOOL bTail1, const Point& rPt); 215*cdf0e10cSrcweir void ImpUndirtyEdgeTrack(); // eventuelle Neuberechnung des Verbindungsverlaufs 216*cdf0e10cSrcweir void ImpDirtyEdgeTrack(); // invalidate connector path, so it will be recalculated next time 217*cdf0e10cSrcweir void ImpSetAttrToEdgeInfo(); // Werte vom Pool nach aEdgeInfo kopieren 218*cdf0e10cSrcweir void ImpSetEdgeInfoToAttr(); // Werte vom aEdgeInfo in den Pool kopieren 219*cdf0e10cSrcweir 220*cdf0e10cSrcweir public: 221*cdf0e10cSrcweir TYPEINFO(); 222*cdf0e10cSrcweir 223*cdf0e10cSrcweir SdrEdgeObj(); 224*cdf0e10cSrcweir virtual ~SdrEdgeObj(); 225*cdf0e10cSrcweir 226*cdf0e10cSrcweir SdrObjConnection& GetConnection(FASTBOOL bTail1) { return *(bTail1 ? &aCon1 : &aCon2); } 227*cdf0e10cSrcweir virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; 228*cdf0e10cSrcweir virtual sal_uInt16 GetObjIdentifier() const; 229*cdf0e10cSrcweir virtual const Rectangle& GetCurrentBoundRect() const; 230*cdf0e10cSrcweir virtual const Rectangle& GetSnapRect() const; 231*cdf0e10cSrcweir virtual FASTBOOL IsNode() const; 232*cdf0e10cSrcweir virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const; 233*cdf0e10cSrcweir virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const; 234*cdf0e10cSrcweir virtual const SdrGluePointList* GetGluePointList() const; 235*cdf0e10cSrcweir virtual SdrGluePointList* ForceGluePointList(); 236*cdf0e10cSrcweir virtual FASTBOOL IsEdge() const; 237*cdf0e10cSrcweir 238*cdf0e10cSrcweir // bTail1=TRUE: Linienanfang, sonst LinienEnde 239*cdf0e10cSrcweir // pObj=NULL: Disconnect 240*cdf0e10cSrcweir void SetEdgeTrackDirty() { bEdgeTrackDirty=sal_True; } 241*cdf0e10cSrcweir void ConnectToNode(FASTBOOL bTail1, SdrObject* pObj); 242*cdf0e10cSrcweir void DisconnectFromNode(FASTBOOL bTail1); 243*cdf0e10cSrcweir SdrObject* GetConnectedNode(FASTBOOL bTail1) const; 244*cdf0e10cSrcweir const SdrObjConnection& GetConnection(FASTBOOL bTail1) const { return *(bTail1 ? &aCon1 : &aCon2); } 245*cdf0e10cSrcweir FASTBOOL CheckNodeConnection(FASTBOOL bTail1) const; 246*cdf0e10cSrcweir 247*cdf0e10cSrcweir virtual void RecalcSnapRect(); 248*cdf0e10cSrcweir virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const; 249*cdf0e10cSrcweir virtual void operator=(const SdrObject& rObj); 250*cdf0e10cSrcweir virtual void TakeObjNameSingul(String& rName) const; 251*cdf0e10cSrcweir virtual void TakeObjNamePlural(String& rName) const; 252*cdf0e10cSrcweir 253*cdf0e10cSrcweir void SetEdgeTrackPath( const basegfx::B2DPolyPolygon& rPoly ); 254*cdf0e10cSrcweir basegfx::B2DPolyPolygon GetEdgeTrackPath() const; 255*cdf0e10cSrcweir 256*cdf0e10cSrcweir virtual basegfx::B2DPolyPolygon TakeXorPoly() const; 257*cdf0e10cSrcweir virtual sal_uInt32 GetHdlCount() const; 258*cdf0e10cSrcweir virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const; 259*cdf0e10cSrcweir 260*cdf0e10cSrcweir // special drag methods 261*cdf0e10cSrcweir virtual bool hasSpecialDrag() const; 262*cdf0e10cSrcweir virtual bool beginSpecialDrag(SdrDragStat& rDrag) const; 263*cdf0e10cSrcweir virtual bool applySpecialDrag(SdrDragStat& rDrag); 264*cdf0e10cSrcweir virtual String getSpecialDragComment(const SdrDragStat& rDrag) const; 265*cdf0e10cSrcweir 266*cdf0e10cSrcweir // FullDrag support 267*cdf0e10cSrcweir virtual SdrObject* getFullDragClone() const; 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir virtual void NbcSetSnapRect(const Rectangle& rRect); 270*cdf0e10cSrcweir virtual void NbcMove(const Size& aSize); 271*cdf0e10cSrcweir virtual void NbcResize(const Point& rRefPnt, const Fraction& aXFact, const Fraction& aYFact); 272*cdf0e10cSrcweir 273*cdf0e10cSrcweir // #102344# Added missing implementation 274*cdf0e10cSrcweir virtual void NbcSetAnchorPos(const Point& rPnt); 275*cdf0e10cSrcweir 276*cdf0e10cSrcweir virtual FASTBOOL BegCreate(SdrDragStat& rStat); 277*cdf0e10cSrcweir virtual FASTBOOL MovCreate(SdrDragStat& rStat); 278*cdf0e10cSrcweir virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd); 279*cdf0e10cSrcweir virtual FASTBOOL BckCreate(SdrDragStat& rStat); 280*cdf0e10cSrcweir virtual void BrkCreate(SdrDragStat& rStat); 281*cdf0e10cSrcweir virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; 282*cdf0e10cSrcweir virtual Pointer GetCreatePointer() const; 283*cdf0e10cSrcweir virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier) const; 284*cdf0e10cSrcweir 285*cdf0e10cSrcweir virtual sal_uInt32 GetSnapPointCount() const; 286*cdf0e10cSrcweir virtual Point GetSnapPoint(sal_uInt32 i) const; 287*cdf0e10cSrcweir virtual sal_Bool IsPolyObj() const; 288*cdf0e10cSrcweir virtual sal_uInt32 GetPointCount() const; 289*cdf0e10cSrcweir virtual Point GetPoint(sal_uInt32 i) const; 290*cdf0e10cSrcweir virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i); 291*cdf0e10cSrcweir 292*cdf0e10cSrcweir virtual SdrObjGeoData* NewGeoData() const; 293*cdf0e10cSrcweir virtual void SaveGeoData(SdrObjGeoData& rGeo) const; 294*cdf0e10cSrcweir virtual void RestGeoData(const SdrObjGeoData& rGeo); 295*cdf0e10cSrcweir 296*cdf0e10cSrcweir /** updates edges that are connected to the edges of this object 297*cdf0e10cSrcweir as if the connected objects send a repaint broadcast 298*cdf0e10cSrcweir #103122# 299*cdf0e10cSrcweir */ 300*cdf0e10cSrcweir void Reformat(); 301*cdf0e10cSrcweir 302*cdf0e10cSrcweir // helper methods for the StarOffice api 303*cdf0e10cSrcweir Point GetTailPoint( sal_Bool bTail ) const; 304*cdf0e10cSrcweir void SetTailPoint( sal_Bool bTail, const Point& rPt ); 305*cdf0e10cSrcweir void setGluePointIndex( sal_Bool bTail, sal_Int32 nId = -1 ); 306*cdf0e10cSrcweir sal_Int32 getGluePointIndex( sal_Bool bTail ); 307*cdf0e10cSrcweir 308*cdf0e10cSrcweir virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const; 309*cdf0e10cSrcweir virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon); 310*cdf0e10cSrcweir 311*cdf0e10cSrcweir // for geometry access 312*cdf0e10cSrcweir ::basegfx::B2DPolygon getEdgeTrack() const; 313*cdf0e10cSrcweir 314*cdf0e10cSrcweir // helper method for SdrDragMethod::AddConnectorOverlays. Adds a overlay polygon for 315*cdf0e10cSrcweir // this connector to rResult. 316*cdf0e10cSrcweir basegfx::B2DPolygon ImplAddConnectorOverlay(SdrDragMethod& rDragMethod, bool bTail1, bool bTail2, bool bDetail) const; 317*cdf0e10cSrcweir }; 318*cdf0e10cSrcweir 319*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////// 320*cdf0e10cSrcweir // 321*cdf0e10cSrcweir // Zur Bestimmung der Verlaufslinie werden folgende Item-Parameter des SdrItemPool verwendet: 322*cdf0e10cSrcweir // 323*cdf0e10cSrcweir // sal_uInt16 EdgeFlowAngle Default 9000 (=90.00 Deg), min 0, max 9000 324*cdf0e10cSrcweir // Verlauffreiheitswinkel. 325*cdf0e10cSrcweir // Der Winkel, in dem die Verbindungslinie verlaufen darf. 326*cdf0e10cSrcweir // 327*cdf0e10cSrcweir // sal_uInt16 EdgeEscAngle Default 9000 (=90.00 Deg), min 0, max 9000 328*cdf0e10cSrcweir // Objektaustrittswinkel. 329*cdf0e10cSrcweir // Der Winkel, in dem die Verbindungslinie aus dem Objekt austreten darf. 330*cdf0e10cSrcweir // 331*cdf0e10cSrcweir // sal_Bool EdgeEscAsRay Default FALSE 332*cdf0e10cSrcweir // sal_True= die Verbindungslinie tritt aus dem Obj Strahlenfoermig aus. 333*cdf0e10cSrcweir // Also Winkelvorgabe durch die Strecke ObjMitte/Konnektor. 334*cdf0e10cSrcweir // 335*cdf0e10cSrcweir // sal_Bool EdgeEscUseObjAngle Default FALSE 336*cdf0e10cSrcweir // Objektdrehwinkelberuecksichtigung. 337*cdf0e10cSrcweir // sal_True= Bei der Bestimmung des Objektaustrittswinkels wird der 338*cdf0e10cSrcweir // Drehwinkel des Objekts als Offset beruecksichtigt. 339*cdf0e10cSrcweir // 340*cdf0e10cSrcweir // sal_uIntPtr EdgeFlowDefDist Default 0, min 0, max ? 341*cdf0e10cSrcweir // Das ist der Default-Mindestabstand der bei der Berechnung der 342*cdf0e10cSrcweir // Verbindungslinie zu den angedockten Objekten in logischen Einheiten. 343*cdf0e10cSrcweir // Dieser Abstand wird innerhalb des Objektes "ueberschrieben", sobald 344*cdf0e10cSrcweir // der User an den Linien draggd. Beim Andocken an ein neues Objekt wird 345*cdf0e10cSrcweir // dann jedoch wieder dieser Default verwendet. 346*cdf0e10cSrcweir // 347*cdf0e10cSrcweir // 348*cdf0e10cSrcweir // Allgemeines zu Konnektoren: 349*cdf0e10cSrcweir // 350*cdf0e10cSrcweir // Es gibt Knoten und Kantenobjekte. Zwei Knoten koennen durch eine Kante 351*cdf0e10cSrcweir // miteinander verbunden werden. Ist eine Kante nur an einem Ende an einen 352*cdf0e10cSrcweir // Knoten geklebt, ist das andere Ende auf einer absoluten Position im Doc 353*cdf0e10cSrcweir // fixiert. Ebenso ist es natuerlich auch moeglich, dass eine Kante an beiden 354*cdf0e10cSrcweir // Enden "frei", also nicht mit einem Knotenobjekt verbunden ist. 355*cdf0e10cSrcweir // 356*cdf0e10cSrcweir // Ein Kantenobjekt kann theoretisch auch gleichzeitig Knotenobjekt sein. In 357*cdf0e10cSrcweir // der ersten Version wird das jedoch noch nicht realisiert werden. 358*cdf0e10cSrcweir // 359*cdf0e10cSrcweir // Eine Verbindung zwischen Knoten und Kante kann hergestellt werden durch: 360*cdf0e10cSrcweir // - Interaktives erzeugen eines neuen Kantenobjekts an der SdrView wobei 361*cdf0e10cSrcweir // Anfangs- bzw. Endpunkt der Kante auf ein Konnektor (Klebestelle) eines 362*cdf0e10cSrcweir // bereits vorhandenen Knotenobjekts gelegt wird. 363*cdf0e10cSrcweir // - Interaktives draggen des Anfangs- bzw. Endpunkts eines bestehenden 364*cdf0e10cSrcweir // Kantenobjekts an der SdrView auf ein Konnektor (Klebestelle) eines 365*cdf0e10cSrcweir // bereits vorhandenen Knotenobjekts. 366*cdf0e10cSrcweir // - Undo/Redo 367*cdf0e10cSrcweir // Verschieben von Knotenobjekten stellt keine Verbindungen her. Ebenso auch 368*cdf0e10cSrcweir // nicht das direkte Verschieben von Kantenendpunkten am SdrModel... 369*cdf0e10cSrcweir // Verbindungen koennen auch hergestellt werden, wenn die Konnektoren an der 370*cdf0e10cSrcweir // View nicht sichtbar geschaltet sind. 371*cdf0e10cSrcweir // 372*cdf0e10cSrcweir // Eine vorhandene Verbindung zwischen Knoten und Kante bleibt erhalten bei: 373*cdf0e10cSrcweir // - Draggen (Move/Resize/Rotate/...) des Knotenobjekts 374*cdf0e10cSrcweir // - Verschieben einer Konnektorposition im Knotemobjekt 375*cdf0e10cSrcweir // - gleichzeitiges Draggen (Move/Resize/Rotate/...) von Knoten und Kante 376*cdf0e10cSrcweir // 377*cdf0e10cSrcweir // Eine Verbindung zwischen Knoten und Kante kann geloesst werden durch: 378*cdf0e10cSrcweir // - Loeschen eines der Objekte 379*cdf0e10cSrcweir // - Draggen des Kantenobjekts ohne gleichzeitiges Draggen des Knotens 380*cdf0e10cSrcweir // - Loeschen des Konnektors am Knotenobjekt 381*cdf0e10cSrcweir // - Undo/Redo/Repeat 382*cdf0e10cSrcweir // Beim Draggen muss die Aufforderung zum loesen der Verbindung von ausserhalb 383*cdf0e10cSrcweir // des Models befohlen werden (z.B. von der SdrView). SdrEdgeObj::Move() loesst 384*cdf0e10cSrcweir // die Verbindung nicht selbsttaetig. 385*cdf0e10cSrcweir // 386*cdf0e10cSrcweir // Jedes Knotenobjekt kann Konnektoren, sog. Klebestellen besitzen. Das sind die 387*cdf0e10cSrcweir // geometrischen Punkte, an denen das verbindende Kantenobjekt bei hergestellter 388*cdf0e10cSrcweir // Verbindung endet. Defaultmaessig hat jedes Objekt keine Konnektoren. Trotzdem 389*cdf0e10cSrcweir // kann man bei bestimmten View-Einstellungen eine Kante andocken, da dann z.B. 390*cdf0e10cSrcweir // an den 4 Scheitelpunkten des Knotenobjekts bei Bedarf automatisch Konnektoren 391*cdf0e10cSrcweir // generiert werden. Jedes Objekt liefert dafuer 2x4 sog. Default-Konnektorposi- 392*cdf0e10cSrcweir // tionen, 4 an den Scheitelpunkten und 4 an den Eckpositionen. Im Normalfall 393*cdf0e10cSrcweir // liegen diese an den 8 Handlepositionen; Ausnahmen bilden hier Ellipsen, 394*cdf0e10cSrcweir // Parallelogramme, ... . Darueberhinaus koennen auch an jedem Knotenobjekt 395*cdf0e10cSrcweir // anwenderspeziefische Konnektoren gesetzt werden. 396*cdf0e10cSrcweir // 397*cdf0e10cSrcweir // Dann gibt es noch die Moeglichkeit, ein Kante an einem Objekt mit dem 398*cdf0e10cSrcweir // Attribut "bUseBestConnector" anzudocken. Es wird dann aus dem Angebot der 399*cdf0e10cSrcweir // Konnektoren des Objekts oder/und der Scheitelpunkte, jeweils die fuer den 400*cdf0e10cSrcweir // Verlauf der Verbindungslinie guenstigste Konnektorposition verwendet. Der 401*cdf0e10cSrcweir // Anwender vergibt dieses Attribut, indem er den Knoten in seiner Mitte 402*cdf0e10cSrcweir // andockt (siehe z.B. Visio). 403*cdf0e10cSrcweir // 09-06-1996: bUseBestConnector verwendet nur Scheitelpunktklebepunkte. 404*cdf0e10cSrcweir // 405*cdf0e10cSrcweir // Und hier noch etwas Begriffsdefinition: 406*cdf0e10cSrcweir // Verbinder : Eben das Verbinderobjekt (Kantenobjekt) 407*cdf0e10cSrcweir // Knoten : Ein beliebiges Objekt, an dem ein Verbinder drangeklebt 408*cdf0e10cSrcweir // werden kann, z.B. ein Rechteck, ... 409*cdf0e10cSrcweir // Klebepunkt: Der Punkt, an dem der Verbinder an das Knotenobjekt 410*cdf0e10cSrcweir // geklebt wird. Hierbei gibt es: 411*cdf0e10cSrcweir // Scheitelpunktklebepunkte: Jedes Knotenobjekt hat diese 412*cdf0e10cSrcweir // Klebepunkte von Natur aus. Moeglicherweise gibt es 413*cdf0e10cSrcweir // im Draw bereits die Option "Automatisch ankleben an 414*cdf0e10cSrcweir // Objektscheitelpunkte" (default an) 415*cdf0e10cSrcweir // Eckpunktklebepunkte: Auch diese Klebepunkte sind den 416*cdf0e10cSrcweir // Objekten von mir bereits mitgegeben. Wie die oben 417*cdf0e10cSrcweir // erwaehnten gibt es fuer diese moeglicherweise 418*cdf0e10cSrcweir // bereits auch eine Option im Draw. (default aus) 419*cdf0e10cSrcweir // Scheitelpunktklebepunkte und Eckpunktklebepunkte sind 420*cdf0e10cSrcweir // im Gegensatz zu Visio nicht optisch sichtbar; sie 421*cdf0e10cSrcweir // sind eben einfach da (wenn Option eingeschaltet). 422*cdf0e10cSrcweir // Benutzerdefinierte Klebepunkte: Gibt es an jedem 423*cdf0e10cSrcweir // Knotenobjekt beliebig viele. Per Option koennen sie 424*cdf0e10cSrcweir // sichtbar geschaltet werden (beim editieren immer 425*cdf0e10cSrcweir // sichtbar). Zur Zeit sind die jedoch noch nicht ganz 426*cdf0e10cSrcweir // fertigimplementiert. 427*cdf0e10cSrcweir // Automatische Klebepunktwahl: Wird der Verbinder so an 428*cdf0e10cSrcweir // das Knotenobjekt gedockt, dass der schwarke Rahmen 429*cdf0e10cSrcweir // das gesamte Objekt umfasst, so versucht der 430*cdf0e10cSrcweir // Verbinder von den 4 Scheitelpunktklebepunkten (und 431*cdf0e10cSrcweir // zwar nur von denen) den guenstigsten herauszufinden. 432*cdf0e10cSrcweir // 433*cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////// 434*cdf0e10cSrcweir 435*cdf0e10cSrcweir #endif //_SVDOEDGE_HXX 436*cdf0e10cSrcweir 437