Skip to content

Commit

Permalink
WIP9
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed Jul 25, 2023
1 parent 9e270f1 commit a38b2df
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions src/io_assimp/io_assimp_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <cassert>
#include <gp_Trsf.hxx>
#include <BRep_Builder.hxx>
#include <BRepLib_ToolTriangulatedShape.hxx>
#include <Image_Texture.hxx>
#include <Poly_Triangulation.hxx>
#include <TDataStd_Name.hxx>
Expand Down Expand Up @@ -137,49 +136,8 @@ Handle(Image_Texture) createOccTexture(const aiString& strFilepath, const FilePa
qDebug() << "textureFilepath:" << QString::fromStdString(textureFilepath.u8string())
<< "exists:" << filepathExists(textureFilepath);


#if 0
std::string dir = vtksys::SystemTools::GetParentDirectory(this->Parent->GetFileName());
std::string texturePath = vtksys::SystemTools::CollapseFullPath(path, dir);

// try to get the texture in the same dir as the model file
if (!vtksys::SystemTools::FileExists(texturePath))
{
std::string fileName = vtksys::SystemTools::GetFilenameName(path);
texturePath = vtksys::SystemTools::CollapseFullPath(fileName, dir);
}

if (vtksys::SystemTools::FileExists(texturePath))
{
vtkSmartPointer<vtkImageReader2> reader;
reader.TakeReference(vtkImageReader2Factory::CreateImageReader2(texturePath.c_str()));

if (!reader)
{
vtkWarningWithObjectMacro(
this->Parent, "Cannot instantiate the image reader for texture: " << texturePath);
return nullptr;
}

reader->SetFileName(texturePath.c_str());

vTexture = vtkSmartPointer<vtkTexture>::New();
vTexture->SetInputConnection(reader->GetOutputPort());
}
else
{
vtkWarningWithObjectMacro(this->Parent, "Cannot find texture: " << texturePath);
return nullptr;
}
}
#endif
}

// vTexture->MipmapOn();
// vTexture->InterpolateOn();
// vTexture->SetColorModeToDirectScalars();
// vTexture->SetUseSRGBColorSpace(sRGB);

return texture;
}

Expand Down

0 comments on commit a38b2df

Please sign in to comment.