本文整理汇总了C++中Board2D::setLineStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ Board2D::setLineStyle方法的具体用法?C++ Board2D::setLineStyle怎么用?C++ Board2D::setLineStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Board2D
的用法示例。
在下文中一共展示了Board2D::setLineStyle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selfDraw
virtual void selfDraw(Board2D & aboard) const
{
aboard.setFillColorRGBi(150, 150, 160);
aboard.setPenColorRGBi(150, 150, 160);
aboard.setLineStyle(Board2D::Shape::DashStyle);
aboard.setLineWidth( 1.0 );
}
示例2: selfDraw
virtual void selfDraw(Board2D & aboard) const
{
aboard.setFillColor( myColor );
aboard.setPenColorRGBi( 0, 0, 0 );
aboard.setLineStyle( LibBoard::Shape::SolidStyle );
aboard.setLineWidth( 1.0 );
}
示例3: main
//.........这里部分代码省略.........
}
}
if(vm.count("SDP") || vm.count("SFP")) {
bool drawPoints= vm.count("drawContourPoint");
bool invertYaxis = vm.count("invertYaxis");
double pointSize=1.0;
if(drawPoints) {
pointSize = vm["drawContourPoint"].as<double>();
}
std::vector<LibBoard::Point> contourPt;
if(vm.count("SDP")) {
std::string fileName = vm["SDP"].as<std::string>();
std::vector< Z2i::Point > contour =
PointListReader< Z2i::Point >::getPointsFromFile(fileName);
for(unsigned int j=0; j<contour.size(); j++) {
LibBoard::Point pt((double)(contour.at(j)[0]),
(invertYaxis? (double)(-contour.at(j)[1]+contour.at(0)[1]):(double)(contour.at(j)[1])));
contourPt.push_back(pt);
if(drawPoints) {
aBoard.fillCircle(pt.x, pt.y, pointSize);
}
}
}
if(vm.count("SFP")) {
std::string fileName = vm["SFP"].as<std::string>();
std::vector< PointVector<2,double> > contour =
PointListReader< PointVector<2,double> >::getPointsFromFile(fileName);
for(unsigned int j=0; j<contour.size(); j++) {
LibBoard::Point pt((double)(contour.at(j)[0]),
(invertYaxis? (double)(-contour.at(j)[1]+contour.at(0)[1]):(double)(contour.at(j)[1])));
contourPt.push_back(pt);
if(drawPoints) {
aBoard.fillCircle(pt.x, pt.y, pointSize);
}
}
}
aBoard.setPenColor(Color::Red);
aBoard.setFillColor(Color::Gray);
aBoard.setLineStyle (LibBoard::Shape::SolidStyle );
aBoard.setLineWidth (lineWidth);
if(!filled) {
aBoard.drawPolyline(contourPt);
} else {
aBoard.fillPolyline(contourPt);
}
if(vm.count("drawPointOfIndex")) {
int index = vm["drawPointOfIndex"].as<int>();
double size = vm["pointSize"].as<double>();
aBoard.fillCircle((double)(contourPt.at(index).x), (double)(contourPt.at(index).y), size);
}
}
if(vm.count("outputFile")) {
std::string outputFileName= vm["outputFile"].as<std::string>();
std::string extension = outputFileName.substr(outputFileName.find_last_of(".") + 1);
if(extension=="svg") {
aBoard.saveSVG(outputFileName.c_str());
}
#ifdef WITH_CAIRO
else if (extension=="eps") {
aBoard.saveCairo(outputFileName.c_str(),Board2D::CairoEPS );
} else if (extension=="pdf") {
aBoard.saveCairo(outputFileName.c_str(),Board2D::CairoPDF );
} else if (extension=="png") {
aBoard.saveCairo(outputFileName.c_str(),Board2D::CairoPNG );
}
#endif
else if(extension=="eps") {
aBoard.saveEPS(outputFileName.c_str());
} else if(extension=="fig") {
aBoard.saveFIG(outputFileName.c_str(),LibBoard::Board::BoundingBox, 10.0, !vm.count("noXFIGHeader") );
}
}
if (vm.count("outputStreamSVG")) {
aBoard.saveSVG(std::cout);
} else if (vm.count("outputStreamFIG")) {
aBoard.saveFIG(std::cout, LibBoard::Board::BoundingBox, 10.0, !vm.count("noXFIGHeader"));
} else if (vm.count("outputStreamEPS")) {
aBoard.saveEPS(std::cout);
}
}
示例4: main
//.........这里部分代码省略.........
if(args.check("-backgroundImageXFIG")){
string imageName = args.getOption("-backgroundImageXFIG")->getValue(0);
unsigned int width = args.getOption("-backgroundImageXFIG")->getIntValue(1);
unsigned int height = args.getOption("-backgroundImageXFIG")->getIntValue(2);
aBoard.drawImage(imageName, 0,height-1, width, height, -1, 1.0 );
}
if(args.check("-fc")){
string fileName = args.getOption("-fc")->getValue(0);
vector< FreemanChain<int> > vectFc = PointListReader< Z2i::Point>:: getFreemanChainsFromFile<int> (fileName);
//aBoard << SetMode( vectFc.at(0).className(), "InterGrid" );
aBoard << CustomStyle( vectFc.at(0).className(),
new CustomColors( Color::Red , (filled ? (Color::Black) : (Color::None)) ) );
for(unsigned int i=0; i<vectFc.size(); i++){
aBoard << vectFc.at(i) ;
}
}
if( args.check("-sdp") || args.check("-sfp")){
bool drawPoints= args.check("-drawContourPoint");
bool invertYaxis = args.check("-invertYaxis");
double pointSize = args.getOption("-drawContourPoint")->getFloatValue(0);
vector<LibBoard::Point> contourPt;
if(args.check("-sdp")){
string fileName = args.getOption("-sdp")->getValue(0);
vector< Z2i::Point > contour =
PointListReader< Z2i::Point >::getPointsFromFile(fileName);
for(unsigned int j=0; j<contour.size(); j++){
LibBoard::Point pt((double)(contour.at(j)[0]),
(invertYaxis? (double)(-contour.at(j)[1]+contour.at(0)[1]):(double)(contour.at(j)[1])));
contourPt.push_back(pt);
if(drawPoints){
aBoard.fillCircle(pt.x, pt.y, pointSize);
}
}
}
if(args.check("-sfp")){
string fileName = args.getOption("-sfp")->getValue(0);
vector< PointVector<2,double> > contour =
PointListReader< PointVector<2,double> >::getPointsFromFile(fileName);
for(unsigned int j=0; j<contour.size(); j++){
LibBoard::Point pt((double)(contour.at(j)[0]),
(invertYaxis? (double)(-contour.at(j)[1]+contour.at(0)[1]):(double)(contour.at(j)[1])));
contourPt.push_back(pt);
if(drawPoints){
aBoard.fillCircle(pt.x, pt.y, pointSize);
}
}
}
aBoard.setPenColor(Color::Red);
aBoard.setLineStyle (LibBoard::Shape::SolidStyle );
aBoard.setLineWidth (lineWidth);
if(!filled){
aBoard.drawPolyline(contourPt);
}else{
aBoard.fillPolyline(contourPt);
}
}
if (args.check("-outputSVG")){
string outputFileName= args.getOption("-outputSVG")->getValue(0);
aBoard.saveSVG(outputFileName.c_str());
} else
if (args.check("-outputFIG")){
string outputFileName= args.getOption("-outputFIG")->getValue(0);
aBoard.saveFIG(outputFileName.c_str());
} else
if (args.check("-outputEPS")){
string outputFileName= args.getOption("-outputEPS")->getValue(0);
aBoard.saveEPS(outputFileName.c_str());
}
#ifdef WITH_CAIRO
else
if (args.check("-outputEPS")){
string outputFileName= args.getOption("-outputSVG")->getValue(0);
aBoard.saveCairo(outputFileName.c_str(),Board2D::CairoEPS );
} else
if (args.check("-outputPDF")){
string outputFileName= args.getOption("-outputPDF")->getValue(0);
aBoard.saveCairo(outputFileName.c_str(),Board2D::CairoPDF );
} else
if (args.check("-outputPNG")){
string outputFileName= args.getOption("-outputPNG")getValue(0);
aBoard.saveCairo(outputFileName.c_str(),Board2D::CairoPNG );
}
#endif
else { //default output
string outputFileName= "output.eps";
aBoard.saveEPS(outputFileName.c_str());
}
}