Commit 87e6b72a authored by Jan Möbius's avatar Jan Möbius

Support loading textures through objs

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5745 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8e45bfe4
This diff is collapsed.
......@@ -160,6 +160,10 @@ class TextureControlPlugin : public QObject, BaseInterface, TextureInterface, Me
int _textureid, MeshT& _mesh,
OpenMesh::VPropHandleT< double > _texProp);
/// Handles data stored in new opened files ( e.g. Texture Information )
template< typename MeshT >
void handleFileOpenTextures( MeshT*& _mesh , int _objectId );
//===========================================================================
/** @name 1D Texture copy functions( copy 1D input textures to target texture coordinates and transform values )
* @{ */
......
......@@ -34,14 +34,15 @@
//-----------------------------------------------------------------------------------
Texture::Texture() :
id_(-1),
glName_(0),
name_("No Texture"),
filename_("Invalid"),
id_(-1),
glName_(0),
dimension_(0),
enabled_(false),
dirty(true),
type(UNSET)
dirty_(true),
type_(UNSET),
indexMappingProperty_("f:textureindex")
{
}
......@@ -148,8 +149,8 @@ int TextureData::addTexture(QString _textureName, QString _filename, uint _dimen
tex.filename( _filename );
tex.dimension(_dimension);
tex.enable();
tex.dirty = true;
tex.type = VERTEXBASED;
tex.setDirty();
tex.type( VERTEXBASED );
tex.hidden(false);
// tex.parameters = TexParameters;
......@@ -188,8 +189,8 @@ bool TextureData::addMultiTexture( QString _textureName ) {
tex.id( nextInternalID_++ );
tex.name( _textureName );
tex.filename("MultiTexture");
tex.dirty = true;
tex.type = MULTITEXTURE;
tex.setDirty();
tex.type(MULTITEXTURE);
tex.hidden(false);
textures_.push_back( tex );
......
......@@ -80,63 +80,92 @@ class Texture {
public :
Texture();
void filename( QString _name ) { filename_ = _name; };
QString filename() { return filename_; };
void id( int _id ) { id_ = _id; };
int id() { return id_; };
void glName( GLuint _glName ) { glName_ = _glName; };
GLuint glName() { return glName_; };
void name( QString _name ) { name_ = _name; };
QString name() { return name_; };
void dimension( uint _dimension ) { dimension_ = _dimension; };
uint dimension( ) { return dimension_; };
void enabled( bool _enabled ) { enabled_ = _enabled; };
bool enabled() { return enabled_; };
void hidden( bool _hidden ) { hidden_ = _hidden; };
bool hidden() { return hidden_; };
void enable(){ enabled_ = true; };
void disable(){ enabled_ = false; };
void hidden( bool _hidden ) { hidden_ = _hidden; };
bool hidden() { return hidden_; };
void hide() { hidden_ = true; };
void dirty( bool _dirty ) { dirty_ = _dirty; };
bool dirty() { return dirty_; };
void clean() { dirty_ = false; };
void setDirty() { dirty_ = true; };
// does this texture need an update?
bool dirty;
// Texture Type
uint type;
// Parameters
TexParameters parameters;
void type( uint _type ) { type_ = _type; };
uint type( ) { return type_; };
QImage textureImage;
/// If this is a multiTexture, the list will contain all textures for this multi Texture node.
QStringList multiTextureList;
QString indexMappingProperty() { return indexMappingProperty_; };
void indexMappingProperty( QString _property ) { indexMappingProperty_ = _property; };
/// Parameters of the texture
TexParameters parameters;
/// The image used as the texture
QImage textureImage;
/// If this is a multiTexture, the list will contain all textures for this multi Texture node.
QStringList multiTextureList;
private:
// Filename of the texture
/// Texture Name
QString name_;
/// Filename of the texture
QString filename_;
// Texture id
/// Texture id
int id_;
// glName
/// glName
GLuint glName_;
// Texture Name
QString name_;
// dimension
/// dimension
uint dimension_;
// Status
/// Status
bool enabled_;
/// Hidden flag ( If this texture belongs to a multitexture, it will be hidden in the context menu )
bool hidden_;
/// does this texture need an update?
bool dirty_;
/// Texture Type
uint type_;
/** If this is a multiTexture, indexMappingProperty_ will point to the property storing the mapping
* Defaults to the f:textureindex
*/
QString indexMappingProperty_;
};
class TextureData : public PerObjectData
......
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