1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
#ifndef _UMLBASEFRAGMENT_H
#define _UMLBASEFRAGMENT_H
#include <qcstring.h>
#include <qvector.h>
#include <qptrdict.h>
class UmlFragmentCompartment;
class UmlDiagram;
class UmlClassInstanceReference;
class UmlFragment;
// this class manages fragments
class UmlBaseFragment {
public:
// return the name
const QCString & name() const {
return _name;
}
// return the compartments, at least one compartment exists
const QVector<UmlFragmentCompartment> & compartments() const {
return _compartments;
}
// return the fragment compartment containing the fragment,
// or 0/null
UmlFragmentCompartment * container() const {
return _container;
}
// return the diagram optionally referenced by the fragment,
// generally associated to an interaction use
UmlDiagram * refer() const {
return _refer;
}
// return the form corresponding to the arguments
// and return value of the interaction use
QCString arguments() const {
return _arguments;
}
// return the the list of covered instances (life lines)
const QVector<UmlClassInstanceReference> & covered() const {
return _covered;
}
private:
UmlFragmentCompartment * _container;
QVector<UmlFragmentCompartment> _compartments;
QCString _name;
int _x;
int _y;
int _w;
int _h;
UmlDiagram * _refer;
QCString _arguments;
QVector<UmlClassInstanceReference> _covered;
// internal, don't call it
void read_();
public:
//internal, do NOT use it
int vcenter_(int rank) const;
//internal, do NOT use it
void read_covered_(QPtrDict<UmlClassInstanceReference> & instances);
// internal
static UmlFragmentCompartment * get_container_(int x, int y, int w, int h, const QVector<UmlFragment> & fragments);
private:
// internal
static void compute_container_(QVector<UmlFragment> & fragments);
public:
int w() const {
return _w;
}
int h() const {
return _h;
}
// to avoid compiler warning, don't call it
~UmlBaseFragment();
friend class UmlBaseUseCaseDiagramDefinition;
friend class UmlBaseSequenceDiagramDefinition;
};
#endif
|