Commit 657c7fef authored by Jan Möbius's avatar Jan Möbius

Speedup getObject in Pluginfunctions, as most functions used the slow...

Speedup getObject in Pluginfunctions, as most functions used the slow recursive version instead of the std map accelerated version in PluginFunctions

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15085 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 51dcb203
......@@ -73,7 +73,10 @@ bool getObject( int _identifier , BSplineCurveObject*& _object ) {
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< BSplineCurveObject* >(object);
return ( _object != 0 );
}
......
......@@ -75,7 +75,10 @@ bool getObject( int _identifier , BSplineSurfaceObject*& _object ) {
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< BSplineSurfaceObject* >(object);
return ( _object != 0 );
}
......
......@@ -97,7 +97,10 @@ bool getObject( int _identifier , CameraObject*& _object ) {
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< CameraObject* >(object);
return ( _object != 0 );
}
......@@ -108,7 +111,10 @@ CameraObject* cameraObject( int _objectId ) {
return 0;
}
BaseObject* object = objectRoot()->childExists( _objectId );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_objectId,object);
CameraObject* cam = dynamic_cast< CameraObject* >(object);
return cam;
}
......
......@@ -66,7 +66,10 @@ bool getObject( int _identifier , CoordsysObject*& _object ) {
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< CoordsysObject* >(object);
return ( _object != 0 );
}
......@@ -97,7 +100,9 @@ CoordsysObject* coordsysObject( int _objectId ) {
return 0;
}
BaseObject* object = objectRoot()->childExists( _objectId );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_objectId,object);
return dynamic_cast< CoordsysObject* >(object);
}
......
......@@ -98,7 +98,10 @@ bool getObject( int _identifier, HexahedralMeshObject*& _object ) {
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< HexahedralMeshObject* >(object);
return ( _object != 0 );
}
......
......@@ -68,7 +68,10 @@ bool getObject( int _identifier , LightObject*& _object ) {
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< LightObject* >(object);
return ( _object != 0 );
}
......
......@@ -66,7 +66,10 @@ bool getObject( int _identifier , PlaneObject*& _object ) {
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< PlaneObject* >(object);
return ( _object != 0 );
}
......@@ -105,7 +108,10 @@ PlaneObject* planeObject( int _objectId ) {
return 0;
}
BaseObject* object = objectRoot()->childExists( _objectId );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_objectId,object);
PlaneObject* plane = dynamic_cast< PlaneObject* >(object);
return plane;
}
......
......@@ -97,7 +97,10 @@ bool getObject( int _identifier , PolyLineObject*& _object ) {
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< PolyLineObject* >(object);
return ( _object != 0 );
}
......@@ -127,7 +130,9 @@ PolyLineObject* polyLineObject( int _objectId ) {
if (_objectId == -1)
return 0;
BaseObject* object = objectRoot()->childExists( _objectId );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_objectId,object);
if ( object == 0 )
return 0;
......
......@@ -91,7 +91,10 @@ bool getObject( int _identifier , PolyMeshObject*& _object ) {
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< PolyMeshObject* >(object);
return ( _object != 0 );
}
......@@ -103,7 +106,9 @@ bool getMesh( int _identifier , PolyMesh*& _mesh ) {
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
// Unable to find object
if ( object == 0)
......@@ -157,7 +162,9 @@ PolyMeshObject* polyMeshObject( int _objectId ) {
if (_objectId == -1)
return 0;
BaseObject* object = objectRoot()->childExists( _objectId );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_objectId,object);
if ( object == 0 )
return 0;
......
......@@ -98,7 +98,10 @@ bool getObject( int _identifier, PolyhedralMeshObject*& _object ) {
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< PolyhedralMeshObject* >(object);
return ( _object != 0 );
}
......
......@@ -63,7 +63,10 @@ bool getObject( int _identifier , SkeletonObject*& _object ) {
if (_identifier == -1)
return false;
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< SkeletonObject* >(object);
return ( _object != 0 );
}
......
......@@ -68,7 +68,10 @@ bool getObject( int _identifier , SphereObject*& _object ) {
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< SphereObject* >(object);
return ( _object != 0 );
}
......@@ -79,7 +82,10 @@ SphereObject* sphereObject( int _objectId ) {
return 0;
}
BaseObject* object = objectRoot()->childExists( _objectId );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_objectId,object);
SphereObject* sphereObject = dynamic_cast< SphereObject* >(object);
return sphereObject;
......
......@@ -78,7 +78,10 @@ bool getObject( int _identifier, SplatCloudObject *&_object )
return false;
}
BaseObject *object = objectRoot()->childExists( _identifier );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast<SplatCloudObject *>( object );
return (_object != 0);
}
......@@ -169,7 +172,9 @@ SplatCloudObject* splatCloudObject( int _objectId ) {
if (_objectId == -1)
return 0;
BaseObject* object = objectRoot()->childExists( _objectId );
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
PluginFunctions::getObject(_objectId,object);
if ( object == 0 )
return 0;
......
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