Added merged flag to Spanner.

This commit is contained in:
Andrzej Kapolka 2014-11-10 11:44:42 -08:00
parent 9a14e46c78
commit 536d6287bd
2 changed files with 6 additions and 1 deletions

View file

@ -1806,7 +1806,8 @@ const float DEFAULT_VOXELIZATION_GRANULARITY = powf(2.0f, -3.0f);
Spanner::Spanner() :
_renderer(NULL),
_placementGranularity(DEFAULT_PLACEMENT_GRANULARITY),
_voxelizationGranularity(DEFAULT_VOXELIZATION_GRANULARITY) {
_voxelizationGranularity(DEFAULT_VOXELIZATION_GRANULARITY),
_merged(false) {
}
void Spanner::setBounds(const Box& bounds) {

View file

@ -549,6 +549,9 @@ public:
void setVoxelizationGranularity(float granularity) { _voxelizationGranularity = granularity; }
float getVoxelizationGranularity() const { return _voxelizationGranularity; }
void setMerged(bool merged) { _merged = merged; }
bool isMerged() const { return _merged; }
/// Checks whether we've visited this object on the current traversal. If we have, returns false.
/// If we haven't, sets the last visit identifier and returns true.
bool testAndSetVisited(int visit);
@ -597,6 +600,7 @@ private:
Box _bounds;
float _placementGranularity;
float _voxelizationGranularity;
bool _merged;
QHash<QThread*, int> _lastVisits; ///< last visit identifiers for each thread
QMutex _lastVisitsMutex;