Renamed Appearance view to Texture view.

This commit is contained in:
brunoherbelin
2021-02-26 23:15:14 +01:00
parent 004e1aaead
commit 70c28d4226
8 changed files with 63 additions and 63 deletions

View File

@@ -80,8 +80,8 @@ static void saveSession(const std::string& filename, Session *session)
layer->InsertEndChild( SessionVisitor::NodeToXML(*session->config(View::LAYER), &xmlDoc));
views->InsertEndChild(layer);
XMLElement *appearance = xmlDoc.NewElement( "Appearance" );
appearance->InsertEndChild( SessionVisitor::NodeToXML(*session->config(View::APPEARANCE), &xmlDoc));
XMLElement *appearance = xmlDoc.NewElement( "Texture" );
appearance->InsertEndChild( SessionVisitor::NodeToXML(*session->config(View::TEXTURE), &xmlDoc));
views->InsertEndChild(appearance);
XMLElement *render = xmlDoc.NewElement( "Rendering" );
@@ -550,7 +550,7 @@ void Mixer::attach(Source *s)
mixing_.scene.ws()->attach( s->group(View::MIXING) );
geometry_.scene.ws()->attach( s->group(View::GEOMETRY) );
layer_.scene.ws()->attach( s->group(View::LAYER) );
appearance_.scene.ws()->attach( s->group(View::APPEARANCE) );
appearance_.scene.ws()->attach( s->group(View::TEXTURE) );
}
}
@@ -566,7 +566,7 @@ void Mixer::detach(Source *s)
mixing_.scene.ws()->detach( s->group(View::MIXING) );
geometry_.scene.ws()->detach( s->group(View::GEOMETRY) );
layer_.scene.ws()->detach( s->group(View::LAYER) );
appearance_.scene.ws()->detach( s->group(View::APPEARANCE) );
appearance_.scene.ws()->detach( s->group(View::TEXTURE) );
transition_.scene.ws()->detach( s->group(View::TRANSITION) );
}
}
@@ -882,7 +882,7 @@ void Mixer::setView(View::Mode m)
case View::LAYER:
current_view_ = &layer_;
break;
case View::APPEARANCE:
case View::TEXTURE:
current_view_ = &appearance_;
break;
case View::MIXING:
@@ -913,7 +913,7 @@ View *Mixer::view(View::Mode m)
return &geometry_;
case View::LAYER:
return &layer_;
case View::APPEARANCE:
case View::TEXTURE:
return &appearance_;
case View::MIXING:
return &mixing_;
@@ -934,7 +934,7 @@ void Mixer::saveas(const std::string& filename)
session_->config(View::MIXING)->copyTransform( mixing_.scene.root() );
session_->config(View::GEOMETRY)->copyTransform( geometry_.scene.root() );
session_->config(View::LAYER)->copyTransform( layer_.scene.root() );
session_->config(View::APPEARANCE)->copyTransform( appearance_.scene.root() );
session_->config(View::TEXTURE)->copyTransform( appearance_.scene.root() );
// launch a thread to save the session
std::thread (saveSession, filename, session_).detach();
@@ -1106,7 +1106,7 @@ void Mixer::swap()
mixing_.scene.root()->copyTransform( session_->config(View::MIXING) );
geometry_.scene.root()->copyTransform( session_->config(View::GEOMETRY) );
layer_.scene.root()->copyTransform( session_->config(View::LAYER) );
appearance_.scene.root()->copyTransform( session_->config(View::APPEARANCE) );
appearance_.scene.root()->copyTransform( session_->config(View::TEXTURE) );
// set resolution
session_->setResolution( session_->config(View::RENDERING)->scale_ );

View File

@@ -29,9 +29,9 @@ Session::Session() : failedSource_(nullptr), active_(true), fading_target_(0.f)
config_[View::MIXING]->scale_ = Settings::application.views[View::MIXING].default_scale;
config_[View::MIXING]->translation_ = Settings::application.views[View::MIXING].default_translation;
config_[View::APPEARANCE] = new Group;
config_[View::APPEARANCE]->scale_ = Settings::application.views[View::APPEARANCE].default_scale;
config_[View::APPEARANCE]->translation_ = Settings::application.views[View::APPEARANCE].default_translation;
config_[View::TEXTURE] = new Group;
config_[View::TEXTURE]->scale_ = Settings::application.views[View::TEXTURE].default_scale;
config_[View::TEXTURE]->translation_ = Settings::application.views[View::TEXTURE].default_translation;
}
@@ -47,7 +47,7 @@ Session::~Session()
delete config_[View::GEOMETRY];
delete config_[View::LAYER];
delete config_[View::MIXING];
delete config_[View::APPEARANCE];
delete config_[View::TEXTURE];
}
void Session::setActive (bool on)

