source: sasview/realSpaceModeling/pointsmodelpy/libpointsmodelpy/lores_model.h @ 2f189dc

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 2f189dc was f2d6445, checked in by Mathieu Doucet <doucetm@…>, 17 years ago

moving realSpaceModeling to trunk

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[f2d6445]1/** \file lores_model.h child class of PointsModel*/
2
3#ifndef LORESMODEL_H
4#define LORESMODEL_H
5
6#include <deque>
7#include "points_model.h"
8#include "geo_shape.h"
9//temporary
10#include <fstream>
11
12/**
13 *  Class LORESModel, low resolution models
14 */
15
16class LORESModel : public PointsModel {
17 private:
18  typedef vector<Point3D> PointsVector;
19
20  struct RealSpaceShape {
21    GeoShape* shape;
22    PointsVector points;
23
24    RealSpaceShape(GeoShape* s = NULL) : shape(s) {
25    }
26
27    ~RealSpaceShape() {
28      if (shape) delete shape;
29    }
30  };
31
32  typedef deque<RealSpaceShape*> RealSpaceShapeCollection;
33
34 public:
35  LORESModel(double density = 1.0);
36  ~LORESModel();
37
38  // Change density
39  void SetDensity(double density);
40  double GetDensity();
41
42  // Add new shape
43  void Add(GeoShape& geo_shape, double sld = 1);
44
45  // Delete ith shape at shapes_
46  void Delete(size_t i);
47
48  int GetPoints(Point3DVector &);
49  //Write points to a file, mainly for testing right now
50  void WritePoints2File(Point3DVector &);
51
52  //get the maximum possible dimension
53  double GetDimBound();
54
55  //will be used in determining the maximum distance for
56  //P(r) calculation for a complex model (merge several
57  //pointsmodel instance together
58  vector<double> GetCenter();
59
60 protected:
61  GeoShape* GetGeoShape(GeoShape& geo_shape);
62  void FillPoints(RealSpaceShape* real_shape, double sld);
63  bool IsInside(const Point3D& point);
64  void DistributePoint(const Point3D& point, size_t i);
65
66 private:
67  RealSpaceShapeCollection shapes_;
68  int npoints_;
69  double density_;
70 
71};
72
73#endif
Note: See TracBrowser for help on using the repository browser.