本文整理汇总了C++中Path::Reset方法的典型用法代码示例。如果您正苦于以下问题:C++ Path::Reset方法的具体用法?C++ Path::Reset怎么用?C++ Path::Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path
的用法示例。
在下文中一共展示了Path::Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestReset
bool TestReset() {
BEGIN_TEST;
PathFixture fixture;
ASSERT_TRUE(fixture.Create());
Path path;
ASSERT_EQ(ZX_OK, path.Push(fixture.path()));
path.Reset();
EXPECT_STR_EQ(path.c_str(), "/");
END_TEST;
}
示例2: set_shape
//.........这里部分代码省略.........
{
o_width = -this->rad;
}
// one has to have a measure of the details
if (o_width >= 1.0)
{
orig->ConvertWithBackData (0.5);
}
else
{
orig->ConvertWithBackData (0.5*o_width);
}
orig->Fill (theShape, 0);
theRes->ConvertToShape (theShape, fill_positive);
Path *originaux[1];
originaux[0]=orig;
Path *res = new Path;
theRes->ConvertToForme (res, 1, originaux);
int nbPart=0;
Path** parts=res->SubPaths(nbPart,true);
char *holes=(char*)malloc(nbPart*sizeof(char));
// we offset contours separately, because we can.
// this way, we avoid doing a unique big ConvertToShape when dealing with big shapes with lots of holes
{
Shape* onePart=new Shape;
Shape* oneCleanPart=new Shape;
theShape->Reset();
for (int i=0; i<nbPart; i++) {
double partSurf=parts[i]->Surface();
parts[i]->Convert(1.0);
{
// raffiner si besoin
double bL,bT,bR,bB;
parts[i]->PolylineBoundingBox(bL,bT,bR,bB);
double mesure=((bR-bL)+(bB-bT))*0.5;
if ( mesure < 10.0 ) {
parts[i]->Convert(0.02*mesure);
}
}
if ( partSurf < 0 ) { // inverse par rapport a la realite
// plein
holes[i]=0;
parts[i]->Fill(oneCleanPart,0);
onePart->ConvertToShape(oneCleanPart,fill_positive); // there aren't intersections in that one, but maybe duplicate points and null edges
oneCleanPart->MakeOffset(onePart,this->rad,join_round,20.0);
onePart->ConvertToShape(oneCleanPart,fill_positive);
onePart->CalcBBox();
double typicalSize=0.5*((onePart->rightX-onePart->leftX)+(onePart->bottomY-onePart->topY));
if ( typicalSize < 0.05 ) {
typicalSize=0.05;
}
typicalSize*=0.01;
开发者ID:NotBrianZach,项目名称:modalComposableProgrammableFuzzySearchingVectorGraphicEditing,代码行数:66,代码来源:sp-offset.cpp