#ifndef _PARTICLESET_
#define _PARTICLESET_

#include <SoParticle.h>

#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoMaterial.h>
#include <Inventor/nodes/SoComplexity.h>

#define MAX_TRIES      10

class ParticleSet {
public:

  int particleNum;
  float radius;
  float mass;
  float comp;

  bool nodeCreated;

  ParticleSet  ();
  ParticleSet  (int pnum, float rad, float ma);
  ~ParticleSet ();

  SoSeparator*  getNewSet ();
  void          updateSet ();
  
private:
  SoSeparator  *root;
  SoComplexity *complexity;
  SoMaterial   *material;
  SoSeparator  *pset;

  void          makeNode  ();
  SoParticle*   makeParticle ();
  int           findPosition (SbVec3f &pos);
  int           overlap      (SbVec3f pos);

};

#endif // _PARTICLESET_

  
