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) { ...@@ -1562,9 +1562,6 @@ int FileVTKPlugin::loadObject(QString _filename) {
return -1; return -1;
} }
bool rpc_ok(false);
emit functionExists( "colorplugin" , "setDefaultColor()", rpc_ok ) ;
if ( (forceTriangleMesh_) || (bestType == BMT_TriMesh) ){ if ( (forceTriangleMesh_) || (bestType == BMT_TriMesh) ){
// add a triangle mesh // add a triangle mesh
...@@ -1595,8 +1592,6 @@ int FileVTKPlugin::loadObject(QString _filename) { ...@@ -1595,8 +1592,6 @@ int FileVTKPlugin::loadObject(QString _filename) {
//general stuff //general stuff
emit openedFile( object->id() ); emit openedFile( object->id() );
if (rpc_ok)
RPC::callFunction("colorplugin", "setDefaultColor");
PluginFunctions::viewAll(); PluginFunctions::viewAll();
...@@ -1638,8 +1633,6 @@ int FileVTKPlugin::loadObject(QString _filename) { ...@@ -1638,8 +1633,6 @@ int FileVTKPlugin::loadObject(QString _filename) {
//general stuff //general stuff
emit openedFile( object->id() ); emit openedFile( object->id() );
if (rpc_ok)
RPC::callFunction("colorplugin", "setDefaultColor");
PluginFunctions::viewAll(); PluginFunctions::viewAll();
...@@ -1682,8 +1675,6 @@ int FileVTKPlugin::loadObject(QString _filename) { ...@@ -1682,8 +1675,6 @@ int FileVTKPlugin::loadObject(QString _filename) {
//general stuff //general stuff
emit openedFile( object->id() ); emit openedFile( object->id() );
if (rpc_ok)
RPC::callFunction("colorplugin", "setDefaultColor");
PluginFunctions::viewAll(); PluginFunctions::viewAll();
...@@ -1726,8 +1717,6 @@ int FileVTKPlugin::loadObject(QString _filename) { ...@@ -1726,8 +1717,6 @@ int FileVTKPlugin::loadObject(QString _filename) {
//general stuff //general stuff
emit openedFile( object->id() ); emit openedFile( object->id() );
if (rpc_ok)
RPC::callFunction("colorplugin", "setDefaultColor");
PluginFunctions::viewAll(); PluginFunctions::viewAll();
......
...@@ -279,6 +279,11 @@ addEmpty() ...@@ -279,6 +279,11 @@ addEmpty()
QFileInfo f(name); QFileInfo f(name);
object->setName( f.fileName() ); 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->update();
object->show(); object->show();
......
...@@ -277,6 +277,11 @@ addEmpty() ...@@ -277,6 +277,11 @@ addEmpty()
QFileInfo f(name); QFileInfo f(name);
object->setName( f.fileName() ); 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->update();
object->show(); object->show();
......
...@@ -114,7 +114,10 @@ int TypeHexahedralMeshPlugin::addEmpty() { ...@@ -114,7 +114,10 @@ int TypeHexahedralMeshPlugin::addEmpty() {
object->materialNode()->applyProperties(ACG::SceneGraph::MaterialNode::All); object->materialNode()->applyProperties(ACG::SceneGraph::MaterialNode::All);
//object->materialNode()->enable_backface_culling(); //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 // Set rendering props
if(OpenFlipper::Options::gui()) { if(OpenFlipper::Options::gui()) {
......
...@@ -72,6 +72,11 @@ int TypePlanePlugin::addEmpty(){ ...@@ -72,6 +72,11 @@ int TypePlanePlugin::addEmpty(){
QFileInfo f(name); QFileInfo f(name);
object->setName( f.fileName() ); 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->update();
object->show(); object->show();
......
...@@ -45,6 +45,8 @@ ...@@ -45,6 +45,8 @@
#include "OpenFlipper/BasePlugin/PluginFunctions.hh" #include "OpenFlipper/BasePlugin/PluginFunctions.hh"
#include <OpenFlipper/common/GlobalOptions.hh>
TypePolyLinePlugin::TypePolyLinePlugin() { TypePolyLinePlugin::TypePolyLinePlugin() {
} }
...@@ -72,6 +74,11 @@ int TypePolyLinePlugin::addEmpty(){ ...@@ -72,6 +74,11 @@ int TypePolyLinePlugin::addEmpty(){
QFileInfo f(name); QFileInfo f(name);
object->setName( f.fileName() ); 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->update();
object->show(); object->show();
......
...@@ -81,6 +81,11 @@ int TypePolyMeshPlugin::addEmpty(){ ...@@ -81,6 +81,11 @@ int TypePolyMeshPlugin::addEmpty(){
QFileInfo f(name); QFileInfo f(name);
object->setName( f.fileName() ); 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->update();
object->show(); object->show();
......
...@@ -114,7 +114,10 @@ int TypePolyhedralMeshPlugin::addEmpty() { ...@@ -114,7 +114,10 @@ int TypePolyhedralMeshPlugin::addEmpty() {
// enable backface culling // enable backface culling
object->materialNode()->applyProperties(ACG::SceneGraph::MaterialNode::All); 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 // Set rendering props
if(OpenFlipper::Options::gui()) if(OpenFlipper::Options::gui())
......
...@@ -198,6 +198,11 @@ int TypeSkeletonPlugin::addEmpty(){ ...@@ -198,6 +198,11 @@ int TypeSkeletonPlugin::addEmpty(){
QFileInfo f(name); QFileInfo f(name);
object->setName( f.fileName() ); 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->update();
object->show(); object->show();
......
...@@ -73,6 +73,11 @@ int TypeSpherePlugin::addEmpty(){ ...@@ -73,6 +73,11 @@ int TypeSpherePlugin::addEmpty(){
QFileInfo f(name); QFileInfo f(name);
object->setName( f.fileName() ); 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->update();
object->show(); object->show();
......
...@@ -303,6 +303,11 @@ int TypeSplatCloudPlugin::addEmpty() ...@@ -303,6 +303,11 @@ int TypeSplatCloudPlugin::addEmpty()
QFileInfo f( name ); QFileInfo f( name );
object->setName( f.fileName() ); 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->update();
object->show(); object->show();
......
...@@ -80,6 +80,11 @@ int TypeTriangleMeshPlugin::addEmpty(){ ...@@ -80,6 +80,11 @@ int TypeTriangleMeshPlugin::addEmpty(){
QFileInfo f(name); QFileInfo f(name);
object->setName( f.fileName() ); 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->update();
object->show(); 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