source: sasview/src/sas/sascalc/simulation/geoshapespy/libgeoshapespy/geo_shape.h @ f4e2f22

magnetic_scattrelease-4.2.2ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249unittest-saveload
Last change on this file since f4e2f22 was d85c194, checked in by Piotr Rozyczko <piotr.rozyczko@…>, 9 years ago

Remaining modules refactored

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*! \file a abstract class GeoShape
2*/
3#ifndef GEOSHAPE_H
4#define GEOSHAPE_H
5
6#include "iq.h"
7#include "Point3D.h"
8#include <vector>
9
10using namespace std;
11
12#define triple(x) ((x) * (x) * (x))
13#define square(x) ((x) * (x))
14
15enum ShapeType{ SPHERE, HOLLOWSPHERE, CYLINDER , ELLIPSOID,SINGLEHELIX};
16
17/**
18 *  class GeoShape, abstract class, parent class for Sphere, Cylinder ....
19 */
20
21class GeoShape{
22 public:
23
24  GeoShape(){
25    vector<double> init(3,0.0);
26    orientation_ = init;
27    center_ = init;
28  }
29 
30  virtual ~GeoShape() {}
31
32  /** calculate the form factor for a simple shape */
33  virtual void GetFormFactor(IQ * iq) = 0;
34
35  /** Get a point that is within the simple shape*/
36  virtual Point3D GetAPoint(double sld) = 0;
37
38  /** check whether a point is inside the shape*/
39  virtual bool IsInside(const Point3D& point) const = 0;
40
41  virtual double GetVolume() = 0;
42
43  virtual ShapeType GetShapeType() const = 0;
44
45  /** get the radius of the sphere to cover the shape*/
46  virtual double GetMaxRadius() = 0;
47
48  void SetOrientation(double angX, double angY, double angZ);
49
50  void SetCenter(double cenX, double cenY, double cenZ);
51
52  vector<double> GetOrientation() const;
53
54  vector<double> GetCenter() const;
55
56  Point3D GetCenterP() const;
57
58 private:
59  vector<double> orientation_;
60 
61 protected:
62  vector<double> center_;
63 
64};
65
66#endif
Note: See TracBrowser for help on using the repository browser.