63 static const char VIEW_MAGIC[] =
"ACG::QtWidgets::QGLViewerWidget encoded view";
69 QObject* senderPointer = sender();
72 if ( senderPointer != 0 ) {
73 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
82 if ( examinerId == -1 ) {
83 emit
log(
LOGERR , tr(
"startDrag in Core called by non examiner, stopping here"));
90 QPoint position = _event->pos();
97 size_t node_idx, target_idx;
106 objectId =
object->
id();
109 if ( objectId != -1 ) {
110 emit
log(
LOGERR , tr(
"dragEvent Picked Object"));
119 QDrag * drag =
new QDrag (
this );
120 QMimeData * mime_data =
new QMimeData;
122 mime_data->setText ( view );
123 drag->setMimeData ( mime_data );
130 if ( _event->mimeData()->hasFormat (
"text/plain" ) ) {
131 QString view ( _event->mimeData()->text() );
134 if ( view.left ( sizeof ( VIEW_MAGIC ) - 1 ) == QString ( VIEW_MAGIC ) ) {
135 _event->acceptProposedAction();
143 QObject* senderPointer = sender();
146 if ( senderPointer != 0 ) {
147 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i ) {
155 if ( examinerId == -1 ) {
156 emit
log(
LOGERR , tr(
"startDrag in Core called by non examiner, stopping here"));
162 if ( _event->mimeData()->hasUrls() ) {
163 QList<QUrl> urls = _event->mimeData()->urls();
164 for (
int j = 0 ; j < urls.size() ; ++j ) {
165 emit
log(
LOGWARN , tr(
"Dropped URL: %1").arg(urls[j].toLocalFile()));
172 if ( _event->mimeData()->hasFormat (
"text/plain" ) ) {
174 QString view ( _event->mimeData()->text() );
177 if ( view.left ( sizeof ( VIEW_MAGIC ) - 1 ) == QString ( VIEW_MAGIC ) ) {
179 _event->acceptProposedAction();
185 if ( view.left ( 7 ) == QString(
"file://") ) {
186 _event->acceptProposedAction();
192 emit
log(
LOGERR , tr(
"Unknown drop event! Unable to handle the dropped data! Received data: %1").arg(view));
195 emit
log(
LOGERR , tr(
"Unknown drop event!"));
bool scenegraphPick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
Execute picking operation on scenegraph.
unsigned int activeExaminer()
Get the id of the examiner which got the last mouse events.
void log(Logtype _type, QString _message)
Logg with OUT,WARN or ERR as type.
pick any of the prior targets (should be implemented for all nodes)
void setActiveExaminer(const unsigned int _id)
Set the active id of the examiner which got the last mouse events.
bool getPickedObject(const size_t _node_idx, BaseObjectData *&_object)
Get the picked mesh.