Commit e09f24b3 authored by Jan Möbius's avatar Jan Möbius

Get rid of the twenty region pick functions in the qtbaseviewer.

refs #479



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14506 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4236fc2b
......@@ -473,7 +473,7 @@ bool scenegraphRegionPick( ACG::SceneGraph::PickTarget _pickTarge
const QRegion& _region,
QList<QPair<unsigned int, unsigned int> >& _list)
{
return examiner_widgets_[activeExaminer_]->pick_region( _pickTarget, _region, _list);
return examiner_widgets_[activeExaminer_]->pick_region( _pickTarget, _region, _list, 0 , 0);
}
bool scenegraphRegionPick( const unsigned int _examiner,
......@@ -485,7 +485,7 @@ bool scenegraphRegionPick( const unsigned int _examiner,
std::cerr << "Wrong examiner id" << std::endl;
return false;
}
return examiner_widgets_[_examiner]->pick_region( _pickTarget, _region, _list);
return examiner_widgets_[activeExaminer_]->pick_region( _pickTarget, _region, _list, 0, 0);
}
bool scenegraphRegionPick( ACG::SceneGraph::PickTarget _pickTarget,
......@@ -493,7 +493,7 @@ bool scenegraphRegionPick( ACG::SceneGraph::PickTarget _pickTarge
QList<QPair<unsigned int, unsigned int> >& _list,
QVector<ACG::Vec3d>& _points)
{
return examiner_widgets_[activeExaminer_]->pick_region( _pickTarget, _region, _list, _points);
return examiner_widgets_[activeExaminer_]->pick_region( _pickTarget, _region, _list, 0, &_points);
}
bool scenegraphRegionPick( const unsigned int _examiner,
......@@ -506,7 +506,7 @@ bool scenegraphRegionPick( const unsigned int _examiner,
std::cerr << "Wrong examiner id" << std::endl;
return false;
}
return examiner_widgets_[_examiner]->pick_region( _pickTarget, _region, _list, _points);
return examiner_widgets_[activeExaminer_]->pick_region( _pickTarget, _region, _list, 0, &_points);
}
bool scenegraphRegionPick( ACG::SceneGraph::PickTarget _pickTarget,
......@@ -514,7 +514,7 @@ bool scenegraphRegionPick( ACG::SceneGraph::PickTarget _pickTarge
QList<QPair<unsigned int, unsigned int> >& _list,
QVector<float>& _depths)
{
return examiner_widgets_[activeExaminer_]->pick_region( _pickTarget, _region, _list, _depths);
return examiner_widgets_[activeExaminer_]->pick_region( _pickTarget, _region, _list, &_depths, 0);
}
bool scenegraphRegionPick( const unsigned int _examiner,
......@@ -527,7 +527,7 @@ bool scenegraphRegionPick( const unsigned int _examiner,
std::cerr << "Wrong examiner id" << std::endl;
return false;
}
return examiner_widgets_[_examiner]->pick_region( _pickTarget, _region, _list, _depths);
return examiner_widgets_[activeExaminer_]->pick_region( _pickTarget, _region, _list, &_depths, 0);
}
bool scenegraphRegionPick( ACG::SceneGraph::PickTarget _pickTarget,
......@@ -536,7 +536,7 @@ bool scenegraphRegionPick( ACG::SceneGraph::PickTarget _pickTarge
QVector<float>& _depths,
QVector<ACG::Vec3d>& _points)
{
return examiner_widgets_[activeExaminer_]->pick_region( _pickTarget, _region, _list, _depths, _points);
return examiner_widgets_[activeExaminer_]->pick_region( _pickTarget, _region, _list, &_depths, &_points);
}
bool scenegraphRegionPick( const unsigned int _examiner,
......@@ -550,7 +550,7 @@ bool scenegraphRegionPick( const unsigned int _examiner,
std::cerr << "Wrong examiner id" << std::endl;
return false;
}
return examiner_widgets_[_examiner]->pick_region( _pickTarget, _region, _list, _depths, _points);
return examiner_widgets_[_examiner]->pick_region( _pickTarget, _region, _list, &_depths, &_points);
}
//Warning : Dont use template function as external static pointer for examiner widget is not resolved correctly!!
......
......@@ -717,7 +717,7 @@ private:
/** \brief Handle key events in view mode
*
* This funtion is called by the BaseViewer if a key press event occured in view mode.
* This function is called by the BaseViewer if a key press event occured in view mode.
* This function has to be implemented by every viewer!
*
* @return If the derived class handled the event it has to return true otherwise false
......@@ -790,10 +790,10 @@ private:
*
* @param _pickTarget Select what should be picked: Faces/Vertices/...
* @param _mousePos The position to be used for picking
* @param _nodeIdx If picking is successfull this will contain the id of the scenegraph node picked.
* @param _nodeIdx If picking is successful this will contain the id of the scenegraph node picked.
* @param _targetIdx Special index defined by the picked Node. E.g. Facehandle/VertexHandle/.. for MeshNodes
* @param _hitPointPtr Pointer to 3D point from picking
* @return Successfull?
* @return Successful?
*/
bool pick( ACG::SceneGraph::PickTarget _pickTarget,
const QPoint& _mousePos,
......@@ -801,80 +801,30 @@ private:
unsigned int& _targetIdx,
ACG::Vec3d* _hitPointPtr=0 );
/** Apply pick action. <br>
* Picks all objects in the given Region. Information about the picked primitives is stored in the
* provided list. Resulting values are defined only if \c true
* has been returned!
* <br>
*
* @param _pickTarget Select what should be picked: Faces/Vertices/...
* @param _region Area for picking
* @param _list List of found scenegraph objects (node/target pairs)
* @return Successfull?
*/
bool pick_region( ACG::SceneGraph::PickTarget _pickTarget,
const QRegion& _region,
QList<QPair<unsigned int, unsigned int> >& _list);
/** Apply pick action. <br>
* Picks all objects in the given Region. Information about the picked primitives is stored in the
* provided list. Resulting values are defined only if \c true
* has been returned!
* <br>
*
* @param _pickTarget Select what should be picked: Faces/Vertices/...
* @param _region Area for picking
* @param _list List of found scenegraph objects (node/target pairs)
* @param _points back projected 3d points
* @return Successful?
*/
bool pick_region( ACG::SceneGraph::PickTarget _pickTarget,
const QRegion& _region,
QList<QPair<unsigned int, unsigned int> >& _list,
QVector<ACG::Vec3d>& _points);
/** Apply pick action. <br>
* Picks all objects in the given Region. Information about the picked primitives is stored in the
* provided list. Resulting values are defined only if \c true
* has been returned!
* <br>
/** \brief Perform picking action n a whole region.
*
* @param _pickTarget Select what should be picked: Faces/Vertices/...
* @param _region Area for picking
* @param _list List of found scenegraph objects (node/target pairs)
* @param _depths depths [0,1]
* @return Successful?
*/
bool pick_region( ACG::SceneGraph::PickTarget _pickTarget,
const QRegion& _region,
QList<QPair<unsigned int, unsigned int> >& _list,
QVector<float>& _depths);
/** Apply pick action. <br>
* Apply pick action. <br>
* Picks all objects in the given Region. Information about the picked primitives is stored in the
* provided list. Resulting values are defined only if \c true
* has been returned!
* <br>
* provided list. Resulting values are defined only if \c true has been returned!
*
* @param _pickTarget Select what should be picked: Faces/Vertices/...
* @param _region Area for picking
* @param _list List of found scenegraph objects (node/target pairs)
* @param _depths depths [0,1]
* @param _points back projected 3d points
* @param _depths depths [0,1] (Only provided, if requested)
* @param _points back projected 3d points (Only provided, if requested)
* @return Successful?
*/
bool pick_region( ACG::SceneGraph::PickTarget _pickTarget,
const QRegion& _region,
QList<QPair<unsigned int, unsigned int> >& _list,
QVector<float>& _depths,
QVector<ACG::Vec3d>& _points);
QVector<float>* _depths = 0,
QVector<ACG::Vec3d>* _points = 0);
/** get the coordinates of the picked point by z-buffer re-projection
* @param _mousePos The position to pick
* @param _hitPoint The point returned by the reprojection
* @return Successfull?
* @return Successful?
*/
bool fast_pick( const QPoint& _mousePos,
ACG::Vec3d& _hitPoint );
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment