source: cpp/frams/model/geometry/modelgeoclass.h @ 260

Last change on this file since 260 was 242, checked in by Maciej Komosinski, 10 years ago

Added caching of geometry properties (which are costly to compute)

  • Property svn:eol-style set to native
File size: 761 bytes
Line 
1#ifndef _MODELGEOCLASS_H_
2#define _MODELGEOCLASS_H_
3
4#include <frams/model/modelobj.h>
5
6class ModelGeometry : public DestrBase
7{
8public:
9        ModelObj *model;
10        double density;
11
12        //"cached" fields let avoid redundant computations when asking for the same properties of the same model at the same density
13        double cached_for_density;
14        double cached_volume, cached_area;
15        Pt3D cached_sizes; Orient cached_axes;
16
17        Param par;
18
19        ModelGeometry(ModelObj *mo = NULL);
20        ~ModelGeometry();
21
22        void invalidateAllCached();
23        void onDensityChanged();
24
25#define STATRICKCLASS ModelGeometry
26        PARAMPROCDEF(p_formodel);
27        PARAMPROCDEF(p_volume);
28        PARAMPROCDEF(p_area);
29        PARAMPROCDEF(p_sizesandaxes);
30#undef STATRICKCLASS
31
32        static ExtObject makeDynamicObject(ModelGeometry* mg);
33};
34
35#endif
Note: See TracBrowser for help on using the repository browser.