-// Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2019 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
void readBrep(Geometry* geom, const std::string& fileName)
{
- char* txt = TestUtils::readTextFile(TestUtils::getTestFilePath(fileName));
+ std::string filePath = "Shapes/Brep/" + fileName;
+ char* txt = TestUtils::readTextFile(TestUtils::getTestFilePath(filePath));
geom->setShapeString(txt);
}
void BrepGeometryTest::testGetIDs()
{
BrepGeometry* geom = new BrepGeometry("box");
- readBrep(geom, "Box_1.brep");
+ readBrep(geom, "box1.brep");
CPPUNIT_ASSERT_EQUAL(8, geom->countElements(XAO::VERTEX));
CPPUNIT_ASSERT_EQUAL(8, geom->countVertices());
void BrepGeometryTest::testGetReferences()
{
BrepGeometry* geom = new BrepGeometry("box");
- readBrep(geom, "Box_1.brep");
+ readBrep(geom, "box1.brep");
// vertex of index 1 has id = 7
CPPUNIT_ASSERT_EQUAL(std::string("7"), geom->getElementReference(XAO::VERTEX, 1));
void BrepGeometryTest::testGetNames()
{
BrepGeometry* geom = new BrepGeometry("box");
- readBrep(geom, "Box_1.brep");
+ readBrep(geom, "box1.brep");
int id;
void BrepGeometryTest::testGetEdgeVertices()
{
BrepGeometry* geom = new BrepGeometry("box");
- readBrep(geom, "Box_2.brep");
+ readBrep(geom, "box2.brep");
// edge of index 23, id = #63
// vertex are 47 (#12), 59 (#15)
void BrepGeometryTest::testGetFaceEdges()
{
BrepGeometry* geom = new BrepGeometry("box");
- readBrep(geom, "Box_2.brep");
+ readBrep(geom, "box2.brep");
CPPUNIT_ASSERT_EQUAL(2, geom->countFaceWires(1)); // face 13
CPPUNIT_ASSERT_EQUAL(1, geom->countFaceWires(2)); // face 29
void BrepGeometryTest::testSolidFaces()
{
BrepGeometry* geom = new BrepGeometry("box");
- readBrep(geom, "Cut_2.brep");
+ readBrep(geom, "cut.brep");
CPPUNIT_ASSERT_EQUAL(5, geom->countSolidShells(0));
void BrepGeometryTest::testGetVertex()
{
BrepGeometry* geom = new BrepGeometry("box");
- readBrep(geom, "Box_2.brep");
+ readBrep(geom, "box2.brep");
double x, y, z;
geom->getVertexXYZ(15, x, y, z);
void BrepGeometryTest::testGetEdgeLength()
{
BrepGeometry* geom = new BrepGeometry("box");
- readBrep(geom, "Box_2.brep");
+ readBrep(geom, "box2.brep");
// edges 0 (#5), 7 (#21)
CPPUNIT_ASSERT_DOUBLES_EQUAL(200., geom->getEdgeLength(0), 0);
void BrepGeometryTest::testGetFaceArea()
{
BrepGeometry* geom = new BrepGeometry("box");
- readBrep(geom, "Box_2.brep");
+ readBrep(geom, "box2.brep");
// faces 0 (#3), 1 (#13)
CPPUNIT_ASSERT_DOUBLES_EQUAL(40000., geom->getFaceArea(0), 1e-9);
void BrepGeometryTest::testGetSolidVolume()
{
BrepGeometry* geom = new BrepGeometry("box");
- readBrep(geom, "Box_2.brep");
+ readBrep(geom, "box2.brep");
CPPUNIT_ASSERT_DOUBLES_EQUAL(7488000., geom->getSolidVolume(0), 1e-9);
void BrepGeometryTest::testParse()
{
BrepGeometry* geom = new BrepGeometry("box");
- readBrep(geom, "Box_2.brep");
+ readBrep(geom, "box2.brep");
std::cout << std::endl;
for (int solidIndex = 0; solidIndex < geom->countSolids(); ++solidIndex)