ROOT logo
// $Id: PSSphere.h 2182 2009-04-12 23:11:16Z matevz $

// Copyright (C) 1999-2008, Matevz Tadel. All rights reserved.
// This file is part of GLED, released under GNU General Public License version 2.
// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.

#ifndef Var1_PSSphere_H
#define Var1_PSSphere_H

#include <Glasses/ParaSurf.h>

class PSSphere : public ParaSurf
{
  MAC_RNR_FRIENDS(PSSphere);

private:
  void _init();

protected:
  Bool_t  bInside;    // X{GS} 7 Bool()
  Float_t mR;         // X{GS} 7 Value(-range=>[0.001,1000, 1,1000])

public:
  PSSphere(const Text_t* n="PSSphere", const Text_t* t=0) :
    ParaSurf(n,t) { _init(); }
  virtual ~PSSphere() {}

  virtual void FindMinMaxFGH(TriMesh* mesh); // Exported in ParaSurf.

  virtual Float_t Surface();
  virtual Float_t CharacteristicLength() { return mR; }

  virtual void pos2fgh(const Float_t* x, Float_t* f);
  virtual void fgh2pos(const Float_t* f, Float_t* x);

  virtual void fgh2fdir(const Float_t* f, Float_t* d);
  virtual void fgh2gdir(const Float_t* f, Float_t* d);
  virtual void fgh2hdir(const Float_t* f, Float_t* d);

  virtual void    pos2hdir(const Float_t* x, Float_t* d);
  virtual Float_t pos2hray(const Float_t* x, Opcode::Ray& r);

  virtual void    pos2grav(const Float_t* x, GravData& gd);

  // Subtract fgh values, taking care of U(1) variables (like angles).
  virtual void sub_fgh(Float_t* a, Float_t* b, Float_t* delta);

  // Put fgh values into regular intervals.
  virtual void regularize_fg(Float_t* f);

  // These two return a point ABOVE the surface (at maxH + eps)
  virtual void random_fgh(TRandom& rnd, Float_t* f);
  virtual void random_pos(TRandom& rnd, Float_t* x);


  // Generalizations also used by other code.

  static void fill_spherical_grav(Float_t g0, Float_t R, Bool_t inside,
                                  const Float_t* x, GravData& gd);

#include "PSSphere.h7"
  ClassDef(PSSphere, 1); // Parametric-surface sphere.
}; // endclass PSSphere


#endif
 PSSphere.h:1
 PSSphere.h:2
 PSSphere.h:3
 PSSphere.h:4
 PSSphere.h:5
 PSSphere.h:6
 PSSphere.h:7
 PSSphere.h:8
 PSSphere.h:9
 PSSphere.h:10
 PSSphere.h:11
 PSSphere.h:12
 PSSphere.h:13
 PSSphere.h:14
 PSSphere.h:15
 PSSphere.h:16
 PSSphere.h:17
 PSSphere.h:18
 PSSphere.h:19
 PSSphere.h:20
 PSSphere.h:21
 PSSphere.h:22
 PSSphere.h:23
 PSSphere.h:24
 PSSphere.h:25
 PSSphere.h:26
 PSSphere.h:27
 PSSphere.h:28
 PSSphere.h:29
 PSSphere.h:30
 PSSphere.h:31
 PSSphere.h:32
 PSSphere.h:33
 PSSphere.h:34
 PSSphere.h:35
 PSSphere.h:36
 PSSphere.h:37
 PSSphere.h:38
 PSSphere.h:39
 PSSphere.h:40
 PSSphere.h:41
 PSSphere.h:42
 PSSphere.h:43
 PSSphere.h:44
 PSSphere.h:45
 PSSphere.h:46
 PSSphere.h:47
 PSSphere.h:48
 PSSphere.h:49
 PSSphere.h:50
 PSSphere.h:51
 PSSphere.h:52
 PSSphere.h:53
 PSSphere.h:54
 PSSphere.h:55
 PSSphere.h:56
 PSSphere.h:57
 PSSphere.h:58
 PSSphere.h:59
 PSSphere.h:60
 PSSphere.h:61
 PSSphere.h:62
 PSSphere.h:63
 PSSphere.h:64
 PSSphere.h:65
 PSSphere.h:66