Last change
on this file since 269 was
242,
checked in by Maciej Komosinski, 11 years ago
|
Added caching of geometry properties (which are costly to compute)
|
-
Property svn:eol-style set to
native
|
File size:
761 bytes
|
Rev | Line | |
---|
[235] | 1 | #ifndef _MODELGEOCLASS_H_ |
---|
| 2 | #define _MODELGEOCLASS_H_ |
---|
| 3 | |
---|
| 4 | #include <frams/model/modelobj.h> |
---|
| 5 | |
---|
[242] | 6 | class ModelGeometry : public DestrBase |
---|
[235] | 7 | { |
---|
[242] | 8 | public: |
---|
| 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.