View File

@@ -103,7 +103,7 @@ void SessionCreator::loadConfig(XMLElement *viewsNode)
SessionLoader::XMLToNode( viewsNode->FirstChildElement("Mixing"), *session_->config(View::MIXING));
SessionLoader::XMLToNode( viewsNode->FirstChildElement("Geometry"), *session_->config(View::GEOMETRY));
SessionLoader::XMLToNode( viewsNode->FirstChildElement("Layer"), *session_->config(View::LAYER));
SessionLoader::XMLToNode( viewsNode->FirstChildElement("Appearance"), *session_->config(View::APPEARANCE));
SessionLoader::XMLToNode( viewsNode->FirstChildElement("Texture"), *session_->config(View::TEXTURE));
SessionLoader::XMLToNode( viewsNode->FirstChildElement("Rendering"), *session_->config(View::RENDERING));
}
}
@@ -472,8 +472,8 @@ void SessionLoader::visit (Source& s)
xmlCurrent_ = sourceNode->FirstChildElement("Layer");
if (xmlCurrent_) s.groupNode(View::LAYER)->accept(*this);
xmlCurrent_ = sourceNode->FirstChildElement("Appearance");
if (xmlCurrent_) s.groupNode(View::APPEARANCE)->accept(*this);
xmlCurrent_ = sourceNode->FirstChildElement("Texture");
if (xmlCurrent_) s.groupNode(View::TEXTURE)->accept(*this);
xmlCurrent_ = sourceNode->FirstChildElement("Blending");
if (xmlCurrent_) s.blendingShader()->accept(*this);

View File

@@ -363,9 +363,9 @@ void SessionVisitor::visit (Source& s)
sourceNode->InsertEndChild(xmlCurrent_);
s.groupNode(View::LAYER)->accept(*this);
xmlCurrent_ = xmlDoc_->NewElement( "Appearance" );
xmlCurrent_ = xmlDoc_->NewElement( "Texture" );
sourceNode->InsertEndChild(xmlCurrent_);
s.groupNode(View::APPEARANCE)->accept(*this);
s.groupNode(View::TEXTURE)->accept(*this);
xmlCurrent_ = xmlDoc_->NewElement( "Blending" );
sourceNode->InsertEndChild(xmlCurrent_);

View File

