当前位置: 首页>>代码示例>>C++>>正文


C++ PolyLine::setForwardArrowBool方法代码示例

本文整理汇总了C++中PolyLine::setForwardArrowBool方法的典型用法代码示例。如果您正苦于以下问题:C++ PolyLine::setForwardArrowBool方法的具体用法?C++ PolyLine::setForwardArrowBool怎么用?C++ PolyLine::setForwardArrowBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PolyLine的用法示例。


在下文中一共展示了PolyLine::setForwardArrowBool方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char *argv[])
{
	Figure f;

	// get some coordinates ready to use in a lot of objects
	
	Coordinate *a = new Coordinate (500,500);
	Coordinate *b = new Coordinate (1500,1500);

	// draw a polyline

	PolyLine *polyline = new PolyLine(a, b);
	polyline->push_back(new Coordinate(2000,1500));
	polyline->setLineStyle(Attributes::Dotted);
	
	// give the polyline arrows
	
	Arrow arr;
	arr.setType(Arrow::ClosedPointed);
	arr.setStyle(Arrow::Filled);

	polyline->setBackwardArrowBool(1);
	polyline->setBackwardArrow(arr);
	
	polyline->setForwardArrowBool(1);
	polyline->setForwardArrow(arr);
	
	// polyline is ready, keep it in the fig
	
	f.push_back(polyline);
	
	// an example box using the same coordinates

	Box *box = new Box(a, b);
	box->setThickness(2);
	f.push_back(box);
	
	// an ellipse in that box

	RadiiEllipse *re = new RadiiEllipse(new Coordinate(1000, 1000), new Coordinate(500, 200));
	f.push_back(re);
	
	// another ellipse in that box

	DiameterEllipse *de = new DiameterEllipse(new Coordinate(500, 800), new Coordinate(1500, 1200));
	f.push_back(de);
	
	// a circle defined by a radius, in the box

	RadiusCircle *rc = new RadiusCircle(new Coordinate(1000, 1000), 500);
	f.push_back(rc);
	
	// a circle defined by two points defining its radius

	DiameterCircle *dc = new DiameterCircle(a, b);
	f.push_back(dc);
	
	// some text

	Text* text = new Text(new Coordinate(1900, 900), "fig++");
	text->setFontSize(50);
	f.push_back(text);

	// an arc defined by its three defining points
	// first point comes first

	Arc* arc = new Arc(new Coordinate(1000, 1000), new Coordinate(2000, 1000), new Coordinate(2000, 2000));
	f.push_back(arc);
	
	// this is what's useful: putting something on an arbitrary place

	for (float x = 0; x <= 314; x=x+19.625) {
		PolyLine *l = 
			new PolyLine( 
				new Coordinate(
					(int)(1500.0+500.0*cos(x/100)),
					(int)(1500.0+500.0*sin(x/100))
				),
				new Coordinate(
					(int)(1500.0+1000.0*cos(x/100)),
					(int)(1500.0+1000.0*sin(x/100))
				)
			);
		l->setForwardArrowBool(1);
		arr.setType(Arrow::ClosedIntended);
		l->setForwardArrow(arr);
		f.push_back(l);
	}
	
	// a vector of coordinates

	std::vector<Coordinate *> vc;

	vc.push_back( new Coordinate (2500, 500) );
	vc.push_back( new Coordinate (3000, 500) );
	vc.push_back( new Coordinate (3000, 1000) );
	vc.push_back( new Coordinate (3500, 1000) );
	vc.push_back( new Coordinate (3500, 1500) );
	vc.push_back( new Coordinate (3000, 1500) );
	vc.push_back( new Coordinate (3000, 2000) );
//.........这里部分代码省略.........
开发者ID:aliekens,项目名称:cpfig,代码行数:101,代码来源:demo.cpp


注:本文中的PolyLine::setForwardArrowBool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。