Пример #1
0
MStatus polyX3DWriter::writeToFile(ostream& os) 
//Summary:	outputs the geometry of this polygonal mesh in X3D compliant format
//Args   :	os - an output stream to write to
//			tabCount - the initial number of tabs to print
//Returns:  MStatus::kSuccess if the method succeeds
//			MStatus::kFailure if the method fails
{
	MGlobal::displayInfo("Exporting " + fMesh->partialPathName());
	unsigned int setCount = fPolygonSets.length();

	if (0 == setCount) {
		return MStatus::kFailure;
	} else if (1 == setCount) {
		if (MStatus::kFailure == outputSets(os)) {
			return MStatus::kFailure;
		}
	} else {
		outputTabs(os, INITIAL_TAB_COUNT);
		fInitialTabCount++;
		os << "<Group DEF=\"" << fMesh->partialPathName() << "\">\n";
		if (MStatus::kFailure == outputSets(os)) {
			return MStatus::kFailure;
		}
		outputTabs(os, INITIAL_TAB_COUNT);
		os << "</Group>\n";
	}
	return MStatus::kSuccess;
}
Пример #2
0
void printOut(int set_a[], int size_a, int set_b[], int size_b)
{
    printf("the intersection of\n");
    outputSets(set_a, size_a);
    printf("and\n");
    outputSets(set_b, size_b);
    printf("is\n");
    findIntersection(set_a, size_a, set_b, size_b);
}
Пример #3
0
MStatus polyRawWriter::writeToFile(ostream& os) 
//Summary:	outputs the geometry of this polygonal mesh in raw text format
//Args   :	os - an output stream to write to
//Returns:  MStatus::kSuccess if the method succeeds
//			MStatus::kFailure if the method fails
{
	MGlobal::displayInfo("Exporting " + fMesh->partialPathName());

	os << SHAPE_DIVIDER;
	os << "Shape:  " << fMesh->partialPathName() << "\n";
	os << SHAPE_DIVIDER;
	os << "\n";

	if (MStatus::kFailure == outputFaces(os)) {
		return MStatus::kFailure;
	}

	if (MStatus::kFailure == outputVertices(os)) {
		return MStatus::kFailure;
	}

	if (MStatus::kFailure == outputVertexInfo(os)) {
		return MStatus::kFailure;
	}

	if (MStatus::kFailure == outputNormals(os)) {
		return MStatus::kFailure;
	}

	if (MStatus::kFailure == outputTangents(os)) {
		return MStatus::kFailure;
	}

	if (MStatus::kFailure == outputBinormals(os)) {
		return MStatus::kFailure;
	}

	if (MStatus::kFailure == outputColors(os)) {
		return MStatus::kFailure;
	}

	if (MStatus::kFailure == outputUVs(os)) {
		return MStatus::kFailure;
	}

	if (MStatus::kFailure == outputSets(os)) {
		return MStatus::kFailure;
	}
	os << "\n\n";
	
	return MStatus::kSuccess;
}