class flip_around_bond: public bist_plugin{
public:
  flip_around_bond(immagine* image, string libpath);
  virtual ~flip_around_bond();
  
  virtual bool act(int e);
  
  
  virtual void register_plugin();
  virtual bool time_to_act();
  

  virtual bool need_atom();
  virtual bool need_leg();

  virtual void inizialize();


protected:

  void find_atoms(atomo** atm_parent, atomo** atm_child);


  bool _has_to_act;
  bool _has_acted;


};


std::pair<float, float> vec_flipped(atomo a, atomo b);
float angle(std::pair<float,float> a, std::pair<float,float> b);
float dot_product_vec(std::pair<float,float> a, std::pair<float,float> b);
float cross_product_vec(std::pair<float,float> a, std::pair<float,float> b);
float magn_vec(std::pair<float,float> a);
std::pair<float,float> normalize_vec(std::pair<float,float> a);


int trasl_depth_search_pf(atomo* da , 
                          void* data, void* data2, void* data3);

bool ignore_plug(atomo* atm, void* data4);
extern "C" bist_plugin* create_plugin(immagine* imm, string libpath);
extern "C"  void destroy_plugin(bist_plugin* j);

