linkablemapobj.h
changeset 479 7a651cb19690
parent 442 dfbc371b7280
child 486 9c86935835a4
     1.1 --- a/linkablemapobj.h	Sat Mar 31 09:28:27 2007 +0000
     1.2 +++ b/linkablemapobj.h	Wed Apr 25 16:02:55 2007 +0000
     1.3 @@ -1,6 +1,7 @@
     1.4  #ifndef LINKABLEMAPOBJ_H
     1.5  #define LINKABLEMAPOBJ_H
     1.6  
     1.7 +#include "animpoint.h"
     1.8  #include "noteobj.h"
     1.9  #include "headingobj.h"
    1.10  #include "flagrowobj.h"
    1.11 @@ -8,20 +9,43 @@
    1.12  
    1.13  #define MAX_DEPTH 999
    1.14  
    1.15 -enum LinkOrient {OrientUndef,OrientLeftOfCenter, OrientRightOfCenter};
    1.16 -enum LinkStyle {
    1.17 -	StyleUndef,
    1.18 -	StyleLine, 
    1.19 -	StyleParabel, 
    1.20 -	StylePolyLine,
    1.21 -	StylePolyParabel
    1.22 -};
    1.23 -enum LinkPos {LinkMiddle,LinkBottom};
    1.24 -enum LinkColorHint {DefaultColor,HeadingColor};
    1.25 +
    1.26 +/*! \brief This class adds links to MapObj 
    1.27 +
    1.28 +The links are connecting the branches (BranchObj) and images (FloatImageObj) in the map.
    1.29 +*/
    1.30  
    1.31  class LinkableMapObj:public QObject, public MapObj {
    1.32  	Q_OBJECT
    1.33  public:
    1.34 +	/*! Orientation of an object dependd on the position relative to the parent */
    1.35 +	enum Orientation {
    1.36 +		UndefinedOrientation, //!< Undefined
    1.37 +		LeftOfCenter,			//!< Object is left of center
    1.38 +		RightOfCenter			//!< Object is right of center
    1.39 +	};
    1.40 +
    1.41 +	/*! Various drawing styles for links */
    1.42 +	enum Style {
    1.43 +		UndefinedStyle,	//!< Undefined
    1.44 +		Line,			//!< Straight line
    1.45 +		Parabel,		//!< Parabel
    1.46 +		PolyLine,		//!< Polygon (thick line)
    1.47 +		PolyParabel		//!< Thick parabel
    1.48 +	};
    1.49 +
    1.50 +	/*! Vertical position of link in object */
    1.51 +	enum Position {
    1.52 +		Middle, //!< Link is drawn in the middle of object
    1.53 +		Bottom  //!< Link is drawn at bottom of object
    1.54 +	};
    1.55 +
    1.56 +	/*! Hint if link should use the default link color or the color of heading */
    1.57 +	enum ColorHint {
    1.58 +		DefaultColor,	//!< Link uses the default color
    1.59 +		HeadingColor	//!< Link uses the color of heading
    1.60 +	};
    1.61 +
    1.62      LinkableMapObj ();
    1.63      LinkableMapObj (QGraphicsScene*);
    1.64      LinkableMapObj (LinkableMapObj*);
    1.65 @@ -45,13 +69,13 @@
    1.66  	virtual qreal getTopPad();
    1.67  	virtual qreal getLeftPad();
    1.68  	virtual qreal getRightPad();
    1.69 -	LinkStyle getDefLinkStyle();
    1.70 -    void setLinkStyle(LinkStyle);            
    1.71 -	LinkStyle getLinkStyle();
    1.72 +	Style getDefLinkStyle();
    1.73 +    void setLinkStyle(Style);            
    1.74 +	Style getLinkStyle();
    1.75  	void setHideLinkUnselected(bool);
    1.76  	bool getHideLinkUnselected();
    1.77 -	void setLinkPos (LinkPos);
    1.78 -	LinkPos getLinkPos ();
    1.79 +	void setLinkPos (Position);
    1.80 +	Position getLinkPos ();
    1.81  
    1.82  	virtual void setLinkColor();					// sets color according to colorhint, overloaded
    1.83  	virtual void setLinkColor(QColor);
    1.84 @@ -67,7 +91,7 @@
    1.85  	virtual void setDockPos()=0;				// sets childPos and parPos
    1.86      QPointF getChildPos();					// returns pos where childs dock
    1.87      QPointF getParPos();						// returns pos where parents dock
    1.88 -    LinkOrient getOrientation();			// get orientation
    1.89 +    Orientation getOrientation();			// get orientation
    1.90      virtual int getDepth();					// return depth
    1.91  	virtual void setMapEditor(MapEditor*);	// set MapEditor (needed in LMO::updateNoteFlag)
    1.92  	virtual MapEditor* getMapEditor();		// get MapEditor (usually from parent);
    1.93 @@ -99,7 +123,7 @@
    1.94  	MapEditor* mapEditor;			// for and toggleScroll(), get default styles
    1.95  									// and mapEditor->updateActions()
    1.96  									// and mapEditor->updateSelection()
    1.97 -    LinkOrient orientation;     
    1.98 +    Orientation orientation;     
    1.99      qreal linkwidth;				// width of a link
   1.100      int depth;						// depth: undef=-1 mapCenter=0 branch=1..n
   1.101  	QRectF bboxTotal;				// bounding box including childs
   1.102 @@ -110,8 +134,8 @@
   1.103      qreal bottomlineY;              // vertical offset of dockpos to pos
   1.104  
   1.105  	int thickness_start;			// for StylePoly*	
   1.106 -    LinkStyle style;				// Current style
   1.107 -	LinkPos linkpos;				// Link at bottom of object or middle of height
   1.108 +    Style style;					// Current style
   1.109 +	Position linkpos;				// Link at bottom of object or middle of height
   1.110      QColor linkcolor;               // Link color
   1.111  	QPen pen;
   1.112      QGraphicsLineItem* l;           // line style
   1.113 @@ -129,7 +153,8 @@
   1.114  	qreal topPad, botPad,
   1.115  		leftPad, rightPad;          // padding within bbox
   1.116  
   1.117 -	QPointF relPos;					// position relative to childPos of parent
   1.118 +	QPointF	 relPos;				// position relative to childPos of parent
   1.119 +	//AnimPoint relPos;				// position relative to childPos of parent
   1.120  	bool useRelPos;
   1.121  	bool useOrientation;
   1.122  };