@@ -133,48 +133,48 @@ Source::Source() : initialized_(false), symbol_(nullptr), active_(true), locked_
groups_[View::LAYER]->attach(overlays_[View::LAYER]);
// default appearance node
groups_[View::APPEARANCE] = new Group;
groups_[View::APPEARANCE]->visible_ = false;
groups_[View::TEXTURE] = new Group;
groups_[View::TEXTURE]->visible_ = false;
frames_[View::APPEARANCE] = new Switch;
frames_[View::TEXTURE] = new Switch;
frame = new Frame(Frame::SHARP, Frame::THIN, Frame::NONE);
frame->translation_.z = 0.1;
frame->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 0.7f);
frames_[View::APPEARANCE]->attach(frame);
frames_[View::TEXTURE]->attach(frame);
frame = new Frame(Frame::SHARP, Frame::LARGE, Frame::NONE);
frame->translation_.z = 0.1;
frame->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
frames_[View::APPEARANCE]->attach(frame);
groups_[View::APPEARANCE]->attach(frames_[View::APPEARANCE]);
frames_[View::TEXTURE]->attach(frame);
groups_[View::TEXTURE]->attach(frames_[View::TEXTURE]);
overlays_[View::APPEARANCE] = new Group;
overlays_[View::APPEARANCE]->translation_.z = 0.1;
overlays_[View::APPEARANCE]->visible_ = false;
handles_[View::APPEARANCE][Handles::RESIZE] = new Handles(Handles::RESIZE);
handles_[View::APPEARANCE][Handles::RESIZE]->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
handles_[View::APPEARANCE][Handles::RESIZE]->translation_.z = 0.1;
overlays_[View::APPEARANCE]->attach(handles_[View::APPEARANCE][Handles::RESIZE]);
handles_[View::APPEARANCE][Handles::RESIZE_H] = new Handles(Handles::RESIZE_H);
handles_[View::APPEARANCE][Handles::RESIZE_H]->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
handles_[View::APPEARANCE][Handles::RESIZE_H]->translation_.z = 0.1;
overlays_[View::APPEARANCE]->attach(handles_[View::APPEARANCE][Handles::RESIZE_H]);
handles_[View::APPEARANCE][Handles::RESIZE_V] = new Handles(Handles::RESIZE_V);
handles_[View::APPEARANCE][Handles::RESIZE_V]->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
handles_[View::APPEARANCE][Handles::RESIZE_V]->translation_.z = 0.1;
overlays_[View::APPEARANCE]->attach(handles_[View::APPEARANCE][Handles::RESIZE_V]);
handles_[View::APPEARANCE][Handles::ROTATE] = new Handles(Handles::ROTATE);
handles_[View::APPEARANCE][Handles::ROTATE]->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
handles_[View::APPEARANCE][Handles::ROTATE]->translation_.z = 0.1;
overlays_[View::APPEARANCE]->attach(handles_[View::APPEARANCE][Handles::ROTATE]);
handles_[View::APPEARANCE][Handles::SCALE] = new Handles(Handles::SCALE);
handles_[View::APPEARANCE][Handles::SCALE]->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
handles_[View::APPEARANCE][Handles::SCALE]->translation_.z = 0.1;
overlays_[View::APPEARANCE]->attach(handles_[View::APPEARANCE][Handles::SCALE]);
handles_[View::APPEARANCE][Handles::MENU] = new Handles(Handles::MENU);
handles_[View::APPEARANCE][Handles::MENU]->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
handles_[View::APPEARANCE][Handles::MENU]->translation_.z = 0.1;
overlays_[View::APPEARANCE]->attach(handles_[View::APPEARANCE][Handles::MENU]);
groups_[View::APPEARANCE]->attach(overlays_[View::APPEARANCE]);
overlays_[View::TEXTURE] = new Group;
overlays_[View::TEXTURE]->translation_.z = 0.1;
overlays_[View::TEXTURE]->visible_ = false;
handles_[View::TEXTURE][Handles::RESIZE] = new Handles(Handles::RESIZE);
handles_[View::TEXTURE][Handles::RESIZE]->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
handles_[View::TEXTURE][Handles::RESIZE]->translation_.z = 0.1;
overlays_[View::TEXTURE]->attach(handles_[View::TEXTURE][Handles::RESIZE]);
handles_[View::TEXTURE][Handles::RESIZE_H] = new Handles(Handles::RESIZE_H);
handles_[View::TEXTURE][Handles::RESIZE_H]->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
handles_[View::TEXTURE][Handles::RESIZE_H]->translation_.z = 0.1;
overlays_[View::TEXTURE]->attach(handles_[View::TEXTURE][Handles::RESIZE_H]);
handles_[View::TEXTURE][Handles::RESIZE_V] = new Handles(Handles::RESIZE_V);
handles_[View::TEXTURE][Handles::RESIZE_V]->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
handles_[View::TEXTURE][Handles::RESIZE_V]->translation_.z = 0.1;
overlays_[View::TEXTURE]->attach(handles_[View::TEXTURE][Handles::RESIZE_V]);
handles_[View::TEXTURE][Handles::ROTATE] = new Handles(Handles::ROTATE);
handles_[View::TEXTURE][Handles::ROTATE]->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
handles_[View::TEXTURE][Handles::ROTATE]->translation_.z = 0.1;
overlays_[View::TEXTURE]->attach(handles_[View::TEXTURE][Handles::ROTATE]);
handles_[View::TEXTURE][Handles::SCALE] = new Handles(Handles::SCALE);
handles_[View::TEXTURE][Handles::SCALE]->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
handles_[View::TEXTURE][Handles::SCALE]->translation_.z = 0.1;
overlays_[View::TEXTURE]->attach(handles_[View::TEXTURE][Handles::SCALE]);
handles_[View::TEXTURE][Handles::MENU] = new Handles(Handles::MENU);
handles_[View::TEXTURE][Handles::MENU]->color = glm::vec4( COLOR_APPEARANCE_SOURCE, 1.f);
handles_[View::TEXTURE][Handles::MENU]->translation_.z = 0.1;
overlays_[View::TEXTURE]->attach(handles_[View::TEXTURE][Handles::MENU]);
groups_[View::TEXTURE]->attach(overlays_[View::TEXTURE]);
// empty transition node
groups_[View::TRANSITION] = new Group;
@@ -243,7 +243,7 @@ Source::~Source()
delete groups_[View::MIXING];
delete groups_[View::GEOMETRY];
delete groups_[View::LAYER];
delete groups_[View::APPEARANCE];
delete groups_[View::TEXTURE];
delete groups_[View::TRANSITION];
groups_.clear();
@@ -295,7 +295,7 @@ void Source::setMode(Source::Mode m)
(*o).second->visible_ = current & !locked_;
// show in appearance view if current
groups_[View::APPEARANCE]->visible_ = m > Source::VISIBLE;
groups_[View::TEXTURE]->visible_ = m > Source::VISIBLE;
mode_ = m;
}
@@ -381,7 +381,7 @@ void Source::attach(FrameBuffer *renderbuffer)
// for views showing a scaled mixing surface, a dedicated transparent surface allows grabbing
Surface *surfacetmp = new Surface();
surfacetmp->setTextureIndex(Resource::getTextureTransparent());
groups_[View::APPEARANCE]->attach(surfacetmp);
groups_[View::TEXTURE]->attach(surfacetmp);
groups_[View::MIXING]->attach(surfacetmp);
groups_[View::LAYER]->attach(surfacetmp);
@@ -570,11 +570,11 @@ void Source::update(float dt)
// Aspect Ratio correction transform : coordinates of Appearance Frame are scaled by render buffer width
glm::mat4 Ar = glm::scale(glm::identity<glm::mat4>(), glm::vec3(renderbuffer_->aspectRatio(), 1.f, 1.f) );
// Translation : same as Appearance Frame (modified by Ar)
glm::mat4 Tra = glm::translate(glm::identity<glm::mat4>(), groups_[View::APPEARANCE]->translation_);
glm::mat4 Tra = glm::translate(glm::identity<glm::mat4>(), groups_[View::TEXTURE]->translation_);
// Scaling : inverse scaling (larger UV when smaller Appearance Frame)
glm::mat4 Sca = glm::scale(glm::identity<glm::mat4>(), glm::vec3(groups_[View::APPEARANCE]->scale_.x,groups_[View::APPEARANCE]->scale_.y, 1.f));
glm::mat4 Sca = glm::scale(glm::identity<glm::mat4>(), glm::vec3(groups_[View::TEXTURE]->scale_.x,groups_[View::TEXTURE]->scale_.y, 1.f));
// Rotation : same angle than Appearance Frame, inverted axis
glm::mat4 Rot = glm::rotate(glm::identity<glm::mat4>(), groups_[View::APPEARANCE]->rotation_.z, glm::vec3(0.f, 0.f, -1.f) );
glm::mat4 Rot = glm::rotate(glm::identity<glm::mat4>(), groups_[View::TEXTURE]->rotation_.z, glm::vec3(0.f, 0.f, -1.f) );
// Combine transformations (non transitive) in this order:
// 1. switch to Scene coordinate system
// 2. Apply the aspect ratio correction

