Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef DREDGE_TOOL_H_
00015 #define DREDGE_TOOL_H_
00016 #include "SimulatedDevice.h"
00017 using namespace uwsim;
00018
00019
00020
00021 #include <osgParticle/ModularEmitter>
00022 #include <osgParticle/ParticleSystemUpdater>
00023 #include <osgParticle/BoxPlacer>
00024
00025 #include <osgParticle/FluidFrictionOperator>
00026 #include <osgParticle/ModularProgram>
00027
00028
00029
00030
00031 class AttractOperator : public osgParticle::Operator
00032 {
00033 public:
00034 AttractOperator() : osgParticle::Operator(), _magnitude(1.0f), _killSink(true){}
00035 AttractOperator( const AttractOperator& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY )
00036 : osgParticle::Operator(copy, copyop), _magnitude(copy._magnitude), _killSink(copy._killSink)
00037 {}
00038 META_Object( spin, AttractOperator );
00039
00041 void setMagnitude( float mag ) { _magnitude = mag; }
00043 float getMagnitude() const { return _magnitude; }
00045 void setKillSink( bool kill ) { _killSink = kill; }
00047 bool getKillSink() const { return _killSink; }
00049 inline void operate( osgParticle::Particle* P, double dt );
00050
00051 protected:
00052 virtual ~AttractOperator() {}
00053 AttractOperator& operator=( const AttractOperator& ) { return *this; }
00054 float _magnitude;
00055 bool _killSink;
00056 };
00057
00058
00059 osgParticle::ParticleSystem* createSmokeParticles( osg::Group* parent, osgParticle::RandomRateCounter * rrc);
00060
00061
00062
00063 class DredgeTool_Config : public SimulatedDeviceConfig
00064 {
00065 public:
00066
00067 std::string target;
00068 double offsetp[3];
00069 double offsetr[3];
00070
00071 DredgeTool_Config(std::string type_) :
00072 SimulatedDeviceConfig(type_)
00073 {
00074 }
00075 };
00076
00077
00078 class DredgeTool_Factory : public SimulatedDeviceFactory
00079 {
00080 public:
00081
00082 DredgeTool_Factory(std::string type_ = "DredgeTool") :
00083 SimulatedDeviceFactory(type_)
00084 {
00085 }
00086 ;
00087
00088 SimulatedDeviceConfig::Ptr processConfig(const xmlpp::Node* node, ConfigFile * config);
00089 bool applyConfig(SimulatedIAUV * auv, Vehicle &vehicleChars, SceneBuilder *sceneBuilder, size_t iteration);
00090 };
00091
00092
00093
00094 #include "ConfigXMLParser.h"
00095 #include "ROSInterface.h"
00096 #include <ros/ros.h>
00097 #include "UWSimUtils.h"
00098
00099
00100 class DredgeTool : public SimulatedDevice, public AbstractDredgeTool
00101 {
00102 osg::ref_ptr<osg::Node> target;
00103 osgParticle::ParticleSystem* smoke;
00104 osgParticle::RandomRateCounter * rrc;
00105
00106
00107 int particles;
00108
00109 void applyPhysics(BulletPhysics * bulletPhysics)
00110 {
00111 }
00112 public:
00113 std::string info;
00114
00115 DredgeTool(DredgeTool_Config * cfg, osg::ref_ptr<osg::Node> target);
00116
00117 virtual boost::shared_ptr<osg::Matrix> getDredgePosition();
00118
00119 void dredgedParticles(int nparticles);
00120
00121
00122 };
00123
00124
00125 #endif