//! date="21/08/95" // ------------------------------------------------------------------------- // ********** PolopRanC **************************************************** // ------------------------------------------------------------------------- //! file="amma/Surf3d/PolopExt/PolopRan.hh" //! author="Andrew Stoddart" //! userlevel = Default //! lib=PolExt //! rcsid = "$Id: PolopRan.hh,v 1.6 2000/02/16 14:13:11 ees1cg Exp $" //! docentry = "3D Surface.Polyhedral Extensions" #ifndef PolopRan_HH #define PolopRan_HH #include "amma/Polops.hh" #include "amma/SArray1d.hh" // ------------------------------------------------------------------------- // ********** PolopRanC **************************************************** // ------------------------------------------------------------------------- // The random number generator is Random1. // Seeding is done in the constructor class PolopRanC { private: SArray1dC c_area; // cumulative area PolopsC pol; // the polops structure requested int idum; // seed for random number generator int locate(double x); // find face in cumulative area array public: // Constructors, destructor, assignment // ------------------------------------- PolopRanC(PolopsC & inpol, int inidum); // Constructor (make cumulative area table), accept random seed ~PolopRanC(); // Destructor // General operations // ------------------ VectorSetC RandomPoints(int n); // returns n random positions on the surface PolVecC RandomPt(int *face=NULL); // returns a point at a random position on the surface, // and sets face to the index of the face on which the point lies void Save(int n, char *fname); // save n random points to file .list }; // ------------------------------------------------------------------------- #endif // ------------------------------------------------------------------------- // End of include file PolopRan.hh // -------------------------------------------------------------------------