View File

@@ -35,12 +35,12 @@
#include "TextureView.h"
TextureView::TextureView() : View(APPEARANCE), edit_source_(nullptr), need_edit_update_(true)
TextureView::TextureView() : View(TEXTURE), edit_source_(nullptr), need_edit_update_(true)
{
// read default settings
if ( Settings::application.views[mode_].name.empty() ) {
// no settings found: store application default
Settings::application.views[mode_].name = "Appearance";
Settings::application.views[mode_].name = "Texture";
scene.root()->scale_ = glm::vec3(APPEARANCE_DEFAULT_SCALE, APPEARANCE_DEFAULT_SCALE, 1.0f);
scene.root()->translation_ = glm::vec3(0.8f, 0.f, 0.0f);
saveSettings();

View File

@@ -359,7 +359,7 @@ void UserInterface::handleKeyboard()
else if (ImGui::IsKeyPressed( GLFW_KEY_F3 ))
Mixer::manager().setView(View::LAYER);
else if (ImGui::IsKeyPressed( GLFW_KEY_F4 ))
Mixer::manager().setView(View::APPEARANCE);
Mixer::manager().setView(View::TEXTURE);
else if (ImGui::IsKeyPressed( GLFW_KEY_F12 ))
StartScreenshot();
// normal keys // make sure no entry / window box is active
@@ -1453,7 +1453,7 @@ int UserInterface::RenderViewNavigator(int *shift)
ImGui::NextColumn();
if (ImGui::Selectable( ICON_FA_CHESS_BOARD, &selected_view[4], 0, iconsize))
{
Mixer::manager().setView(View::APPEARANCE);
Mixer::manager().setView(View::TEXTURE);
*shift = 0;
}
ImGui::PopFont();
@@ -2159,7 +2159,7 @@ void Navigator::Render()
tooltip_ = "Layers F3";
if (ImGui::Selectable( ICON_FA_CHESS_BOARD, &selected_view[4], 0, iconsize))
{
Mixer::manager().setView(View::APPEARANCE);
Mixer::manager().setView(View::TEXTURE);
view_pannel_visible = previous_view == Settings::application.current_view;
}
if (ImGui::IsItemHovered())

2
View.h
View File

@@ -22,7 +22,7 @@ class View
{
public:
typedef enum {RENDERING = 0, MIXING=1, GEOMETRY=2, LAYER=3, APPEARANCE=4, TRANSITION=5, INVALID=6 } Mode;
typedef enum {RENDERING = 0, MIXING=1, GEOMETRY=2, LAYER=3, TEXTURE=4, TRANSITION=5, INVALID=6 } Mode;
View(Mode m);
virtual ~View() {}