Commit 95419a63 authored by Jan Möbius's avatar Jan Möbius

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4795 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 62d1a193
......@@ -97,7 +97,7 @@ void setSceneGraphRootNode( SeparatorNode* _root_node ) {
PluginFunctions::sceneGraph_root_node_ = _root_node;
}
bool get_picked_object(const unsigned int _node_idx , BaseObjectData*& _object) {
bool getPickedObject(const unsigned int _node_idx , BaseObjectData*& _object) {
for ( ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objects_end(); ++o_it) {
if ( o_it->picked( _node_idx ) ) {
_object = *o_it;
......@@ -108,7 +108,7 @@ bool get_picked_object(const unsigned int _node_idx , BaseObjectData*& _object)
}
bool get_source_identifiers( std::vector<int>& _identifiers ) {
bool getSourceIdentifiers( std::vector<int>& _identifiers ) {
_identifiers.clear();
for ( ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objects_end(); ++o_it) {
......@@ -118,7 +118,7 @@ bool get_source_identifiers( std::vector<int>& _identifiers ) {
return (_identifiers.size() >0 );
}
bool get_target_identifiers( std::vector<int>& _identifiers ) {
bool getTargetIdentifiers( std::vector<int>& _identifiers ) {
_identifiers.clear();
for ( ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; o_it != PluginFunctions::objects_end(); ++o_it) {
......@@ -132,7 +132,7 @@ bool get_target_identifiers( std::vector<int>& _identifiers ) {
// Get objects
// ===============================================================================
bool get_object( const int _identifier , BaseObject*& _object ) {
bool getObject( const int _identifier , BaseObject*& _object ) {
if ( _identifier == -1 )
return false;
......@@ -141,7 +141,7 @@ bool get_object( const int _identifier , BaseObject*& _object ) {
return ( _object != 0 );
}
bool get_object( const int _identifier , BaseObjectData*& _object ) {
bool getObject( const int _identifier , BaseObjectData*& _object ) {
if ( _identifier == -1 )
return false;
......@@ -224,7 +224,7 @@ bool object_exists( const int _identifier ) {
//===============================================================================
bool get_all_meshes( std::vector<int>& _identifiers ) {
bool getAllMeshes( std::vector<int>& _identifiers ) {
_identifiers.clear();
......@@ -290,12 +290,12 @@ void setGlobalDrawMode( const unsigned int _mode ) {
}
bool scenegraph_pick( ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr=0 ) {
bool scenegraphPick( ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr=0 ) {
return examiner_widgets_[activeExaminer_]->pick( _pickTarget,_mousePos,_nodeIdx,_targetIdx,_hitPointPtr );
}
bool scenegraph_pick( const unsigned int _examiner, ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr=0 ) {
bool scenegraphPick( 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() ) {
std::cerr << "Wrong examiner id" << std::endl;
......@@ -467,7 +467,7 @@ void addGlobalNode(ACG::SceneGraph::BaseNode* _node){
}
}
int object_count() {
int objectCount() {
int count = 0;
......@@ -481,7 +481,7 @@ int object_count() {
}
int target_count() {
int targetCount() {
int count = 0;
......@@ -494,7 +494,7 @@ int target_count() {
return ( count );
}
int source_count() {
int sourceCount() {
int count = 0;
// find changed manipulator
......@@ -506,7 +506,7 @@ int source_count() {
return ( count );
}
int visible_count() {
int visibleCount() {
int count = 0;
// find changed manipulator
......
......@@ -70,7 +70,7 @@ namespace PluginFunctions {
* @return true if mesh was found, false if picked object is not a mesh or not found
*/
DLLEXPORT
bool get_picked_object(const unsigned int _node_idx , BaseObjectData*& _object);
bool getPickedObject(const unsigned int _node_idx , BaseObjectData*& _object);
/** \brief Delete the object with the given id
*
......@@ -115,7 +115,7 @@ int copyObject( const int _id );
* @return false, if no object is selected as source
*/
DLLEXPORT
bool get_source_identifiers( std::vector<int>& _identifiers );
bool getSourceIdentifiers( std::vector<int>& _identifiers );
/** \brief Get the identifiers of all objects marked as a target object.
*
......@@ -123,7 +123,7 @@ bool get_source_identifiers( std::vector<int>& _identifiers );
* @return false, if no object is selected as target
*/
DLLEXPORT
bool get_target_identifiers( std::vector<int>& _identifiers );
bool getTargetIdentifiers( std::vector<int>& _identifiers );
/** \brief Get identifiers of all meshes
*
......@@ -131,7 +131,7 @@ bool get_target_identifiers( std::vector<int>& _identifiers );
* @return false, if no mesh is found
*/
DLLEXPORT
bool get_all_meshes( std::vector<int>& _identifiers );
bool getAllMeshes( std::vector<int>& _identifiers );
/** \brief Get identifiers of all objects
*
......@@ -139,7 +139,7 @@ bool get_all_meshes( std::vector<int>& _identifiers );
* @return false, if no mesh is found
*/
DLLEXPORT
bool get_all_object_identifiers( std::vector<int>& _identifiers );
bool getAllObjectIdentifiers( std::vector<int>& _identifiers );
/** \brief Get the object which has the given identifier.
......@@ -153,13 +153,13 @@ bool get_all_object_identifiers( std::vector<int>& _identifiers );
* @return Object found?
*/
DLLEXPORT
bool get_object( const int _identifier , BaseObject*& _object );
bool getObject( const int _identifier , BaseObject*& _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.
*/
DLLEXPORT
bool get_object( const int _identifier , BaseObjectData*& _object );
bool getObject( const int _identifier , BaseObjectData*& _object );
/** \brief Check if an object with this identifier exists.
*
......@@ -167,23 +167,23 @@ bool get_object( const int _identifier , BaseObjectData*& _object );
* @param _identifier Object id to search for
*/
DLLEXPORT
bool object_exists( const int _identifier );
bool objectExists( const int _identifier );
/// Get the number of available objects
DLLEXPORT
int object_count();
int objectCount();
/// Get the number of target objects
DLLEXPORT
int target_count();
int targetCount();
/// Get the number of source objects
DLLEXPORT
int source_count();
int sourceCount();
/// Get the number of visible objects
DLLEXPORT
int visible_count();
int visibleCount();
/** @} */
......@@ -206,13 +206,13 @@ unsigned int activeExaminer();
* Set by mouseevents from the core
*/
DLLEXPORT
bool scenegraph_pick( ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr );
bool scenegraphPick( ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr );
/** Execute picking operation on scenegraph
* This picking function will pick in the specified examiner context
*/
DLLEXPORT
bool scenegraph_pick( const unsigned int _examiner ,ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr );
bool scenegraphPick( 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
* If you are reacting on a mouseEvent you should use this function as it will
......
......@@ -76,7 +76,7 @@ void Core::slotObjectUpdated(int _identifier) {
// If we are called for a special object, we update it ourself so the Plugins dont need to do that.
BaseObject* object = 0;
if ( _identifier != -1 ) {
if ( !PluginFunctions::get_object(_identifier,object) ) {
if ( !PluginFunctions::getObject(_identifier,object) ) {
emit log(LOGERR,"updated_objects called for non existing object with id : " + QString::number(_identifier) );
return;
}
......
......@@ -177,7 +177,7 @@ void Core::slotLoad(QString _filename, DataType _type, int& _id) {
// get the opened object
BaseObjectData* object;
PluginFunctions::get_object(_id,object);
PluginFunctions::getObject(_id,object);
if ( OpenFlipper::Options::randomBaseColor() )
object->setBaseColor(ACG::Vec4f((float)(rand()%255)/255.0,
......@@ -209,13 +209,13 @@ void Core::slotLoad(QString _filename, DataType _type, int& _id) {
QString filename = object->path() + OpenFlipper::Options::dirSeparator() + object->name();
BaseObject* object2;
PluginFunctions::get_object(_id,object2);
PluginFunctions::getObject(_id,object2);
if ( OpenFlipper::Options::gui() )
coreWidget_->addRecent( filename, object2->dataType() );
// if this is the first object opend, reset the global draw mode of all examiners to standard draw mode
if ( PluginFunctions::object_count() == 1 && OpenFlipper::Options::gui() && !OpenFlipper::Options::loadingSettings() )
if ( PluginFunctions::objectCount() == 1 && OpenFlipper::Options::gui() && !OpenFlipper::Options::loadingSettings() )
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
coreWidget_->examiner_widgets_[i]->drawMode( OpenFlipper::Options::standardDrawMode() );
coreWidget_->examiner_widgets_[i]->viewAll();
......@@ -234,7 +234,7 @@ void Core::slotLoad(QString _filename, DataType _type, int& _id) {
// get the opened object
BaseObjectData* object;
PluginFunctions::get_object(_id,object);
PluginFunctions::getObject(_id,object);
///@todo : set a default path for new objects
// QString filename = object->path() + OpenFlipper::Options::dirSeparator() + object->name();
......
......@@ -47,7 +47,7 @@
/// (existing files will be overwritten)
bool Core::saveObject( int _id, QString _filename ) {
BaseObjectData* object;
PluginFunctions::get_object(_id,object);
PluginFunctions::getObject(_id,object);
for (int i=0; i < (int)supportedTypes_.size(); i++)
if (object->dataType() == supportedTypes_[i].type) {
......@@ -97,7 +97,7 @@ bool Core::saveObjectTo( int _id, QString _filename ) {
if ( OpenFlipper::Options::gui() ){
BaseObjectData* object;
PluginFunctions::get_object(_id,object);
PluginFunctions::getObject(_id,object);
//init widget
LoadWidget* widget = new LoadWidget(supportedTypes_);
......
......@@ -427,7 +427,7 @@ void BaseObject::deleteSubtree() {
// BaseObjectData* object;
//
// // If id is -1 this is a group or rootitem so dont stop here
// if ( (objectId_ != -1) && !PluginFunctions::get_object(objectId_,object) )
// if ( (objectId_ != -1) && !PluginFunctions::getObject(objectId_,object) )
// return this;
//
// for ( int i = 0 ; i < childItems.size(); ++i ) {
......
......@@ -104,7 +104,7 @@ void CoreWidget::updatePopupMenu(const QPoint& _point, unsigned int _examinerId)
ACG::Vec3d hit_point;
BaseObjectData* object;
if (examiner_widgets_[_examinerId]->pick( ACG::SceneGraph::PICK_ANYTHING,_point,node_idx, target_idx, &hit_point ) ) {
if ( PluginFunctions::get_picked_object(node_idx, object) )
if ( PluginFunctions::getPickedObject(node_idx, object) )
objectId = object->id();
}
......
......@@ -89,12 +89,12 @@ void CoreWidget::startDrag ( QMouseEvent* _event )
unsigned int node_idx, target_idx;
ACG::Vec3d hit_point;
BaseObjectData* object;
if ( PluginFunctions::scenegraph_pick ( ACG::SceneGraph::PICK_ANYTHING,
if ( PluginFunctions::scenegraphPick ( ACG::SceneGraph::PICK_ANYTHING,
position,
node_idx,
target_idx,
&hit_point ) ) {
if ( PluginFunctions::get_picked_object ( node_idx, object ) )
if ( PluginFunctions::getPickedObject ( node_idx, object ) )
objectId = object->id();
}
......
......@@ -314,7 +314,7 @@ int LoadWidget::showSave(int _id, QString _filename){
//set dataType
BaseObjectData* object;
PluginFunctions::get_object(_id,object);
PluginFunctions::getObject(_id,object);
bool typeFound = false;
for (int i=0; i < typeBox_->count(); i++){
......
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