bool FillGeometryLibrary(FULogFile& fileOut, FCDGeometryLibrary* library) { FCDGeometry* geometry = library->AddEntity(); PassIf(geometry->GetType() == FCDEntity::GEOMETRY); FailIf(geometry->IsMesh()); FailIf(geometry->IsSpline()); meshId = geometry->GetDaeId(); FailIf(meshId.empty()); // Creates a mesh to export FCDGeometryMesh* mesh = geometry->CreateMesh(); FailIf(geometry->IsSpline()); PassIf(geometry->IsMesh()); PassIf(geometry->GetMesh() == mesh); PassIf(geometry->GetSpline() == NULL); FillGeometryMesh(fileOut, mesh); // Create a spline to export geometry = library->AddEntity(); geometry->CreateMesh(); FCDGeometrySpline* spline = geometry->CreateSpline(); PassIf(geometry->IsSpline()); FailIf(geometry->IsMesh()); PassIf(geometry->GetMesh() == NULL); PassIf(geometry->GetSpline() == spline); FillGeometrySpline(fileOut, spline); splineId = geometry->GetDaeId(); FailIf(splineId.empty()); return true; }
bool CheckGeometryLibrary(FULogFile& fileOut, FCDGeometryLibrary* library) { PassIf(library->GetEntityCount() == 2); // Find the one mesh and the one spline geometries. FCDGeometryMesh* mesh = NULL; FCDGeometrySpline* spline = NULL; for (size_t i = 0; i < 2; ++i) { FCDGeometry* g = library->GetEntity(i); if (g->IsMesh()) mesh = g->GetMesh(); else if (g->IsSpline()) spline = g->GetSpline(); else Fail; } FailIf(mesh == NULL || spline == NULL); CheckGeometryMesh(fileOut, mesh); CheckGeometrySpline(fileOut, spline); return true; }