Skip to content

Commit

Permalink
Fold in material hard-tock
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon committed Jun 17, 2022
1 parent ecaa403 commit a9517c0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions graphics/src/Material.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ unsigned int Material::Implementation::counter = 0;
Material::Material()
: dataPtr(gz::utils::MakeUniqueImpl<Implementation>())
{
this->dataPtr->name = "ignition_material_" +
this->dataPtr->name = "gz_material_" +
std::to_string(this->dataPtr->counter++);
this->dataPtr->blendMode = REPLACE;
this->dataPtr->shadeMode = GOURAUD;
Expand All @@ -118,7 +118,7 @@ Material::Material()
Material::Material(const math::Color &_clr)
: dataPtr(gz::utils::MakeUniqueImpl<Implementation>())
{
this->dataPtr->name = "ignition_material_" +
this->dataPtr->name = "gz_material_" +
std::to_string(this->dataPtr->counter++);
this->dataPtr->blendMode = REPLACE;
this->dataPtr->shadeMode = GOURAUD;
Expand Down
2 changes: 1 addition & 1 deletion graphics/src/Material_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TEST_F(MaterialTest, Material)
common::Material mat(math::Color(1.0f, 0.5f, 0.2f, 1.0f));
EXPECT_TRUE(mat.Ambient() == math::Color(1.0f, 0.5f, 0.2f, 1.0f));
EXPECT_TRUE(mat.Diffuse() == math::Color(1.0f, 0.5f, 0.2f, 1.0f));
EXPECT_STREQ("ignition_material_0", mat.Name().c_str());
EXPECT_STREQ("gz_material_0", mat.Name().c_str());

mat.SetTextureImage("texture_image");
EXPECT_STREQ("texture_image", mat.TextureImage().c_str());
Expand Down
18 changes: 9 additions & 9 deletions test/integration/mesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,16 @@ TEST_F(MeshTest, Access)
/////////////////////////////////////////////////
TEST_F(MeshTest, RoundtripStl)
{
std::ofstream stlFile("ignition_stl_test.stl", std::ios::out);
std::ofstream stlFile("gz_stl_test.stl", std::ios::out);
stlFile << asciiSTLBox;
stlFile.close();

auto mesh =
common::MeshManager::Instance()->Load("ignition_stl_test-bad.stl");
common::MeshManager::Instance()->Load("gz_stl_test-bad.stl");
EXPECT_EQ(nullptr, mesh);

common::systemPaths()->AddFilePaths(common::cwd());
mesh = common::MeshManager::Instance()->Load("ignition_stl_test.stl");
mesh = common::MeshManager::Instance()->Load("gz_stl_test.stl");
ASSERT_NE(nullptr, mesh);

math::Vector3d center, min, max;
Expand All @@ -232,20 +232,20 @@ TEST_F(MeshTest, RoundtripStl)
/////////////////////////////////////////////////
TEST_F(MeshTest, Export)
{
std::ofstream stlFile("ignition_stl_test.stl", std::ios::out);
std::ofstream stlFile("gz_stl_test.stl", std::ios::out);
stlFile << asciiSTLBox;
stlFile.close();

common::systemPaths()->AddFilePaths(common::cwd());
auto mesh = common::MeshManager::Instance()->Load("ignition_stl_test.stl");
auto mesh = common::MeshManager::Instance()->Load("gz_stl_test.stl");

ASSERT_NE(nullptr, mesh);
common::MeshManager::Instance()->Export(mesh,
common::joinPaths(common::cwd(), "ignition_stl_test2"), "stl", false);
common::joinPaths(common::cwd(), "gz_stl_test2"), "stl", false);
common::MeshManager::Instance()->Export(mesh,
common::joinPaths(common::cwd(), "ignition_stl_test2"), "dae", false);
common::joinPaths(common::cwd(), "gz_stl_test2"), "dae", false);

EXPECT_FALSE(common::exists("ignition_stl_test2.stl"));
EXPECT_TRUE(common::exists("ignition_stl_test2.dae"));
EXPECT_FALSE(common::exists("gz_stl_test2.stl"));
EXPECT_TRUE(common::exists("gz_stl_test2.dae"));
}

0 comments on commit a9517c0

Please sign in to comment.