Commit ba6ca2ce authored by Robert Menzel's avatar Robert Menzel

Merge branch 'experimental' of file:///data/git-repository/acgl/libraries/acgl into experimental

parents 7f7c8e01 7375fea4
......@@ -7,6 +7,7 @@
#ifndef ACGL_OPENGL_CONTROLLER_FRAMEBUFFEROBJECTCONTROL_HH
#define ACGL_OPENGL_CONTROLLER_FRAMEBUFFEROBJECTCONTROL_HH
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
#include <ACGL/ACGL.hh>
#include <ACGL/Resource/BasicCreateController.hh>
......@@ -83,5 +84,6 @@ protected:
} // OpenGL
} // ACGL
#endif // ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
#endif // ACGL_OPENGL_CONTROLLER_FRAMEBUFFERCONTROL_HH
/***********************************************************************
* Copyright 2011-2012 Computer Graphics Group RWTH Aachen University. *
* All rights reserved. *
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
#ifndef ACGL_OPENGL_DATA_GEOMETRYDATALOADSTORE_HH
#define ACGL_OPENGL_DATA_GEOMETRYDATALOADSTORE_HH
/**
* Helper function for writing the contents of a TextureData object into a file
* and loading them from a file.
*/
#include <ACGL/ACGL.hh>
#include <ACGL/OpenGL/Data/GeometryData.hh>
#include <string>
namespace ACGL{
namespace OpenGL{
///////////////////////////////////////////////////////////////////////////////////////////////////
// generic load/save
///////////////////////////////////////////////////////////////////////////////////////////////////
//! generic load function that will use one of the loading functions below based on the file ending
SharedGeometryData loadGeometryData(const std::string& _filename);
///////////////////////////////////////////////////////////////////////////////////////////////////
// library specific load
///////////////////////////////////////////////////////////////////////////////////////////////////
//! loads from a Wavefront OBJ file
SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _computeNormals = false);
///////////////////////////////////////////////////////////////////////////////////////////////////
// library specific save
///////////////////////////////////////////////////////////////////////////////////////////////////
} // OpenGL
} // ACGL
#endif // ACGL_OPENGL_DATA_GEOMETRYDATALOADSTORE_HH
......@@ -9,6 +9,8 @@
#include <ACGL/Base/StringOperations.hh>
#include <ACGL/OpenGL/Data/GeometryDataLoadStore.hh>
#include <vector>
#include <iostream>
#include <fstream>
......@@ -21,6 +23,12 @@ using namespace ACGL::Base;
bool GeometryDataControlFileOBJ::load(SharedGeometryData& geometry) const
{
if(geometry = loadGeometryDataFromOBJ(getFullFilePath()))
return true;
else
return false;
/*
std::string fullFileName = getFullFilePath();
std::string line = "";
......@@ -296,5 +304,5 @@ bool GeometryDataControlFileOBJ::load(SharedGeometryData& geometry) const
}
return true;
*/
}
/***********************************************************************
* Copyright 2011-2012 Computer Graphics Group RWTH Aachen University. *
* All rights reserved. *
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
#include <ACGL/OpenGL/Data/GeometryDataLoadStore.hh>
//#include <ACGL/OpenGL/Tools.hh>
#include <ACGL/Base/FileHelpers.hh>
//#include <ACGL/Utils/Memory.hh>
using namespace ACGL;
using namespace ACGL::OpenGL;
using namespace ACGL::Utils;
namespace ACGL{
namespace OpenGL{
///////////////////////////////////////////////////////////////////////////////////////////////////
// generic load/save
///////////////////////////////////////////////////////////////////////////////////////////////////
SharedGeometryData loadGeometryData(const std::string& _filename)
{
// lower case file ending:
std::string fileEnding = Base::FileHelpers::getFileEnding(_filename);
if (fileEnding == "obj")
{
return loadGeometryDataFromOBJ(_filename);
}
else
{
error() << "file format of " << _filename << " not supported" << std::endl;
}
return SharedGeometryData();
}
} // OpenGL
} // ACGL
This diff is collapsed.
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