In class diagram, how to place the function parameters on multiline?

+1 vote
asked Sep 8, 2021 in Bug by mountqi (120 points)

@startuml imaging_class_diagram

class CImaging {

    +void Init(const ToolConfig& config, PolarizedIllumSource& illum_src,

        C3DStructure& structure3d,

        CVectorialProjection& projection );

}

@enduml

Hi, please check the scripts above.  The function parameters are placed on multilines, then the class diagram is wrong.  I cannot upload image here.

1 Answer

+1 vote
answered Sep 11, 2021 by dragondive (480 points)

I could only think of a "workaround" like this. Format it manually using "\" for line continuation and "\n" to specify the newline character. I'm not sure if there's a way to do this in a more "automated" way, although you might be able to "hack" it using the preprocessor directives.

http://www.plantuml.com/plantuml/uml/LSenoy8m4CRnFP_YflA-wDRHfL2NReMAKq524il99IUNYuFYTxUAYdsM-n_ycgnMj4GoZcpEq7RHJfWck1a3yrONHWzTGlqRpPZWFSSfA-oOgULqnAa2zxhhNzGpMS5hy1rHYGCNSQ42V3w7B6vXstexg1IdHMQJFrdxfTe7fonegHS-pOsSAZX_6_utnjnD4v8laHu0

commented Sep 11, 2021 by The-Lu (64,760 points)

Hello all,

If you want, you can also combine on other way around, with '\n\' (that is a magic operator cheeky), like:

@startuml
class CImaging {
    +void Init(const ToolConfig& config,\n\
        PolarizedIllumSource& illum_src,\n\
        C3DStructure& structure3d,\n\
        CVectorialProjection& projection );
}
@enduml

Regards,
Th.

...