Skip to content
Snippets Groups Projects
Commit 3812435e authored by stefan's avatar stefan
Browse files

Gfx::Entity, fixed bug in SetSelection

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@1769 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 640b2241
Branches
Tags
No related merge requests found
...@@ -674,7 +674,7 @@ void Entity::SetDetailColor(const Color& col, const String& selection) ...@@ -674,7 +674,7 @@ void Entity::SetDetailColor(const Color& col, const String& selection)
/// \brief set selection /// \brief set selection
void Entity::SetSelection(const mol::EntityView& view) void Entity::SetSelection(const mol::EntityView& view)
{ {
if (!sel_.IsValid()) { if (!view.IsValid()) {
sel_=this->GetView().CreateEmptyView(); sel_=this->GetView().CreateEmptyView();
} else { } else {
sel_=view; sel_=view;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <QDebug> #include <QDebug>
#include <QActionGroup> #include <QActionGroup>
#include <ost/mol/query_view_wrapper.hh>
#include <ost/gui/tools/tool_manager.hh> #include <ost/gui/tools/tool_manager.hh>
#include <ost/gui/gosty_app.hh> #include <ost/gui/gosty_app.hh>
#include "tool_bar.hh" #include "tool_bar.hh"
...@@ -37,7 +37,7 @@ ToolBar::ToolBar(QWidget* parent): ...@@ -37,7 +37,7 @@ ToolBar::ToolBar(QWidget* parent):
SLOT(ActivateTool(QAction*))); SLOT(ActivateTool(QAction*)));
connect(this, SIGNAL(actionTriggered(QAction*)), connect(this, SIGNAL(actionTriggered(QAction*)),
this,SLOT(OnAction(QAction*))); this,SLOT(OnAction(QAction*)));
connect(scene_win, SIGNAL(ActiveNodesChanged(gfx::NodePtrList)), connect(scene_win, SIGNAL(ActiveNodesChanged(gfx::NodePtrList,gfx::EntityP,mol::QueryViewWrapperList)),
this,SLOT(OnActiveGfxNodeChanged(gfx::NodePtrList))); this,SLOT(OnActiveGfxNodeChanged(gfx::NodePtrList)));
connect(&ToolManager::Instance(), SIGNAL(ToolAdded(const Tool*&)), connect(&ToolManager::Instance(), SIGNAL(ToolAdded(const Tool*&)),
this, SLOT(OnToolAdded(const Tool*&))); this, SLOT(OnToolAdded(const Tool*&)));
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#ifndef OST_QUERY_VIEW_WRAPPER_HH #ifndef OST_QUERY_VIEW_WRAPPER_HH
#define OST_QUERY_VIEW_WRAPPER_HH #define OST_QUERY_VIEW_WRAPPER_HH
#include <ost/mol/view_type_fw.hh>
#include <ost/mol/module_config.hh> #include <ost/mol/module_config.hh>
#include <ost/mol/entity_view.hh> #include <ost/mol/entity_view.hh>
#include <ost/mol/entity_handle.hh> #include <ost/mol/entity_handle.hh>
......
...@@ -109,7 +109,9 @@ mol::EntityView Difference(const mol::EntityView& ev1, ...@@ -109,7 +109,9 @@ mol::EntityView Difference(const mol::EntityView& ev1,
if (ev1.GetHandle()!=ev2.GetHandle()) { if (ev1.GetHandle()!=ev2.GetHandle()) {
throw IntegrityError(combining_not_allowed); throw IntegrityError(combining_not_allowed);
} }
if(ev2.GetChainCount()==0 && ev2.GetResidueCount()==0 && ev2.GetAtomCount()==0)return ev1.Copy();
mol::EntityView diff=ev1.CreateEmptyView(); mol::EntityView diff=ev1.CreateEmptyView();
if(ev1.GetChainCount()==0 && ev1.GetResidueCount()==0 && ev1.GetAtomCount()==0)return diff;
mol::ChainViewList::const_iterator c_it=ev1.GetChainList().begin(); mol::ChainViewList::const_iterator c_it=ev1.GetChainList().begin();
for ( ; c_it!=ev1.GetChainList().end(); ++c_it) { for ( ; c_it!=ev1.GetChainList().end(); ++c_it) {
mol::ChainView cv=*c_it; mol::ChainView cv=*c_it;
......
...@@ -48,6 +48,9 @@ typedef boost::shared_ptr<EntityViewData> EntityViewDataPtr; ...@@ -48,6 +48,9 @@ typedef boost::shared_ptr<EntityViewData> EntityViewDataPtr;
typedef boost::weak_ptr<EntityViewData> EntityViewDataWeakPtr; typedef boost::weak_ptr<EntityViewData> EntityViewDataWeakPtr;
typedef std::vector<EntityView> EntityViewList; typedef std::vector<EntityView> EntityViewList;
class QueryViewWrapper;
typedef std::vector<QueryViewWrapper> QueryViewWrapperList;
/// \brief Flags to control the behaviour when adding handles to views. /// \brief Flags to control the behaviour when adding handles to views.
struct ViewAddFlag { struct ViewAddFlag {
typedef enum { typedef enum {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment