Commit 9cae700d authored by Isaak Lim's avatar Isaak Lim
Browse files

- got rid off setting the default color via a call to the color plugin in the VTK plugin

- the default color is now set in the relevant type plugins

refs #1696

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17166 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 9569dc90
......@@ -1562,9 +1562,6 @@ int FileVTKPlugin::loadObject(QString _filename) {
return -1;
}
bool rpc_ok(false);
emit functionExists( "colorplugin" , "setDefaultColor()", rpc_ok ) ;
if ( (forceTriangleMesh_) || (bestType == BMT_TriMesh) ){
// add a triangle mesh
......@@ -1595,8 +1592,6 @@ int FileVTKPlugin::loadObject(QString _filename) {
//general stuff
emit openedFile( object->id() );
if (rpc_ok)
RPC::callFunction("colorplugin", "setDefaultColor");
PluginFunctions::viewAll();
......@@ -1638,8 +1633,6 @@ int FileVTKPlugin::loadObject(QString _filename) {
//general stuff
emit openedFile( object->id() );
if (rpc_ok)
RPC::callFunction("colorplugin", "setDefaultColor");
PluginFunctions::viewAll();
......@@ -1682,8 +1675,6 @@ int FileVTKPlugin::loadObject(QString _filename) {
//general stuff
emit openedFile( object->id() );
if (rpc_ok)
RPC::callFunction("colorplugin", "setDefaultColor");
PluginFunctions::viewAll();
......@@ -1726,8 +1717,6 @@ int FileVTKPlugin::loadObject(QString _filename) {
//general stuff
emit openedFile( object->id() );
if (rpc_ok)
RPC::callFunction("colorplugin", "setDefaultColor");
PluginFunctions::viewAll();
......
......@@ -279,6 +279,11 @@ addEmpty()
QFileInfo f(name);
object->setName( f.fileName() );
// set the default colors
const QColor color = OpenFlipper::Options::defaultColor();
const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
object->materialNode()->set_color(default_color);
object->update();
object->show();
......
......@@ -277,6 +277,11 @@ addEmpty()
QFileInfo f(name);
object->setName( f.fileName() );
// set the default colors
const QColor color = OpenFlipper::Options::defaultColor();
const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
object->materialNode()->set_color(default_color);
object->update();
object->show();
......
......@@ -114,7 +114,10 @@ int TypeHexahedralMeshPlugin::addEmpty() {
object->materialNode()->applyProperties(ACG::SceneGraph::MaterialNode::All);
//object->materialNode()->enable_backface_culling();
object->materialNode()->set_ambient_color(ACG::Vec4f(1.0, 1.0, 1.0, 1.0));
// set the default colors
const QColor color = OpenFlipper::Options::defaultColor();
const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
object->materialNode()->set_color(default_color);
// Set rendering props
if(OpenFlipper::Options::gui()) {
......
......@@ -72,6 +72,11 @@ int TypePlanePlugin::addEmpty(){
QFileInfo f(name);
object->setName( f.fileName() );
// set the default colors
const QColor color = OpenFlipper::Options::defaultColor();
const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
object->materialNode()->set_color(default_color);
object->update();
object->show();
......
......@@ -45,6 +45,8 @@
#include "OpenFlipper/BasePlugin/PluginFunctions.hh"
#include <OpenFlipper/common/GlobalOptions.hh>
TypePolyLinePlugin::TypePolyLinePlugin() {
}
......@@ -72,6 +74,11 @@ int TypePolyLinePlugin::addEmpty(){
QFileInfo f(name);
object->setName( f.fileName() );
// set the default colors
const QColor color = OpenFlipper::Options::defaultColor();
const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
object->materialNode()->set_color(default_color);
object->update();
object->show();
......
......@@ -81,6 +81,11 @@ int TypePolyMeshPlugin::addEmpty(){
QFileInfo f(name);
object->setName( f.fileName() );
// set the default colors
const QColor color = OpenFlipper::Options::defaultColor();
const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
object->materialNode()->set_color(default_color);
object->update();
object->show();
......
......@@ -114,7 +114,10 @@ int TypePolyhedralMeshPlugin::addEmpty() {
// enable backface culling
object->materialNode()->applyProperties(ACG::SceneGraph::MaterialNode::All);
object->materialNode()->set_ambient_color(ACG::Vec4f(1.0, 1.0, 1.0, 1.0));
// set the default colors
const QColor color = OpenFlipper::Options::defaultColor();
const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
object->materialNode()->set_color(default_color);
// Set rendering props
if(OpenFlipper::Options::gui())
......
......@@ -198,6 +198,11 @@ int TypeSkeletonPlugin::addEmpty(){
QFileInfo f(name);
object->setName( f.fileName() );
// set the default colors
const QColor color = OpenFlipper::Options::defaultColor();
const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
object->materialNode()->set_color(default_color);
object->update();
object->show();
......
......@@ -73,6 +73,11 @@ int TypeSpherePlugin::addEmpty(){
QFileInfo f(name);
object->setName( f.fileName() );
// set the default colors
const QColor color = OpenFlipper::Options::defaultColor();
const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
object->materialNode()->set_color(default_color);
object->update();
object->show();
......
......@@ -303,6 +303,11 @@ int TypeSplatCloudPlugin::addEmpty()
QFileInfo f( name );
object->setName( f.fileName() );
// set the default colors
const QColor color = OpenFlipper::Options::defaultColor();
const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
object->materialNode()->set_color(default_color);
object->update();
object->show();
......
......@@ -80,6 +80,11 @@ int TypeTriangleMeshPlugin::addEmpty(){
QFileInfo f(name);
object->setName( f.fileName() );
// set the default colors
const QColor color = OpenFlipper::Options::defaultColor();
const ACG::Vec4f default_color(color.redF(), color.greenF(), color.blueF(), color.alphaF());
object->materialNode()->set_color(default_color);
object->update();
object->show();
......
Supports Markdown
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