示例#1
0
void QGraphContainer::mousePress(QPointF p){
	int size = this->collection.size();
	ElementContainer::iterator it;
	this->selectedCollection.clear();
	point nativePoint = point(p.x(), p.y(), 0);
	point A, B, C;
	for(it=collection.begin(); it!=collection.end(); ++it){
		if((*it)->pointIn(nativePoint.x, nativePoint.y)==true){
			this->selectedCollection.push_back((*it));
			OutputDebugString(L"mousePress");
			
			if(selectedEdgeDescriptor[0]==NULL){
				for(int i=0; i<3; ++i){
					selectedEdgeDescriptor[i] = new point;
				}
			}
			(*it)->getPointedFace(nativePoint, *selectedEdgeDescriptor[0], 
				*selectedEdgeDescriptor[1], *selectedEdgeDescriptor[2]);
			
			emit graphChange();

			break;
		}
	}
	

}
示例#2
0
int MyGraphBase::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QGraphicsView::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: createPoint(); break;
        case 1: graphChange(); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}