本文整理汇总了C++中BrowserClass::nestedp方法的典型用法代码示例。如果您正苦于以下问题:C++ BrowserClass::nestedp方法的具体用法?C++ BrowserClass::nestedp怎么用?C++ BrowserClass::nestedp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrowserClass
的用法示例。
在下文中一共展示了BrowserClass::nestedp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compute_size
void UcClassCanvas::compute_size() {
used_settings = settings;
((BrowserUseCaseDiagram *) the_canvas()->browser_diagram())
->get_simpleclassdiagramsettings(used_settings);
full_name = browser_node->get_name();
const MyStr & (PackageData::*f)() const = 0;
const char * sep = 0; // to avoid warning
switch (used_settings.show_context_mode) {
case umlContext:
full_name = browser_node->full_name();
break;
case namespaceContext:
f = &PackageData::get_cpp_namespace;
sep = "::";
break;
case javaPackageContext:
f = &PackageData::get_java_package;
sep = ".";
break;
case pythonPackageContext:
f = &PackageData::get_python_package;
sep = ".";
break;
case moduleContext:
f = &PackageData::get_idl_module;
sep = "::";
break;
default:
break;
}
if (f != 0) {
BrowserClass * cl = (BrowserClass *) browser_node;
while (cl->nestedp())
cl = (BrowserClass *) cl->parent();
if (((BrowserNode *) cl->parent())->get_type() == UmlClassView) {
// not under a use case
BrowserArtifact * cp = cl->get_associated_artifact();
QString context =
(((PackageData *)
((BrowserNode *)
(((cp == 0) ? (BrowserNode *) cl : (BrowserNode *) cp)
->parent()->parent()))->get_data())->*f)();
if (!context.isEmpty())
full_name = context + sep + full_name;
}
}
QFontMetrics fm(the_canvas()->get_font(UmlNormalFont));
QFontMetrics fim(the_canvas()->get_font(UmlNormalItalicFont));
const ClassData * data = ((ClassData *) browser_node->get_data());
int wi =
(data->get_is_abstract()) ? fim.width(full_name) : fm.width(full_name);
double zoom = the_canvas()->zoom();
const QPixmap * px = 0;
if (used_settings.class_drawing_mode == Natural) {
if ((px = ProfiledStereotypes::diagramPixmap(data->get_stereotype(), zoom)) != 0)
used_view_mode = Natural;
else {
const char * st = data->get_short_stereotype();
if (!strcmp(st, "control"))
used_view_mode = asControl;
else if (!strcmp(st, "entity"))
used_view_mode = asEntity;
else if (!strcmp(st, "boundary"))
used_view_mode = asBoundary;
else if (!strcmp(st, "actor"))
used_view_mode = asActor;
else if (!strcmp(st, "interface"))
used_view_mode = asInterface;
else
used_view_mode = asClass;
}
}
else
used_view_mode = used_settings.class_drawing_mode;
const int eight = (int) (8 * zoom);
int he = fm.height() + eight;
bool tmpl = data->get_n_formalparams() != 0;
if (tmpl)
he += fm.height();
if (used_view_mode == asClass) {
he += (int) (12 * zoom);
if (data->get_stereotype()[0]) {
int stw = fm.width(QString("<<") + toUnicode(data->get_short_stereotype()) + ">>");
//.........这里部分代码省略.........