| 1 |
///////////////////////////////////////////////////////////// |
| 2 |
// // |
| 3 |
// Copyright (c) 2007-2017 by The University of Queensland // |
| 4 |
// Centre for Geoscience Computing // |
| 5 |
// http://earth.uq.edu.au/centre-geoscience-computing // |
| 6 |
// // |
| 7 |
// Primary Business: Brisbane, Queensland, Australia // |
| 8 |
// Licensed under the Open Software License version 3.0 // |
| 9 |
// http://www.apache.org/licenses/LICENSE-2.0 // |
| 10 |
// // |
| 11 |
///////////////////////////////////////////////////////////// |
| 12 |
|
| 13 |
#ifndef SHAPE_H |
| 14 |
#define SHAPE_H |
| 15 |
|
| 16 |
#include "util/vector3.h" |
| 17 |
#include "MNTable3D.h" |
| 18 |
class Shape { |
| 19 |
public: |
| 20 |
Shape(); |
| 21 |
|
| 22 |
/** |
| 23 |
* Tell the shape to be randomly orientated. This will make every object |
| 24 |
* have a random orientation |
| 25 |
* \param i 1 for using random orientation, 0 to disable |
| 26 |
*/ |
| 27 |
void makeOrientationRandom(int i); |
| 28 |
|
| 29 |
/** |
| 30 |
* Returns 1 if the shape is to be randomly orientated |
| 31 |
* \returns 1 if shape is to be randomly orientated |
| 32 |
*/ |
| 33 |
int useRandomOrientation(); |
| 34 |
|
| 35 |
/** |
| 36 |
* Sets a random orientation. Note that this will be run before every |
| 37 |
* insert if the appropriate function is called. |
| 38 |
*/ |
| 39 |
void setRandomOrientation(); |
| 40 |
|
| 41 |
/** |
| 42 |
* Set a random pitch to the object |
| 43 |
*/ |
| 44 |
void setRandomPitch(); |
| 45 |
|
| 46 |
/** |
| 47 |
* Set a random yaw to the object |
| 48 |
*/ |
| 49 |
void setRandomYaw(); |
| 50 |
|
| 51 |
/** |
| 52 |
* Set a random roll to the object |
| 53 |
*/ |
| 54 |
void setRandomRoll(); |
| 55 |
|
| 56 |
/** |
| 57 |
* Rotate a point around the x, y and z axies. Rotation values are given |
| 58 |
* using setRoll functions etc. |
| 59 |
* \param point the point to rotate |
| 60 |
* \returns the rotated point |
| 61 |
*/ |
| 62 |
Vector3 rotatePoint(Vector3 point); |
| 63 |
|
| 64 |
virtual void insert(Vector3 pos, double radius, MNTable3D* ntable,int tag,int id ) { std::cout << "No shape" << std::endl; return;} ; |
| 65 |
|
| 66 |
/** |
| 67 |
* Show the bias of a given shape (ie how likely it is to occur. |
| 68 |
* Note that the function must return a deterministic value. |
| 69 |
*/ |
| 70 |
int bias(); |
| 71 |
|
| 72 |
/** |
| 73 |
* Set the bias of the given shape |
| 74 |
* \param bias the bias of the shape |
| 75 |
*/ |
| 76 |
void setBias(int); |
| 77 |
|
| 78 |
void setPitch(double); |
| 79 |
double getPitch(); |
| 80 |
void setYaw(double); |
| 81 |
double getYaw(); |
| 82 |
void setRoll(double); |
| 83 |
double getRoll(); |
| 84 |
|
| 85 |
void setBondTag(int); |
| 86 |
int getBondTag(); |
| 87 |
void setParticleTag(int); |
| 88 |
int getParticleTag(); |
| 89 |
|
| 90 |
~Shape(); |
| 91 |
protected: |
| 92 |
double pitch; |
| 93 |
double yaw; |
| 94 |
double roll; |
| 95 |
int bias_factor; |
| 96 |
int randomOrientation; |
| 97 |
int bondTag; |
| 98 |
int particleTag; |
| 99 |
}; |
| 100 |
|
| 101 |
#endif /* SHAPE_H */ |