ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change
on this file since 00c3aac was
f2d6445,
checked in by Mathieu Doucet <doucetm@…>, 17 years ago
|
moving realSpaceModeling to trunk
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[f2d6445] | 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 | |
---|
| 10 | using namespace std; |
---|
| 11 | |
---|
| 12 | #define triple(x) ((x) * (x) * (x)) |
---|
| 13 | #define square(x) ((x) * (x)) |
---|
| 14 | |
---|
| 15 | enum ShapeType{ SPHERE, HOLLOWSPHERE, CYLINDER , ELLIPSOID,SINGLEHELIX}; |
---|
| 16 | |
---|
| 17 | /** |
---|
| 18 | * class GeoShape, abstract class, parent class for Sphere, Cylinder .... |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | class 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.