src/GraphLib/Renderer.cpp
// coordinates for potential connection coordinates from/to the objects
coordinates for potential connection coordinates from/to the objects
coordinates for potential connection coordinates from / to the objects
void Renderer::GetConnectionPoints(const Node& obj1, const Node& obj2, Vector<Point>& pts) {
	Rect bb1 = obj1.GetBoundingBox();
	Rect bb2 = obj2.GetBoundingBox();
	int bb1_width = bb1.GetWidth();
	int bb2_width = bb2.GetWidth();
	int bb1_height = bb1.GetHeight();
	int bb2_height = bb2.GetHeight();
	int bb1_x = bb1.left;
	int bb2_x = bb2.left;
	int bb1_y = bb1.top;
	int bb2_y = bb2.top;
	int off1 = 0;
	int off2 = 0;
	pts.SetCount(8);
	pts[0] = Point(bb1_x + bb1_width / 2, bb1_y - off1);
	pts[1] = Point(bb1_x + bb1_width / 2, bb1_y + bb1_height + off1);
	pts[2] = Point(bb1_x - off1, bb1_y + bb1_height / 2 );
	pts[3] = Point(bb1_x + bb1_width + off1, bb1_y + bb1_height / 2 );
	pts[4] = Point(bb2_x + bb2_width / 2, bb2_y - off2 );
	pts[5] = Point(bb2_x + bb2_width / 2, bb2_y + bb2_height + off2 );
	pts[6] = Point(bb2_x - off2, bb2_y + bb2_height / 2 );
	pts[7] = Point(bb2_x + bb2_width + off2, bb2_y + bb2_height / 2 );
}
void Renderer :: GetConnectionPoints ( const Node & obj1 , const Node & obj2 , Vector < Point > & pts ) { Rect bb1 = obj1 . GetBoundingBox ( ) ; Rect bb2 = obj2 . GetBoundingBox ( ) ; int bb1_width = bb1 . GetWidth ( ) ; int bb2_width = bb2 . GetWidth ( ) ; int bb1_height = bb1 . GetHeight ( ) ; int bb2_height = bb2 . GetHeight ( ) ; int bb1_x = bb1 . left ; int bb2_x = bb2 . left ; int bb1_y = bb1 . top ; int bb2_y = bb2 . top ; int off1 = 0 ; int off2 = 0 ; pts . SetCount ( 8 ) ; pts [ 0 ] = Point ( bb1_x + bb1_width / 2 , bb1_y - off1 ) ; pts [ 1 ] = Point ( bb1_x + bb1_width / 2 , bb1_y + bb1_height + off1 ) ; pts [ 2 ] = Point ( bb1_x - off1 , bb1_y + bb1_height / 2 ) ; pts [ 3 ] = Point ( bb1_x + bb1_width + off1 , bb1_y + bb1_height / 2 ) ; pts [ 4 ] = Point ( bb2_x + bb2_width / 2 , bb2_y - off2 ) ; pts [ 5 ] = Point ( bb2_x + bb2_width / 2 , bb2_y + bb2_height + off2 ) ; pts [ 6 ] = Point ( bb2_x - off2 , bb2_y + bb2_height / 2 ) ; pts [ 7 ] = Point ( bb2_x + bb2_width + off2 , bb2_y + bb2_height / 2 ) ; }
coordinates for potential connection coordinates from/to the objects
coordinates for potential connection coordinates from / to the objects
// get bounding boxes of target and source // NORTH 1 // SOUTH 1 // WEST  1 // EAST  1 // NORTH 2 // SOUTH 2 // WEST  2 // EAST  2