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

Last change on this file since 242 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
RevLine 
[235]1#ifndef _MODELGEOCLASS_H_
2#define _MODELGEOCLASS_H_
3
4#include <frams/model/modelobj.h>
5
[242]6class ModelGeometry : public DestrBase
[235]7{
[242]8public:
9        ModelObj *model;
10        double density;
[235]11
[242]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;
[235]16
[242]17        Param par;
18
19        ModelGeometry(ModelObj *mo = NULL);
20        ~ModelGeometry();
21
22        void invalidateAllCached();
23        void onDensityChanged();
24
[235]25#define STATRICKCLASS ModelGeometry
[242]26        PARAMPROCDEF(p_formodel);
27        PARAMPROCDEF(p_volume);
28        PARAMPROCDEF(p_area);
29        PARAMPROCDEF(p_sizesandaxes);
[235]30#undef STATRICKCLASS
31
[242]32        static ExtObject makeDynamicObject(ModelGeometry* mg);
[235]33};
34
35#endif
Note: See TracBrowser for help on using the repository browser.