本文整理汇总了C++中Constraint::DescriptionString方法的典型用法代码示例。如果您正苦于以下问题:C++ Constraint::DescriptionString方法的具体用法?C++ Constraint::DescriptionString怎么用?C++ Constraint::DescriptionString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Constraint
的用法示例。
在下文中一共展示了Constraint::DescriptionString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowStepDimension
void TextWindow::ShowStepDimension(void) {
Constraint *c = SK.constraint.FindByIdNoOops(shown.constraint);
if(!c) {
shown.screen = SCREEN_LIST_OF_GROUPS;
Show();
return;
}
Printf(true, "%FtSTEP DIMENSION%E %s", c->DescriptionString());
if(shown.dimIsDistance) {
Printf(true, "%Ba %Ftstart%E %s", SS.MmToString(c->valA));
Printf(false, "%Bd %Ftfinish%E %s %Fl%Ll%f[change]%E",
SS.MmToString(shown.dimFinish), &ScreenStepDimFinish);
} else {
Printf(true, "%Ba %Ftstart%E %@", c->valA);
Printf(false, "%Bd %Ftfinish%E %@ %Fl%Ll%f[change]%E",
shown.dimFinish, &ScreenStepDimFinish);
}
Printf(false, "%Ba %Ftsteps%E %d %Fl%Ll%f%D[change]%E",
shown.dimSteps, &ScreenStepDimSteps);
Printf(true, " %Fl%Ll%fstep dimension now%E", &ScreenStepDimGo);
Printf(true, "(or %Fl%Ll%fcancel operation%E)", &ScreenHome);
}
示例2: ShowGroupSolveInfo
//-----------------------------------------------------------------------------
// The screen that's displayed when the sketch fails to solve. A report of
// what failed, and (if the problem is a singular Jacobian) a list of
// constraints that could be removed to fix it.
//-----------------------------------------------------------------------------
void TextWindow::ShowGroupSolveInfo(void) {
Group *g = SK.group.FindById(shown.group);
if(g->solved.how == System::SOLVED_OKAY) {
// Go back to the default group info screen
shown.screen = SCREEN_GROUP_INFO;
Show();
return;
}
Printf(true, "%FtGROUP %E%s", g->DescriptionString());
switch(g->solved.how) {
case System::DIDNT_CONVERGE:
Printf(true, "%FxSOLVE FAILED!%Fd no convergence");
Printf(true, "the following constraints are unsatisfied");
break;
case System::SINGULAR_JACOBIAN:
Printf(true, "%FxSOLVE FAILED!%Fd inconsistent system");
Printf(true, "remove any one of these to fix it");
break;
case System::TOO_MANY_UNKNOWNS:
Printf(true, "Too many unknowns in a single group!");
return;
}
for(int i = 0; i < g->solved.remove.n; i++) {
hConstraint hc = g->solved.remove.elem[i];
Constraint *c = SK.constraint.FindByIdNoOops(hc);
if(!c) continue;
Printf(false, "%Bp %Fl%Ll%D%f%h%s%E",
(i & 1) ? 'd' : 'a',
c->h.v, (&TextWindow::ScreenSelectConstraint),
(&TextWindow::ScreenHoverConstraint),
c->DescriptionString());
}
Printf(true, "It may be possible to fix the problem ");
Printf(false, "by selecting Edit -> Undo.");
}
示例3: ShowGroupInfo
void TextWindow::ShowGroupInfo(void) {
Group *pg, *g = SK.group.FindById(shown.group);
const char *s = "???";
if(shown.group.v == Group::HGROUP_REFERENCES.v) {
Printf(true, "%FtGROUP %E%s", g->DescriptionString());
goto list_items;
} else {
Printf(true, "%FtGROUP %E%s [%Fl%Ll%D%frename%E/%Fl%Ll%D%fdel%E]",
g->DescriptionString(),
g->h.v, &TextWindow::ScreenChangeGroupName,
g->h.v, &TextWindow::ScreenDeleteGroup);
}
if(g->type == Group::LATHE) {
Printf(true, " %Ftlathe plane sketch");
} else if(g->type == Group::EXTRUDE || g->type == Group::ROTATE ||
g->type == Group::TRANSLATE)
{
if(g->type == Group::EXTRUDE) {
s = "extrude plane sketch";
} else if(g->type == Group::TRANSLATE) {
s = "translate original sketch";
} else if(g->type == Group::ROTATE) {
s = "rotate original sketch";
}
Printf(true, " %Ft%s%E", s);
bool one = (g->subtype == Group::ONE_SIDED);
Printf(false,
"%Ba %f%Ls%Fd%c one-sided%E "
"%f%LS%Fd%c two-sided%E",
&TextWindow::ScreenChangeGroupOption,
one ? RADIO_TRUE : RADIO_FALSE,
&TextWindow::ScreenChangeGroupOption,
!one ? RADIO_TRUE : RADIO_FALSE);
if(g->type == Group::ROTATE || g->type == Group::TRANSLATE) {
if(g->subtype == Group::ONE_SIDED) {
bool skip = g->skipFirst;
Printf(false,
"%Bd %Ftstart %f%LK%Fd%c with original%E "
"%f%Lk%Fd%c with copy #1%E",
&ScreenChangeGroupOption,
!skip ? RADIO_TRUE : RADIO_FALSE,
&ScreenChangeGroupOption,
skip ? RADIO_TRUE : RADIO_FALSE);
}
int times = (int)(g->valA);
Printf(false, "%Bp %Ftrepeat%E %d time%s %Fl%Ll%D%f[change]%E",
(g->subtype == Group::ONE_SIDED) ? 'a' : 'd',
times, times == 1 ? "" : "s",
g->h.v, &TextWindow::ScreenChangeExprA);
}
} else if(g->type == Group::IMPORTED) {
Printf(true, " %Ftimport geometry from file%E");
Printf(false, "%Ba '%s'", g->impFileRel.c_str());
Printf(false, "%Bd %Ftscaled by%E %# %Fl%Ll%f%D[change]%E",
g->scale,
&TextWindow::ScreenChangeGroupScale, g->h.v);
} else if(g->type == Group::DRAWING_3D) {
Printf(true, " %Ftsketch in 3d%E");
} else if(g->type == Group::DRAWING_WORKPLANE) {
Printf(true, " %Ftsketch in new workplane%E");
} else {
Printf(true, "???");
}
Printf(false, "");
if(g->type == Group::EXTRUDE ||
g->type == Group::LATHE ||
g->type == Group::IMPORTED)
{
bool un = (g->meshCombine == Group::COMBINE_AS_UNION);
bool diff = (g->meshCombine == Group::COMBINE_AS_DIFFERENCE);
bool asy = (g->meshCombine == Group::COMBINE_AS_ASSEMBLE);
bool asa = (g->type == Group::IMPORTED);
Printf(false, " %Ftsolid model as");
Printf(false, "%Ba %f%D%Lc%Fd%c union%E "
"%f%D%Lc%Fd%c difference%E "
"%f%D%Lc%Fd%c%s%E ",
&TextWindow::ScreenChangeGroupOption,
Group::COMBINE_AS_UNION,
un ? RADIO_TRUE : RADIO_FALSE,
&TextWindow::ScreenChangeGroupOption,
Group::COMBINE_AS_DIFFERENCE,
diff ? RADIO_TRUE : RADIO_FALSE,
&TextWindow::ScreenChangeGroupOption,
Group::COMBINE_AS_ASSEMBLE,
asa ? (asy ? RADIO_TRUE : RADIO_FALSE) : 0,
asa ? " assemble" : "");
if(g->type == Group::EXTRUDE ||
g->type == Group::LATHE)
{
Printf(false,
"%Bd %Ftcolor %E%Bp %Bd (%@, %@, %@) %f%D%Lf%Fl[change]%E",
0x80000000 | g->color,
//.........这里部分代码省略.........