Example #1
0
void Rect3D::updatePosition(const DoubleBoundingBox3D bb, const Transform3D& M)
{
	mPoints = vtkPointsPtr::New();
	mPoints->InsertPoint(0, M.coord(bb.corner(0,0,0)).begin());
	mPoints->InsertPoint(1, M.coord(bb.corner(0,1,0)).begin());
	mPoints->InsertPoint(2, M.coord(bb.corner(1,1,0)).begin());
	mPoints->InsertPoint(3, M.coord(bb.corner(1,0,0)).begin());
	mPolyData->SetPoints(mPoints);
}
Example #2
0
DoubleBoundingBox3D DoubleBoundingBox3D::unionWith(const DoubleBoundingBox3D& other) const
{
	std::vector<Vector3D> cloud;
	cloud.push_back(corner(0,0,0));
	cloud.push_back(other.corner(0,0,0));
	cloud.push_back(corner(0,0,1));
	cloud.push_back(other.corner(0,0,1));
	cloud.push_back(corner(0,1,0));
	cloud.push_back(other.corner(0,1,0));
	cloud.push_back(corner(0,1,1));
	cloud.push_back(other.corner(0,1,1));
	cloud.push_back(corner(1,0,0));
	cloud.push_back(other.corner(1,0,0));
	cloud.push_back(corner(1,0,1));
	cloud.push_back(other.corner(1,0,1));
	cloud.push_back(corner(1,1,0));
	cloud.push_back(other.corner(1,1,0));
	cloud.push_back(corner(1,1,1));
	cloud.push_back(other.corner(1,1,1));
	return fromCloud(cloud);
}