Commit 3fdec18b authored by Jan Möbius's avatar Jan Möbius

Made a lot of parameters in pluginfunctions const

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4198 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e30c2f62
...@@ -78,7 +78,7 @@ void set_examiner( std::vector< ACG::QtWidgets::QtExaminerViewer* > _examiner_wi ...@@ -78,7 +78,7 @@ void set_examiner( std::vector< ACG::QtWidgets::QtExaminerViewer* > _examiner_wi
PluginFunctions::examiner_widget_ = examiner_widgets_[0]; PluginFunctions::examiner_widget_ = examiner_widgets_[0];
} }
void setActiveExaminer( unsigned int _id ) { void setActiveExaminer( const unsigned int _id ) {
activeExaminer_ = _id; activeExaminer_ = _id;
} }
...@@ -90,7 +90,7 @@ void set_sceneGraphRootNode( SeparatorNode* _root_node ) { ...@@ -90,7 +90,7 @@ void set_sceneGraphRootNode( SeparatorNode* _root_node ) {
PluginFunctions::sceneGraph_root_node_ = _root_node; PluginFunctions::sceneGraph_root_node_ = _root_node;
} }
bool get_picked_object(uint _node_idx , BaseObjectData*& _object) { bool get_picked_object(const unsigned int _node_idx , BaseObjectData*& _object) {
for ( ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objects_end(); ++o_it) { for ( ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objects_end(); ++o_it) {
if ( o_it->picked( _node_idx ) ) { if ( o_it->picked( _node_idx ) ) {
_object = *o_it; _object = *o_it;
...@@ -125,7 +125,7 @@ bool get_target_identifiers( std::vector<int>& _identifiers ) { ...@@ -125,7 +125,7 @@ bool get_target_identifiers( std::vector<int>& _identifiers ) {
// Get objects // Get objects
// =============================================================================== // ===============================================================================
bool get_object( int _identifier , BaseObject*& _object ) { bool get_object( const int _identifier , BaseObject*& _object ) {
if ( _identifier == -1 ) if ( _identifier == -1 )
return false; return false;
...@@ -134,7 +134,7 @@ bool get_object( int _identifier , BaseObject*& _object ) { ...@@ -134,7 +134,7 @@ bool get_object( int _identifier , BaseObject*& _object ) {
return ( _object != 0 ); return ( _object != 0 );
} }
bool get_object( int _identifier , BaseObjectData*& _object ) { bool get_object( const int _identifier , BaseObjectData*& _object ) {
if ( _identifier == -1 ) if ( _identifier == -1 )
return false; return false;
...@@ -148,7 +148,7 @@ bool get_object( int _identifier , BaseObjectData*& _object ) { ...@@ -148,7 +148,7 @@ bool get_object( int _identifier , BaseObjectData*& _object ) {
// =============================================================================== // ===============================================================================
bool deleteObject( int _id ) { bool deleteObject( const int _id ) {
if ( _id == -1 ) if ( _id == -1 )
return false; return false;
...@@ -177,7 +177,7 @@ void deleteAll( ) { ...@@ -177,7 +177,7 @@ void deleteAll( ) {
objectRoot()->deleteSubtree(); objectRoot()->deleteSubtree();
} }
int copyObject( int _id ) { int copyObject( const int _id ) {
if ( _id == -1 ) if ( _id == -1 )
return -1; return -1;
...@@ -206,7 +206,7 @@ int copyObject( int _id ) { ...@@ -206,7 +206,7 @@ int copyObject( int _id ) {
return copy->id(); return copy->id();
} }
bool object_exists( int _identifier ) { bool object_exists( const int _identifier ) {
if ( _identifier == -1 ) if ( _identifier == -1 )
return false; return false;
...@@ -247,11 +247,11 @@ void setBackColor( OpenMesh::Vec4f _color) { ...@@ -247,11 +247,11 @@ void setBackColor( OpenMesh::Vec4f _color) {
examiner_widgets_[activeExaminer_]->backgroundColor(_color); examiner_widgets_[activeExaminer_]->backgroundColor(_color);
} }
QPoint mapToGlobal(QPoint _point ) { QPoint mapToGlobal(const QPoint _point ) {
return examiner_widgets_[activeExaminer_]->glMapToGlobal(_point); return examiner_widgets_[activeExaminer_]->glMapToGlobal(_point);
} }
QPoint mapToLocal( QPoint _point ) { QPoint mapToLocal( const QPoint _point ) {
return examiner_widgets_[activeExaminer_]->glMapFromGlobal(_point); return examiner_widgets_[activeExaminer_]->glMapFromGlobal(_point);
} }
...@@ -260,7 +260,7 @@ QPoint mapToLocal( QPoint _point ) { ...@@ -260,7 +260,7 @@ QPoint mapToLocal( QPoint _point ) {
* The DrawModes are defined at ACG/Scenegraph/DrawModes.hh \n * The DrawModes are defined at ACG/Scenegraph/DrawModes.hh \n
* They can be combined. * They can be combined.
*/ */
void setDrawMode( unsigned int _mode ) { void setDrawMode( const unsigned int _mode ) {
for ( uint i = 0 ; i < examiner_widgets_.size() ; ++i ) { for ( uint i = 0 ; i < examiner_widgets_.size() ; ++i ) {
examiner_widgets_[i]->drawMode(_mode); examiner_widgets_[i]->drawMode(_mode);
examiner_widgets_[i]->updateGL(); examiner_widgets_[i]->updateGL();
...@@ -281,7 +281,7 @@ bool scenegraph_pick( ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mo ...@@ -281,7 +281,7 @@ bool scenegraph_pick( ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mo
return examiner_widgets_[activeExaminer_]->pick( _pickTarget,_mousePos,_nodeIdx,_targetIdx,_hitPointPtr ); return examiner_widgets_[activeExaminer_]->pick( _pickTarget,_mousePos,_nodeIdx,_targetIdx,_hitPointPtr );
} }
bool scenegraph_pick( unsigned int _examiner, ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr=0 ) { bool scenegraph_pick( const unsigned int _examiner, ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr=0 ) {
if ( _examiner >= examiner_widgets_.size() ) { if ( _examiner >= examiner_widgets_.size() ) {
std::cerr << "Wrong examiner id" << std::endl; std::cerr << "Wrong examiner id" << std::endl;
...@@ -298,7 +298,7 @@ void traverse( ACG::SceneGraph::MouseEventAction &_action ) { ...@@ -298,7 +298,7 @@ void traverse( ACG::SceneGraph::MouseEventAction &_action ) {
} }
//Warning : Dont use template function as external static pointer for examiner widget is not resolved correctly!! //Warning : Dont use template function as external static pointer for examiner widget is not resolved correctly!!
void traverse( unsigned int _examiner, ACG::SceneGraph::MouseEventAction &_action ) { void traverse( const unsigned int _examiner, ACG::SceneGraph::MouseEventAction &_action ) {
if ( _examiner >= examiner_widgets_.size() ) { if ( _examiner >= examiner_widgets_.size() ) {
std::cerr << "Wrong examiner id" << std::endl; std::cerr << "Wrong examiner id" << std::endl;
...@@ -318,7 +318,7 @@ void pickMode ( std::string _mode) { ...@@ -318,7 +318,7 @@ void pickMode ( std::string _mode) {
examiner_widgets_[i]->pickMode(_mode); examiner_widgets_[i]->pickMode(_mode);
} }
void pickMode ( unsigned int _examiner, std::string _mode) { void pickMode ( const unsigned int _examiner, std::string _mode) {
if ( _examiner >= examiner_widgets_.size() ) { if ( _examiner >= examiner_widgets_.size() ) {
std::cerr << "Wrong examiner id" << std::endl; std::cerr << "Wrong examiner id" << std::endl;
return; return;
...@@ -360,7 +360,7 @@ void viewingDirection(const ACG::Vec3d &_dir, const ACG::Vec3d &_up) { ...@@ -360,7 +360,7 @@ void viewingDirection(const ACG::Vec3d &_dir, const ACG::Vec3d &_up) {
} }
void setScenePos(const ACG::Vec3d& _center, double _radius) { void setScenePos(const ACG::Vec3d& _center,const double _radius) {
examiner_widget_->setScenePos( _center, _radius ); examiner_widget_->setScenePos( _center, _radius );
} }
...@@ -381,7 +381,7 @@ void translate( const ACG::Vec3d &_vector ) { ...@@ -381,7 +381,7 @@ void translate( const ACG::Vec3d &_vector ) {
} }
void rotate(const ACG::Vec3d& _axis, void rotate(const ACG::Vec3d& _axis,
double _angle, const double _angle,
const ACG::Vec3d& _center) const ACG::Vec3d& _center)
{ {
examiner_widget_->rotate(_axis,_angle,_center); examiner_widget_->rotate(_axis,_angle,_center);
......
...@@ -70,7 +70,7 @@ namespace PluginFunctions { ...@@ -70,7 +70,7 @@ namespace PluginFunctions {
* @return true if mesh was found, false if picked object is not a mesh or not found * @return true if mesh was found, false if picked object is not a mesh or not found
*/ */
DLLEXPORT DLLEXPORT
bool get_picked_object(uint _node_idx , BaseObjectData*& _object); bool get_picked_object(const unsigned int _node_idx , BaseObjectData*& _object);
/** \brief Delete the object with the given id /** \brief Delete the object with the given id
* *
...@@ -79,7 +79,7 @@ bool get_picked_object(uint _node_idx , BaseObjectData*& _object); ...@@ -79,7 +79,7 @@ bool get_picked_object(uint _node_idx , BaseObjectData*& _object);
* @return successful? * @return successful?
* */ * */
DLLEXPORT DLLEXPORT
bool deleteObject( int _id ); bool deleteObject( const int _id );
/** \brief Delete all objects /** \brief Delete all objects
* *
...@@ -94,7 +94,7 @@ void deleteAll( ); ...@@ -94,7 +94,7 @@ void deleteAll( );
* @return Pointer to new object or 0 if failed; * @return Pointer to new object or 0 if failed;
* */ * */
DLLEXPORT DLLEXPORT
int copyObject( int _id ); int copyObject( const int _id );
...@@ -151,13 +151,13 @@ bool get_all_object_identifiers( std::vector<int>& _identifiers ); ...@@ -151,13 +151,13 @@ bool get_all_object_identifiers( std::vector<int>& _identifiers );
* @return Object found? * @return Object found?
*/ */
DLLEXPORT DLLEXPORT
bool get_object( int _identifier , BaseObject*& _object ); bool get_object( const int _identifier , BaseObject*& _object );
/** This functions returns the object with the given id regardless of the type of object. /** This functions returns the object with the given id regardless of the type of object.
* See get_object( int _identifier , BaseObject*& _object ) for more details. * See get_object( int _identifier , BaseObject*& _object ) for more details.
*/ */
DLLEXPORT DLLEXPORT
bool get_object( int _identifier , BaseObjectData*& _object ); bool get_object( const int _identifier , BaseObjectData*& _object );
/** \brief Check if an object with this identifier exists. /** \brief Check if an object with this identifier exists.
* *
...@@ -165,7 +165,7 @@ bool get_object( int _identifier , BaseObjectData*& _object ); ...@@ -165,7 +165,7 @@ bool get_object( int _identifier , BaseObjectData*& _object );
* @param _identifier Object id to search for * @param _identifier Object id to search for
*/ */
DLLEXPORT DLLEXPORT
bool object_exists( int _identifier ); bool object_exists( const int _identifier );
/// Get the number of available objects /// Get the number of available objects
DLLEXPORT DLLEXPORT
...@@ -196,7 +196,7 @@ void set_examiner( std::vector< ACG::QtWidgets::QtExaminerViewer* > _examiner_wi ...@@ -196,7 +196,7 @@ void set_examiner( std::vector< ACG::QtWidgets::QtExaminerViewer* > _examiner_wi
/// Set the active id of the examiner which got the last mouse events /// Set the active id of the examiner which got the last mouse events
DLLEXPORT DLLEXPORT
void setActiveExaminer( unsigned int _id ); void setActiveExaminer( const unsigned int _id );
/// Set the internal scenegraph root node pointer ( DO NOT USE!! ) /// Set the internal scenegraph root node pointer ( DO NOT USE!! )
DLLEXPORT DLLEXPORT
...@@ -217,7 +217,7 @@ bool scenegraph_pick( ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mo ...@@ -217,7 +217,7 @@ bool scenegraph_pick( ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mo
* This picking function will pick in the specified examiner context * This picking function will pick in the specified examiner context
*/ */
DLLEXPORT DLLEXPORT
bool scenegraph_pick( unsigned int _examiner ,ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr ); bool scenegraph_pick( const unsigned int _examiner ,ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr );
/** Execute Scenegraph traversal with action and use the last active examiner /** Execute Scenegraph traversal with action and use the last active examiner
* If you are reacting on a mouseEvent you should use this function as it will * If you are reacting on a mouseEvent you should use this function as it will
...@@ -227,7 +227,7 @@ DLLEXPORT ...@@ -227,7 +227,7 @@ DLLEXPORT
void traverse( ACG::SceneGraph::MouseEventAction &_action ); void traverse( ACG::SceneGraph::MouseEventAction &_action );
/// Execute Scenegraph traversal with action and a specified examiner /// Execute Scenegraph traversal with action and a specified examiner
void traverse( unsigned int _examiner, ACG::SceneGraph::MouseEventAction &_action ); void traverse( const unsigned int _examiner, ACG::SceneGraph::MouseEventAction &_action );
/// Get the current Picking mode /// Get the current Picking mode
DLLEXPORT DLLEXPORT
...@@ -239,7 +239,7 @@ void pickMode ( std::string _mode); ...@@ -239,7 +239,7 @@ void pickMode ( std::string _mode);
/// Set pick mode for a specific examiner /// Set pick mode for a specific examiner
DLLEXPORT DLLEXPORT
void pickMode ( unsigned int _examiner, std::string _mode); void pickMode ( const unsigned int _examiner, std::string _mode);
/// Get the current gl state from examiner /// Get the current gl state from examiner
DLLEXPORT DLLEXPORT
...@@ -302,7 +302,7 @@ void viewingDirection(const ACG::Vec3d &_dir, const ACG::Vec3d &_up); ...@@ -302,7 +302,7 @@ void viewingDirection(const ACG::Vec3d &_dir, const ACG::Vec3d &_up);
* @param _radius Radius of the scene ( Use scene_radius to get the current radius ) * @param _radius Radius of the scene ( Use scene_radius to get the current radius )
*/ */
DLLEXPORT DLLEXPORT
void setScenePos(const ACG::Vec3d& _center, double _radius); void setScenePos(const ACG::Vec3d& _center, const double _radius);
/** \brief Set the scene position (Same as setScenePos(const ACG::Vec3d& _center, double _radius) ) /** \brief Set the scene position (Same as setScenePos(const ACG::Vec3d& _center, double _radius) )
* *
...@@ -341,7 +341,7 @@ void translate( const ACG::Vec3d &_vector ); ...@@ -341,7 +341,7 @@ void translate( const ACG::Vec3d &_vector );
*/ */
DLLEXPORT DLLEXPORT
void rotate(const ACG::Vec3d& _axis, void rotate(const ACG::Vec3d& _axis,
double _angle, const double _angle,
const ACG::Vec3d& _center); const ACG::Vec3d& _center);
...@@ -386,7 +386,7 @@ void perspectiveProjection(); ...@@ -386,7 +386,7 @@ void perspectiveProjection();
* *
*/ */
DLLEXPORT DLLEXPORT
void setDrawMode( unsigned int _mode ); void setDrawMode( const unsigned int _mode );
/** \brief Get the current draw Mode /** \brief Get the current draw Mode
* *
...@@ -405,13 +405,13 @@ void setBackColor( OpenMesh::Vec4f _color); ...@@ -405,13 +405,13 @@ void setBackColor( OpenMesh::Vec4f _color);
* *
*/ */
DLLEXPORT DLLEXPORT
void mapToGlobal( ); QPoint mapToGlobal( const QPoint _point );
/** \brief Map global coordinates to GL Widget local coordinates /** \brief Map global coordinates to GL Widget local coordinates
* *
*/ */
DLLEXPORT DLLEXPORT
void mapToLocal( OpenMesh::Vec4f _color); QPoint mapToLocal( const QPoint _point );
/** @} */ /** @} */
......
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