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