diff options
-rw-r--r-- | src/config.xml | 20 | ||||
-rw-r--r-- | src/dotnode.cpp | 30 |
2 files changed, 37 insertions, 13 deletions
diff --git a/src/config.xml b/src/config.xml index 1faf67f..56dacd6 100644 --- a/src/config.xml +++ b/src/config.xml @@ -3444,22 +3444,22 @@ to be found in the default search path. ]]> </docs> </option> - <option type='bool' id='DOT_UML_DETAILS' defval='0' depends='UML_LOOK'> + <option type='enum' id='DOT_UML_DETAILS' defval='NO' depends='UML_LOOK'> <docs> <![CDATA[ +If the \c DOT_UML_DETAILS tag is set to \c NO, doxygen will +show attributes and methods without types and arguments in the UML graphs. If the \c DOT_UML_DETAILS tag is set to \c YES, doxygen will add type and arguments for attributes and methods in the UML graphs. +If the \c DOT_UML_DETAILS tag is set to \c NONE, doxygen will not generate +fields with class member information in the UML graphs. +The class diagrams will look similar to the default class diagrams but using +UML notation for the relationships. ]]> </docs> - </option> - <option type='bool' id='DOT_UML_SHOW_MEMBER' defval='1' depends='UML_LOOK'> - <docs> -<![CDATA[ - If the \c DOT_UML_SHOW_MEMBER tag is set to \c NO, doxygen will not generate fields with - class member information inside the class nodes. The class diagrams will look similar to - the default class diagrams but using UML notation for the relationships. -]]> - </docs> + <value name="NO" /> + <value name="YES" /> + <value name="NONE" /> </option> <option type='int' id='DOT_WRAP_THRESHOLD' defval='17' minval='0' maxval='1000' depends='HAVE_DOT'> <docs> diff --git a/src/dotnode.cpp b/src/dotnode.cpp index cc6b951..86f99a2 100644 --- a/src/dotnode.cpp +++ b/src/dotnode.cpp @@ -97,6 +97,30 @@ static EdgeProperties umlEdgeProps = umlEdgeColorMap, umlArrowStyleMap, umlEdgeStyleMap }; +// Extracted from config setting "DOT_UML_DETAILS" +enum class UmlDetailLevel +{ + Default, // == NO, the default setting + Full, // == YES, include type and arguments + None // == NONE, don't include compartments for attributes and methods +}; + +// Local helper function for extracting the configured detail level +static UmlDetailLevel getUmlDetailLevelFromConfig() +{ + UmlDetailLevel result = UmlDetailLevel::Default; + QCString umlDetailsStr = Config_getEnum(DOT_UML_DETAILS).upper(); + if (umlDetailsStr == "YES") + { + result=UmlDetailLevel::Full; + } + else if (umlDetailsStr == "NONE") + { + result=UmlDetailLevel::None; + } + return result; +} + static QCString escapeTooltip(const QCString &tooltip) { QCString result; @@ -149,7 +173,7 @@ static void writeBoxMemberList(FTextStream &t, { t << prot << " "; QCString label; - if(Config_getBool(DOT_UML_DETAILS)) + if(getUmlDetailLevelFromConfig()==UmlDetailLevel::Full) { label+=mma->typeString(); label+=" "; @@ -157,7 +181,7 @@ static void writeBoxMemberList(FTextStream &t, label+=mma->name(); if (!mma->isObjCMethod() && (mma->isFunction() || mma->isSlot() || mma->isSignal())) { - if(Config_getBool(DOT_UML_DETAILS)) + if(getUmlDetailLevelFromConfig()==UmlDetailLevel::Full) { label+=mma->argsString(); } @@ -429,7 +453,7 @@ void DotNode::writeBox(FTextStream &t, //printf("DotNode::writeBox for %s\n",m_classDef->name().data()); t << "{" << convertLabel(m_label) << "\\n"; - if (Config_getBool(DOT_UML_SHOW_MEMBER)) + if (getUmlDetailLevelFromConfig()!=UmlDetailLevel::None) { t << "|"; writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberListType_pubAttribs),m_classDef,FALSE,&arrowNames); |