Commit 3478d25b authored by Jan Möbius's avatar Jan Möbius

Added environment Texture Type

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5992 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 9d750715
......@@ -674,6 +674,9 @@ bool TextureControlPlugin::parseMode( QString _mode, Texture& _texture ) {
} else if ( (value == "vertexbased") && (_texture.type() != HALFEDGEBASED) ) {
_texture.type( VERTEXBASED );
changed = true;
} else if ( (value == "environmentmap") && (_texture.type() != ENVIRONMENT) ) {
_texture.type( ENVIRONMENT );
changed = true;
} else {
emit log(LOGERR,"Unknown texture type : " + value + " for texture: " + _texture.name() );
}
......@@ -865,6 +868,7 @@ void TextureControlPlugin::pluginsInitialized() {
slotTextureAdded("Reflection Lines","reflection_map.png",2);
slotSetTextureMode("Reflection Lines","type=environmentmap");
}
void TextureControlPlugin::slotSetTextureProperties() {
......@@ -1031,6 +1035,7 @@ void TextureControlPlugin::doSwitchTexture( QString _textureName , int _id ) {
// ================================================================================
if( obj->dataType( DATA_TRIANGLE_MESH ) ){
if (!multiTextureMode) {
if ( texData->texture(_textureName).type() != ENVIRONMENT)
doUpdateTexture(texData->texture(_textureName), *PluginFunctions::triMeshObject(obj)->mesh());
PluginFunctions::triMeshObject(obj)->textureNode()->activateTexture( texData->texture( _textureName ).glName() );
PluginFunctions::triMeshObject(obj)->meshNode()->set_index_property_name("No Texture Index");
......@@ -1047,6 +1052,7 @@ void TextureControlPlugin::doSwitchTexture( QString _textureName , int _id ) {
if ( obj->dataType( DATA_POLY_MESH ) ){
if (!multiTextureMode) {
if ( texData->texture(_textureName).type() != ENVIRONMENT)
doUpdateTexture(texData->texture(_textureName), *PluginFunctions::polyMeshObject(obj)->mesh());
PluginFunctions::polyMeshObject(obj)->textureNode()->activateTexture( texData->texture( _textureName ).glName() );
PluginFunctions::polyMeshObject(obj)->meshNode()->set_index_property_name("No Texture Index");
......@@ -1081,6 +1087,9 @@ void TextureControlPlugin::switchDrawMode( TextureType _type ) {
textureMode |= ( PluginFunctions::drawMode(j) == ACG::SceneGraph::DrawModes::SOLID_TEXTURED );
textureMode |= ( PluginFunctions::drawMode(j) == ACG::SceneGraph::DrawModes::SOLID_TEXTURED_SHADED );
break;
case ENVIRONMENT:
textureMode |= ( PluginFunctions::drawMode(j) == ACG::SceneGraph::DrawModes::SOLID_ENV_MAPPED );
break;
case UNSET:
emit log(LOGERR,"Switching drawmode for unknonw Texture Type!");
break;
......@@ -1096,6 +1105,9 @@ void TextureControlPlugin::switchDrawMode( TextureType _type ) {
case VERTEXBASED:
PluginFunctions::setDrawMode( ACG::SceneGraph::DrawModes::SOLID_TEXTURED_SHADED , PluginFunctions::ALL_VIEWERS);
break;
case ENVIRONMENT:
PluginFunctions::setDrawMode( ACG::SceneGraph::DrawModes::SOLID_ENV_MAPPED , PluginFunctions::ALL_VIEWERS);
break;
case UNSET:
emit log(LOGERR,"Switching drawmode for unknonw Texture Type!");
break;
......
......@@ -44,9 +44,14 @@
#include <iostream>
enum TextureType { UNSET = 1 << 0,
/// Texture Coordinates are stored on a per Vertex basis
VERTEXBASED = 1 << 1,
/// Texture Coordinates are stored on a per Halfedge basis ( per vertex per face )
HALFEDGEBASED = 1 << 2,
MULTITEXTURE = 1 << 3 };
/// Texture coordinates are autogenerated by OpenGL for Environment map
ENVIRONMENT = 1 << 3,
/// MultiTexture Mode
MULTITEXTURE = 1 << 4 };
class TexParameters
{
......
......@@ -222,8 +222,6 @@ void texturePropertiesWidget::textureChanged(QTreeWidgetItem* _item, int _column
indexLabel->setEnabled(true);
indexBox->setEnabled(true);
indexBox->clear();
std::cerr << "Property status: " << std::endl;
indexBox->addItem("TODO");
break;
case HALFEDGEBASED:
......@@ -238,6 +236,12 @@ void texturePropertiesWidget::textureChanged(QTreeWidgetItem* _item, int _column
indexBox->setEnabled(false);
indexBox->clear();
break;
case ENVIRONMENT:
typeLabel->setText("Type: Environment Map");
indexLabel->setEnabled(false);
indexBox->setEnabled(false);
indexBox->clear();
break;
case UNSET:
typeLabel->setText("Type: Unset");
indexLabel->setEnabled(false);
......
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