本文整理汇总了C++中Q3CanvasItemList类的典型用法代码示例。如果您正苦于以下问题:C++ Q3CanvasItemList类的具体用法?C++ Q3CanvasItemList怎么用?C++ Q3CanvasItemList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Q3CanvasItemList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createPlot
void RegularData1DWidget::onNotify(Message *message)
{
if (!RTTI::isKindOf<RegularData1DMessage>(*message))
{
return;
}
RegularData1DMessage& msg = *(RegularData1DMessage*) message;
if (msg.getData() != data_) return;
if ((RegularData1DMessage::RegularDataMessageType) msg.getType()
== RegularData1DMessage::UPDATE)
{
createPlot();
}
else if ((RegularData1DMessage::RegularDataMessageType) msg.getType()
== RegularData1DMessage::REMOVE)
{
data_ = 0;
Q3CanvasItemList list = canvas()->allItems();
Q3CanvasItemList::Iterator it = list.begin();
for (; it != list.end(); ++it)
{
if ( *it ) delete *it;
}
}
}
示例2: collisions
Q3CanvasItem * UmlCanvas::collision(const QPoint & p) const
{
Q3CanvasItemList l = collisions(p);
Q3CanvasItemList::ConstIterator it;
Q3CanvasItemList::ConstIterator end = l.end();
ArrowCanvas * arrow = 0;
for (it = l.begin(); it != end; ++it)
if (((*it)->visible()) && // at least not deleted
!isa_alien(*it) &&
!isa_col_msg_dirs(*it)) {
switch ((*it)->rtti()) {
case RTTI_ARROW:
if (arrow == 0)
arrow = (ArrowCanvas *) *it;
break;
case RTTI_LABEL:
return (arrow == 0) ? *it : arrow;
default:
// isa DiagramCanvas
return ((arrow == 0) ||
(small_element(((DiagramCanvas *) *it)->rect()) &&
((DiagramCanvas *) *it)->attached_to(arrow)))
? *it : arrow;
}
}
return arrow;
}
示例3: canvas
void ColDiagramView::update_msg_supports()
{
Q3CanvasItemList l = canvas()->allItems();
Q3CanvasItemList::Iterator it;
for (it = l.begin(); it != l.end(); ++it) {
if ((*it)->visible()) { // at least not deleted
DiagramItem * di = QCanvasItemToDiagramItem(*it);
if (di != 0) {
switch (di->type()) {
case UmlSelfLink:
((CodSelfLinkCanvas *) di)->update_msgs();
break;
case UmlLinkDirs:
((CodDirsCanvas *) di)->update_msgs();
break;
default: // to avoid compiler warning
break;
}
}
}
}
}
示例4: collisions
void PackageCanvas::prepare_for_move(bool on_resize) {
if (! on_resize) {
DiagramCanvas::prepare_for_move(on_resize);
Q3CanvasItemList l = collisions(TRUE);
Q3CanvasItemList::ConstIterator it;
Q3CanvasItemList::ConstIterator end = l.end();
DiagramItem * di;
BrowserNode * p = get_bn();
for (it = l.begin(); it != end; ++it) {
if ((*it)->visible() && // at least not deleted
!(*it)->selected() &&
((di = QCanvasItemToDiagramItem(*it)) != 0) &&
di->move_with_its_package()) {
BrowserNode * bn = di->get_bn();
do
bn = (BrowserNode *) bn->parent();
while (bn->get_type() != UmlPackage);
if (bn == p) {
the_canvas()->select(*it);
di->prepare_for_move(FALSE);
}
}
}
}
}
示例5: send
void SubjectCanvas::send(ToolCom * com, Q3CanvasItemList & all)
{
Q3PtrList<SubjectCanvas> subjects;
Q3CanvasItemList::Iterator cit;
for (cit = all.begin(); cit != all.end(); ++cit) {
DiagramItem *di = QCanvasItemToDiagramItem(*cit);
if ((di != 0) &&
(*cit)->visible() &&
(di->type() == UmlSubject))
subjects.append((SubjectCanvas *) di);
}
com->write_unsigned(subjects.count());
SubjectCanvas * sc;
for (sc = subjects.first(); sc != 0; sc = subjects.next()) {
Q3CString s = fromUnicode(sc->name);
com->write_string((const char *) s);
com->write(sc->rect());
}
}
示例6: force_inside
// if elt parent is present, force inside it
bool ActivityContainerCanvas::force_inside(DiagramCanvas * elt, bool part)
{
// if its parent is present, force inside it
Q3CanvasItemList all = elt->the_canvas()->allItems();
Q3CanvasItemList::Iterator cit;
BrowserNode * parent = (BrowserNode *) elt->get_bn()->parent();
for (cit = all.begin(); cit != all.end(); ++cit) {
if ((*cit)->visible()) {
DiagramItem * di = QCanvasItemToDiagramItem(*cit);
if ((di != 0) &&
IsaActivityContainer(di->type(), part) &&
(((ActivityContainerCanvas *) di)->get_bn() == parent)) {
BooL under = FALSE;
((ActivityContainerCanvas *) di)->force_inside(elt, elt, under);
if (under)
elt->upper();
return TRUE;
}
}
}
elt->upper();
return FALSE;
}
示例7: update_relations
void ArtifactCanvas::draw_all_relations() {
if (strcmp(browser_node->get_stereotype(), "source") != 0)
// may start association
update_relations();
else if (!DrawingSettings::just_modified() &&
!on_load_diagram()) {
// remove all association starting from 'this'
Q3PtrListIterator<ArrowCanvas> it(lines);
while (it.current()) {
if ((it.current()->type() == UmlContain) &&
(((AssocContainCanvas *) it.current())->get_start() == this))
it.current()->delete_it();
else
++it;
}
// update non source artifact vis a vis 'this'
Q3CanvasItemList all = canvas()->allItems();
Q3CanvasItemList::Iterator cit;
for (cit = all.begin(); cit != all.end(); ++cit) {
if ((*cit)->visible()) {
DiagramItem * adi = QCanvasItemToDiagramItem(*cit);
if ((adi != 0) && // an uml canvas item
(adi->type() == UmlArtifact) &&
strcmp(((ArtifactCanvas *) adi)->browser_node->get_stereotype(), "source"))
((ArtifactCanvas *) adi)->update_relations(this);
}
}
}
}
示例8: clear
void CanvasDialog::clear()
{
Q3CanvasItemList list = m_canvasView->canvas()->allItems();
Q3CanvasItemList::Iterator it = list.begin();
for( ; it != list.end(); ++it )
{
if ( *it ) delete *it;
}
}
示例9: getScene
/**
* Returns -1 if the given point is not on the line.
* else returns the line segment the point is on.
* Use the value to insert points at the point position.
*/
int LinePath::onLinePath( const QPoint &position )
{
Q3CanvasItemList list = getScene()->collisions( position );
int index = -1;
Q3CanvasItemList::iterator end(list.end());
for(Q3CanvasItemList::iterator item_it(list.begin()); item_it != end; ++item_it ) {
if( ( index = m_LineList.indexOf( (Q3CanvasLine*)*item_it ) ) != -1 )
break;
}//end for
return index;
}
示例10: QCanvasItemToDiagramItem
DiagramItemList::DiagramItemList(Q3CanvasItemList l)
{
Q3CanvasItemList::Iterator it;
for (it = l.begin(); it != l.end(); ++it) {
if ((*it)->visible()) {
DiagramItem * di = QCanvasItemToDiagramItem(*it);
if (di != 0)
append(di);
}
}
}
示例11: buildXML
void ReportSection::buildXML(QDomDocument & doc, QDomElement & section) {
//qDebug("ReportSection::buildXML()");
float f = (float)canvas->height() / dpiY * 100.0;
f = ((f - (int)f) > .5 ? (int)f : (int)f + 1);
QDomElement height = doc.createElement("height");
height.appendChild(doc.createTextNode(QString::number((int)f)));
section.appendChild(height);
// now get a list of all the QCanvasItems on this canvas and output them.
Q3CanvasItemList list = canvas->allItems();
for(Q3CanvasItemList::iterator it = list.begin();
it != list.end(); it++ ) {
ReportEntity::buildXML((*it),doc,section);
}
}
示例12: collisionsFiltered
Q3CanvasItemList DigitView::collisionsFiltered(Q3CanvasItemList listIn, int rtti)
{
// filter out all but the desired types
Q3CanvasItemList listOut;
Q3CanvasItemList::iterator itrIn;
for (itrIn = listIn.begin(); itrIn != listIn.end(); ++itrIn)
{
ASSERT_ENGAUGE((*itrIn) != 0);
if ((*itrIn)->rtti() == rtti)
listOut.append(*itrIn);
}
return listOut;
}
示例13: allItems
bool UmlCanvas::already_drawn(BrowserNode * bn) {
Q3CanvasItemList all = allItems();
Q3CanvasItemList::Iterator cit;
UmlCode k = bn->get_type();
for (cit = all.begin(); cit != all.end(); ++cit) {
if ((*cit)->visible()) {
DiagramItem * di = QCanvasItemToDiagramItem(*cit);
if ((di != 0) && (di->type() == k) && (di->get_bn() == bn))
return TRUE;
}
}
return FALSE;
}
示例14: drop
void SimpleRelationCanvas::drop(BrowserNode * bn, UmlCanvas * canvas)
{
SimpleRelationData * def = (SimpleRelationData *) bn->get_data();
BrowserNode * from = def->get_start_node();
BrowserNode * to = def->get_end_node();
DiagramItem * ccfrom = 0;
DiagramItem * ccto = 0;
Q3CanvasItemList all = canvas->allItems();
Q3CanvasItemList::Iterator cit;
// the two classes are drawn ?
for (cit = all.begin(); cit != all.end(); ++cit) {
if ((*cit)->visible()) {
DiagramItem * adi = QCanvasItemToDiagramItem(*cit);
if (adi != 0) {
if (adi->get_bn() == from) {
ccfrom = adi;
if (ccto != 0)
break;
}
if (adi->get_bn() == to) {
ccto = adi;
if (ccfrom != 0)
break;
}
}
}
}
if ((ccfrom != 0) && (ccto != 0)) {
if (ccfrom->has_relation(def))
msg_information("Douml", "relation already drawn");
else {
SimpleRelationCanvas * rel =
new SimpleRelationCanvas(canvas, ccfrom, ccto, from,
bn->get_type(), 0, -1.0, -1.0, def);
rel->show();
rel->package_modified();
}
}
}
示例15: force_sub_upper
// update sub nodes to be upper this, recursively
void ActivityContainerCanvas::force_sub_upper(Q3CanvasItemList & all) {
Q3CanvasItemList::Iterator cit;
BrowserNode * browser_node = get_bn();
for (cit = all.begin(); cit != all.end(); ++cit) {
if ((*cit)->visible()) {
DiagramItem * di = QCanvasItemToDiagramItem(*cit);
if ((di != 0) &&
(di->get_bn() != 0) &&
(((BrowserNode *) di->get_bn())->parent() == browser_node)) {
// must look at the type because some canvas items have browser_node
// attr equals to the diagram and the parent of the diagram is the activity
switch (di->type()) {
case UmlActivityObject:
case UmlActivityAction:
case UmlActivityPartition:
case UmlExpansionRegion:
case UmlInterruptibleActivityRegion:
case InitialAN:
case FlowFinalAN:
case ActivityFinalAN:
case DecisionAN:
case MergeAN:
case ForkAN:
case JoinAN:
if ((*cit)->z() <= z())
((DiagramCanvas *) di)->upper();
{
ActivityContainerCanvas * cntr =
dynamic_cast<ActivityContainerCanvas *>(di);
if (cntr != 0)
cntr->force_sub_upper(all);
}
break;
default:
break;
}
}
}
}
}