void
CameraCalib::switchMode(Feed type, boolean writeToFile) {
	std::cout << "Change mode to " << type << std::endl;
	feedType = type;

	if (!writeToFile) {
		translatePoints(type);
		return;
	}
	
	Reset();
	if (currentFile.is_open()) {
		currentFile.flush();
		currentFile.close();
	}
	
	if (type == COLOR1) {
		currentFile.open(colorFile1, std::fstream::out);
		currentList = &camera1Points[0];
	}
	else if (type == DEPTH1) {
		currentFile.open(depthFile1, std::fstream::out);
		currentList = &camera1Points[1];
	}
	else if (type == COLOR2) {
		currentFile.open(colorFile2, std::fstream::out);
		currentList = &camera2Points[0];
	}
	else if (type == DEPTH2) {
		currentFile.open(depthFile2, std::fstream::out);
		currentList = &camera2Points[1];
	}
}
示例#2
0
std::list<MeshData> voronoiShatter_sphereDistributionOnPoint(MeshData &meshData, int numPoints, KDPoint targetPoint, double radius, bool doDisjointMesh)
{
	//Generate random points in a sphere and translate in targetPoint
	//std::list<KDPoint> randomPoints = randomPointsInSphere(numPoints, radius);
	#define GAUSS_WIDTH 1.0
	std::list<KDPoint> randomPoints = randomPointsInSphereGaussianDistribution(numPoints, radius, GAUSS_WIDTH);
	std::list<KDPoint> translatedPoints = translatePoints(randomPoints, targetPoint);

	//Compute Voronoi Shatter
	std::list<MeshData> shatteredMeshes = voronoiShatter(meshData, translatedPoints);

	if (doDisjointMesh)
	{
		//Disjoint meshes
		shatteredMeshes = disjointNonContiguousListMeshes(shatteredMeshes);
	}

	//Translate generated shattered meshes in barycenter
		//std::list<TranslatedMeshData> translatedMeshData = centerMeshesInBarycenter(shatteredMeshes); //This is moved out this function
		//return translatedMeshData;

	return shatteredMeshes;
}