本文整理汇总了C++中Board2D::setFillColor方法的典型用法代码示例。如果您正苦于以下问题:C++ Board2D::setFillColor方法的具体用法?C++ Board2D::setFillColor怎么用?C++ Board2D::setFillColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Board2D
的用法示例。
在下文中一共展示了Board2D::setFillColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selfDraw
virtual void selfDraw(Board2D & aboard) const
{
aboard.setFillColor( Color::Red);
aboard.setPenColorRGBi(200,0,0);
aboard.setLineStyle(LibBoard::Shape::SolidStyle);
aboard.setLineWidth( 2 );
}
示例2: main
int main( int argc, char** argv )
{
trace.beginBlock ( "Example exampleBezierCurve" );
trace.info() << "Args:";
for ( int i = 0; i < argc; ++i )
trace.info() << " " << argv[ i ];
trace.info() << endl;
//control points
typedef PointVector<2,int> Point;
Point P(0,0), Q(4,4), R(8,0);
//display
Board2D board;
//with fill
board << SetMode(P.className(), "Grid") << P << Q << R;
board.drawQuadraticBezierCurve(P[0], P[1], Q[0], Q[1], R[0], R[1]);
board.saveSVG("BezierCurve.svg", Board2D::BoundingBox, 5000 );
board.saveEPS("BezierCurve.eps", Board2D::BoundingBox, 5000 );
board.saveTikZ("BezierCurve.tikz", Board2D::BoundingBox, 5000 );
board.saveFIG("BezierCurve.fig", Board2D::BoundingBox, 5000 );
#ifdef WITH_CAIRO
board.saveCairo("BezierCurve.pdf", Board2D::CairoPDF);
#endif
board.clear();
//without fill
board << SetMode(P.className(), "Grid") << P << Q << R;
board.setFillColor(Color::None);
board.drawQuadraticBezierCurve(P[0], P[1], Q[0], Q[1], R[0], R[1]);
board.saveSVG("BezierCurve2.svg", Board2D::BoundingBox, 5000 );
board.saveEPS("BezierCurve2.eps", Board2D::BoundingBox, 5000 );
board.saveTikZ("BezierCurve2.tikz", Board2D::BoundingBox, 5000 );
board.saveFIG("BezierCurve2.fig", Board2D::BoundingBox, 5000 );
#ifdef WITH_CAIRO
board.saveCairo("BezierCurve2.pdf", Board2D::CairoPDF);
#endif
trace.endBlock();
return 0;
}
示例3: aComputer
int
main(int argc, char ** argv){
typedef Z2i::Point Point;
std::vector<Point> contour = PointListReader<Point>::getPointsFromFile("../Samples/contourS.sdp");
Board2D aBoard;
for (auto&& p :contour) {
aBoard << p;
}
aBoard.setPenColor(DGtal::Color::Red);
aBoard.setFillColor(DGtal::Color::Red);
aBoard.drawCircle(contour[30][0], contour[30][1],1);
unsigned int startIndex = 30;
typedef AlphaThickSegmentComputer< Z2i::Point > AlphaThickSegmentComputer2D;
AlphaThickSegmentComputer2D aComputer(5);
aComputer.init(contour.begin()+30);
while(aComputer.extendFront()){
}
aBoard << CustomStyle( aComputer.className(), new CustomColors( DGtal::Color::Blue, DGtal::Color::None ) );
aBoard << aComputer;
aBoard.saveEPS("resultTuto2.eps");
return 0;
}
示例4: 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);
}
}