// the basic triset/volume wrapper triset::triset(unsigned int maxVoxExt, const geom::triset& tris, PROGRESSFN pfn) { aabb bounds(tris.minX(), tris.maxX(), tris.minY(), tris.maxY(), tris.minZ(), tris.maxZ()); initVolume(maxVoxExt, bounds.width(), bounds.height(), bounds.depth()); alloc(); // allow triangle coordinates to be normalized to voxel space geom::point to = geom::point(bounds.x0, bounds.y0, bounds.z0); double sx = double(width() - 1) / bounds.width(); double sy = double(height() - 1) / bounds.height(); double sz = double(depth() - 1) / bounds.depth(); size_t n = tris.size(); for (unsigned int i = 0; i < n; ++i) { if (pfn) { pfn("Voxelizing triangle", i, n); } // convert this triangle into voxel volume coordinates geom::triangle tri = tris[i] - to; tri.scale(sx, sy, sz); // put voxels on this surface into the voxel volume rasterize(tri); } }
void Player::init() { db = Database::getInstance(); db->setDatabaseName(path+"data/qsalat.db"); db->setDatabase(); initVolume(); index = 0; playing = 0; playButton->setEnabled(false); nextButton->setEnabled(false); prevButton->setEnabled(false); newLoad = true; }
void Player::setInitVolume() { Q_EMIT initVolume(Settings::instance()->getValue("player/volume").toDouble()); }