#include "UmlUseCase.h"
#include "FileOut.h"
void UmlUseCase::ref(FileOut & out) {
out << "";
}
bool UmlUseCase::write_if_needed(FileOut & out) {
// even if the use case doesn't have children
parent()->write(out);
out.indent();
out << "\n";
out.indent(+1);
write_stereotype(out);
write_description_properties(out);
const QVector ch = children();
unsigned n = ch.size();
bool used = FALSE;
bool haveRel= FALSE;
for (unsigned i = 0; i != n; i += 1)
if (ch[i]->kind() != aNcRelation)
used |= ch[i]->write_if_needed(out);
else
haveRel = TRUE;
if (used) {
out.indent(-1);
out.indent();
out << "\n";
}
out.indent(-1);
out.indent();
out << "\n";
if (haveRel) {
used = FALSE;
for (unsigned i = 0; i != n; i += 1)
if (ch[i]->kind() == aNcRelation)
used |= ch[i]->write_if_needed(out);
if (used) {
out.indent(-1);
out.indent();
out << "\n";
}
}
unload();
return TRUE;
}
void UmlUseCase::write(FileOut & out) {
if (! _written) {
_written = TRUE;
// parent already written
out.indent();
out << "\n";
out.indent(+1);
}
}