Skip to content
Snippets Groups Projects
Commit 9198bfde authored by stefan's avatar stefan
Browse files

-Getter for ActiveViews in SceneSelection

-Added some const markers



git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@1785 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 31cd83e3
Branches
Tags
No related merge requests found
......@@ -30,7 +30,9 @@ void export_SceneSelection()
class_<SceneSelection, boost::noncopyable>("SceneSelection",no_init)
.def("Instance", &SceneSelection::Instance,
return_value_policy<reference_existing_object>()).staticmethod("Instance")
.def("GetActiveNode",&SceneSelection::GetActiveNode)
.def("GetActiveNodeCount",&SceneSelection::GetActiveNodeCount)
.def("GetActiveNode",&SceneSelection::GetActiveNode)
.def("GetActiveViewCount", &SceneSelection::GetActiveViewCount)
.def("GetActiveView", &SceneSelection::GetActiveView)
;
}
......@@ -50,7 +50,7 @@ void SceneSelection::SetActiveNodes(gfx::NodePtrList nodes, gfx::EntityP entity,
views_ = views;
}
gfx::GfxNodeP SceneSelection::GetActiveNode(unsigned int pos){
gfx::GfxNodeP SceneSelection::GetActiveNode(unsigned int pos) const{
if(pos >= 0 && pos < nodes_.size()){
return nodes_[pos];
}
......@@ -59,14 +59,24 @@ gfx::GfxNodeP SceneSelection::GetActiveNode(unsigned int pos){
}
}
int SceneSelection::GetActiveNodeCount(){
int SceneSelection::GetActiveNodeCount() const{
return nodes_.size();
}
int SceneSelection::GetActiveViewCount(){
int SceneSelection::GetActiveViewCount() const{
return views_.size();
}
mol::EntityView SceneSelection::GetActiveView(unsigned int pos) const{
if(pos >=0 && pos < views_.size()){
return views_[pos].GetEntityView();
}
else{
throw Error("Index out of bounds: There is no active vies at the given position");
}
}
SceneSelection* SceneSelection::Instance() {
if (!SceneSelection::scene_selection_) {
SceneSelection::scene_selection_=new SceneSelection;
......@@ -217,7 +227,7 @@ void SceneSelection::MakeHidden(){
}
}
gfx::EntityP SceneSelection::GetViewEntity(){
gfx::EntityP SceneSelection::GetViewEntity() const{
return view_entity_;
}
......
......@@ -35,10 +35,11 @@ class DLLEXPORT_OST_GUI SceneSelection : public QObject {
Q_OBJECT
public:
static SceneSelection* Instance();
gfx::GfxNodeP GetActiveNode(unsigned int pos);
int GetActiveNodeCount();
int GetActiveViewCount();
gfx::EntityP GetViewEntity();
int GetActiveNodeCount() const;
gfx::GfxNodeP GetActiveNode(unsigned int pos) const;
int GetActiveViewCount() const;
mol::EntityView GetActiveView(unsigned int pos) const;
gfx::EntityP GetViewEntity() const;
public slots:
void CenterOnObjects();
......
......@@ -32,14 +32,6 @@
namespace ost { namespace gui {
enum ContextMenuType {
GFX_OBJECTS = 1,
ENTITIES,
ENTITY_VIEWS,
MIX
};
class DLLEXPORT_OST_GUI ContextMenu : public QObject {
Q_OBJECT
public:
......@@ -56,8 +48,6 @@ private slots:
private:
gui::ContextMenuType GetType();
QTreeView* view_;
SceneWinModel* model_;
};
......
......@@ -61,7 +61,7 @@ EntityNode::EntityNode(gfx::EntityP& entity, SceneNode* parent):
model->AddNode(this, node);
}
SceneNode* EntityNode::GetCustomViewNode(){
SceneNode* EntityNode::GetCustomViewNode() const{
return custom_view_;
}
......
......@@ -39,7 +39,7 @@ class DLLEXPORT_OST_GUI EntityNode : public GfxSceneNode {
public:
EntityNode(gfx::EntityP& entity, SceneNode* node_parent);
SceneNode* GetCustomViewNode();
SceneNode* GetCustomViewNode() const;
private:
SceneNode* custom_view_;
......
......@@ -67,7 +67,7 @@ void EntityPartNode::SetVisible(bool visible){
visible_ = visible;
}
bool EntityPartNode::GetVisible(){
bool EntityPartNode::GetVisible() const{
return visible_;
}
......
......@@ -55,7 +55,7 @@ public:
protected:
virtual void SetVisible(bool visible);
virtual bool GetVisible();
virtual bool GetVisible() const;
private:
QString name_;
......
......@@ -71,7 +71,7 @@ void RenderModesNode::Update(){
}
gfx::GfxNodeP RenderModesNode::GetGfxNode(){
gfx::GfxNodeP RenderModesNode::GetGfxNode() const{
return node_;
}
......
......@@ -48,7 +48,7 @@ public:
RenderModesNode(gfx::EntityP entity, SceneNode* node_parent );
virtual void RenderModeChanged();
gfx::GfxNodeP GetGfxNode();
gfx::GfxNodeP GetGfxNode() const;
private:
void Update();
......
......@@ -91,7 +91,7 @@ void SceneWin::OnSelectionChange(const QItemSelection& sel,
emit this->ActiveNodesChanged();
}
SceneWinModel* SceneWin::GetModel(){
SceneWinModel* SceneWin::GetModel() const{
return model_;
}
......
......@@ -60,7 +60,7 @@ public slots:
void ContextMenuRequested(const QPoint& pos);
SceneWinModel* GetModel();
SceneWinModel* GetModel() const;
void Update();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment