HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_RandomTwister.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  */
7 
8 #ifndef __SIM_RandomTwister_h__
9 #define __SIM_RandomTwister_h__
10 
11 #include "SIM_API.h"
12 #include <UT/UT_MTwister.h>
13 #include "SIM_Random.h"
14 
15 /// This class defines a bunch of useful tools for random number
16 /// generation. It is designed to be attached as subdata to objects
17 /// or solvers that need a stream of random numbers.
19 {
20 protected:
21  explicit SIM_RandomTwister(const SIM_DataFactory *factory);
22  ~SIM_RandomTwister() override;
23 
24  void initializeSubclass() override;
25  void makeEqualSubclass(const SIM_Data *source) override;
26  void saveSubclass(std::ostream &os) const override;
27  bool loadSubclass(UT_IStream &is) override;
28 
29  uint urandomSubclass() override;
30  void setSeedSubclass(uint seed) override;
31 
32 private:
35  SIM_Random,
36  "Random Stream",
38 
39  UT_MersenneTwister myTwister;
40 };
41 
42 #endif
virtual void makeEqualSubclass(const SIM_Data *source)
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
virtual bool loadSubclass(UT_IStream &is)
virtual uint urandomSubclass()=0
Override this function to implement a new random number generator.
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
virtual void saveSubclass(std::ostream &os) const
#define SIM_API
Definition: SIM_API.h:12
virtual void setSeedSubclass(uint seed)=0
Override this function to initialize the random number generator.
static const SIM_DopDescription * getEmptyDopDescription()
A DOP description that says not to create an automatic DOP.
unsigned int uint
Definition: SYS_Types.h:45
virtual void initializeSubclass()