diff --git a/adf_loader/adf_loader_base.h b/adf_loader/adf_loader_base.h index d8a6ba311..4d725d583 100644 --- a/adf_loader/adf_loader_base.h +++ b/adf_loader/adf_loader_base.h @@ -59,58 +59,61 @@ class ADFLoaderBase{ ~ADFLoaderBase(){} // Load object attributes - virtual bool loadObjectAttribs(YAML::Node* a_node, std::string a_objName, afType a_objType, afBaseObjectAttributes* a_objAttribs){} + virtual bool loadObjectAttribs(YAML::Node* a_node, std::string a_objName, afType a_objType, afBaseObjectAttributes* a_objAttribs){return 0;} // Load Light Attributes - virtual bool loadLightAttribs(YAML::Node* a_node, afLightAttributes* attribs){} + virtual bool loadLightAttribs(YAML::Node* a_node, afLightAttributes* attribs){return 0;} // Load Camera Attributes - virtual bool loadCameraAttribs(YAML::Node* a_node, afCameraAttributes* attribs){} + virtual bool loadCameraAttribs(YAML::Node* a_node, afCameraAttributes* attribs){return 0;} // Load rigid body from a YAML::Node - virtual bool loadRigidBodyAttribs(YAML::Node* a_node, afRigidBodyAttributes* attribs){} + virtual bool loadRigidBodyAttribs(YAML::Node* a_node, afRigidBodyAttributes* attribs){return 0;} // Load soft body from a YAML::Node - virtual bool loadSoftBodyAttribs(YAML::Node* a_node, afSoftBodyAttributes* attribs){} + virtual bool loadSoftBodyAttribs(YAML::Node* a_node, afSoftBodyAttributes* attribs){return 0;} // Load ghost object from a YAML::Node - virtual bool loadGhostObjectAttribs(YAML::Node* a_node, afGhostObjectAttributes* attribs){} + virtual bool loadGhostObjectAttribs(YAML::Node* a_node, afGhostObjectAttributes* attribs){return 0;} // Load joint from a YAML::Node - virtual bool loadJointAttribs(YAML::Node* a_node, afJointAttributes* attribs){} + virtual bool loadJointAttribs(YAML::Node* a_node, afJointAttributes* attribs){return 0;} // Load joint from a YAML::Node - virtual bool loadRayTracerSensorAttribs(YAML::Node* a_node, afRayTracerSensorAttributes* attribs){} + virtual bool loadRayTracerSensorAttribs(YAML::Node* a_node, afRayTracerSensorAttributes* attribs){return 0;} // Load joint from a YAML::Node - virtual bool loadResistanceSensorAttribs(YAML::Node* a_node, afResistanceSensorAttributes* attribs){} + virtual bool loadResistanceSensorAttribs(YAML::Node* a_node, afResistanceSensorAttributes* attribs){return 0;} // Load actuator from a YAML::Node - virtual bool loadActuatorAttribs(YAML::Node* a_node, afActuatorAttributes* attribs){} + virtual bool loadActuatorAttribs(YAML::Node* a_node, afActuatorAttributes* attribs){return 0;} // Load actuator from a YAML::Node - virtual bool loadConstraintActuatorAttribs(YAML::Node* a_node, afConstraintActuatorAttributes* attribs){} + virtual bool loadConstraintActuatorAttribs(YAML::Node* a_node, afConstraintActuatorAttributes* attribs){return 0;} // Load sensor from a YAML::Node - virtual bool loadVehicleAttribs(YAML::Node* a_node, afVehicleAttributes* attribs){} + virtual bool loadVehicleAttribs(YAML::Node* a_node, afVehicleAttributes* attribs){return 0;} + + // Load sensor from a YAML::Node + virtual bool loadVolumeAttribs(YAML::Node* a_node, afVolumeAttributes* attribs){return 0;} // Load Input Device Attributes - virtual bool loadInputDeviceAttribs(YAML::Node* a_node, afInputDeviceAttributes *attribs){} + virtual bool loadInputDeviceAttribs(YAML::Node* a_node, afInputDeviceAttributes *attribs){return 0;} // Load Simulated Device Attributes - virtual bool loadSimulatedDeviceAttribs(YAML::Node* a_node, afSimulatedDeviceAttribs *attribs){} + virtual bool loadSimulatedDeviceAttribs(YAML::Node* a_node, afSimulatedDeviceAttribs *attribs){return 0;} // Load all the TU device attributes - virtual bool loadTeleRoboticUnitsAttribs(string a_filepath, vector* attribs, vector dev_indexes){} + virtual bool loadTeleRoboticUnitsAttribs(string a_filepath, vector* attribs, vector dev_indexes){return 0;} // Load model from ADF file - virtual bool loadModelAttribs(string a_filepath, afModelAttributes* attribs){} + virtual bool loadModelAttribs(string a_filepath, afModelAttributes* attribs){return 0;} // Load world from ADF file - virtual bool loadWorldAttribs(string a_filepath, afWorldAttributes* attribs){} + virtual bool loadWorldAttribs(string a_filepath, afWorldAttributes* attribs){return 0;} // Load the launch file - virtual bool loadLaunchFileAttribs(string a_filepath, afLaunchAttributes* attribs){} + virtual bool loadLaunchFileAttribs(string a_filepath, afLaunchAttributes* attribs){return 0;} // Get the version of this loader virtual std::string getLoaderVersion(); diff --git a/ambf_framework/afPluginInterface.h b/ambf_framework/afPluginInterface.h index 1771fd43d..1bbf3b8ea 100644 --- a/ambf_framework/afPluginInterface.h +++ b/ambf_framework/afPluginInterface.h @@ -230,7 +230,7 @@ class afSimulatorPlugin: public afPluginBase{ virtual void graphicsUpdate(){} virtual void physicsUpdate(double dt){} virtual void reset(){} - virtual bool close(){} + virtual bool close(){return 0;} protected: afWorldPtr m_worldPtr; @@ -254,7 +254,7 @@ class afWorldPlugin: public afPluginBase{ virtual void graphicsUpdate(){} virtual void physicsUpdate(double dt){} virtual void reset(){} - virtual bool close(){} + virtual bool close(){return 0;} protected: afWorldPtr m_worldPtr; @@ -277,7 +277,7 @@ class afModelPlugin: public afPluginBase{ virtual void graphicsUpdate(){} virtual void physicsUpdate(double dt){} virtual void reset(){} - virtual bool close(){} + virtual bool close(){return 0;} protected: afModelPtr m_modelPtr; @@ -297,7 +297,7 @@ class afObjectPlugin: public afPluginBase{ virtual void graphicsUpdate(){} virtual void physicsUpdate(double dt){} virtual void reset(){} - virtual bool close(){} + virtual bool close(){return 0;} protected: afBaseObjectPtr m_objectPtr; diff --git a/ambf_framework/afPluginManager.cpp b/ambf_framework/afPluginManager.cpp index 97ca8bc27..c5c762bcc 100644 --- a/ambf_framework/afPluginManager.cpp +++ b/ambf_framework/afPluginManager.cpp @@ -98,6 +98,7 @@ bool afSimulatorPluginManager::close(){ for (vector::iterator it = m_plugins.begin() ; it != m_plugins.end() ; ++it){ (*it)->close(); } + return true; } void ambf::afWorldPluginManager::init(const afWorldPtr a_afWorld, const afWorldAttribsPtr a_worldAttribs) @@ -161,6 +162,7 @@ bool ambf::afWorldPluginManager::close() for (vector::iterator it = m_plugins.begin() ; it != m_plugins.end() ; ++it){ (*it)->close(); } + return true; } void afModelPluginManager::init(const afModelPtr a_afModel, const afModelAttribsPtr a_modelAttribs) @@ -207,10 +209,10 @@ void afModelPluginManager::reset() bool afModelPluginManager::close() { - for (vector::iterator it = m_plugins.begin() ; it != m_plugins.end() ; ++it){ (*it)->close(); } + return true; } void afBaseObjectPluginManager::init(const afBaseObjectPtr a_afObjectPtr, afBaseObjectAttribsPtr a_objectAttribs) @@ -246,4 +248,5 @@ bool afBaseObjectPluginManager::close() for (vector::iterator it = m_plugins.begin() ; it != m_plugins.end() ; ++it){ (*it)->close(); } + return true; }