Updates will be applied - 3:30pm EDT (UTC -400). No downtime expected.

Commit 1366d521 authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot

Merge topic 'fix_obj_warning'

9ff6b70a Fix for compiler warning in OBJ test
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Peter Karasev's avatarPeter Karasev <karasevpa@gmail.com>
Merge-request: !818
parents 87e05095 9ff6b70a
......@@ -16,49 +16,44 @@
#include "vtkRegressionTestImage.h"
#include "vtksys/SystemTools.hxx"
namespace
{
int s_interactive = 0;
bool bInteractive()
{
return (s_interactive>0);
}
}
int TestOBJImporter( int argc, char * argv [] )
{
// Files for testing demonstrate updated functionality for OBJ import:
// polydata + textures + actor properties all get loaded.
if(argc < (5))
{
{
std::cerr<<"expected TestName -D File1.obj [File2.obj.mtl] [texture1] [texture2] ... "<<std::endl;
return -1;
}
}
std::string filenameOBJ(argv[2]);
std::string filenameMTL,texfile1,texfile2;
if(argc >= 6)
{
filenameMTL = argv[3];
}
if(argc >= 7)
{
texfile1 = argv[4];
}
if(argc >= 8)
{
texfile2 = argv[5];
}
std::vector<std::string> tmp1,tmp2;
std::string texture_path1 = vtksys::SystemTools::GetFilenamePath(texfile1);
std::string texture_path2 = vtksys::SystemTools::GetFilenamePath(texfile2);
if( 0 != texture_path1.compare(texture_path2) )
{
{
std::cerr<<" texture files should be in the same path: "<<texture_path1<<std::endl;
return -2;
}
}
int lastArg = (argc <= 8) ? (argc-1) : 7;
std::string tmppath(argv[lastArg]);
......@@ -66,10 +61,9 @@ int TestOBJImporter( int argc, char * argv [] )
if(argc > 8)
{
s_interactive = 1;
{
importer->DebugOn();
}
}
importer->SetFileName(filenameOBJ.data());
importer->SetFileNameMTL(filenameMTL.data());
......@@ -87,19 +81,19 @@ int TestOBJImporter( int argc, char * argv [] )
ren->ResetCamera();
if( 1 > ren->GetActors()->GetNumberOfItems() )
{
{
std::cerr << "failed to get an actor created?!" << std::endl;
return -1;
}
}
ren->GetActiveCamera()->SetPosition(10,10,-10);
ren->ResetCamera();
int retVal = vtkRegressionTestImage(renWin.GetPointer());
if( retVal == vtkRegressionTester::DO_INTERACTOR )
{
renWin->SetSize(800,600);
renWin->SetAAFrames(3);
iren->Start();
}
{
renWin->SetSize(800,600);
renWin->SetAAFrames(3);
iren->Start();
}
// Some tests do not produce images... allow them to pass.
// But if we had an image, it must be within the threshold:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment