-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd64784
commit deba2ef
Showing
7 changed files
with
174 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule ecolab
updated
14 files
+1 −1 | Doxyversion | |
+1 −1 | Makefile.version | |
+1 −1 | classdesc | |
+1 −1 | doc/version.tex | |
+6 −16 | include/TCL_obj_base.h | |
+1 −1 | include/pango.h | |
+1 −1 | include/version.h | |
+4 −6 | src/cairoSurfaceImage.cc | |
+1 −1 | src/graph.cc | |
+2 −0 | src/naugraph.c | |
+2 −2 | src/nautinv.c | |
+3 −3 | src/nauty.c | |
+20 −14 | src/plot.cc | |
+5 −5 | src/tclmain.cc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
@copyright Steve Keen 2020 | ||
@author Russell Standish | ||
This file is part of Minsky. | ||
Minsky is free software: you can redistribute it and/or modify it | ||
under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
Minsky is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with Minsky. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "variableInstanceList.h" | ||
#include "group.h" | ||
#include "selection.h" | ||
#include "minsky_epilogue.h" | ||
|
||
using namespace std; | ||
|
||
namespace minsky | ||
{ | ||
VariableInstanceList::VariableInstanceList(Group& model, const string& valueId): | ||
model(model) | ||
{ | ||
model.recursiveDo | ||
(&Group::items, | ||
[this,&valueId](const Items&, Items::const_iterator i) { | ||
if (auto v=(*i)->variableCast()) | ||
if (v->valueId()==valueId) | ||
{ | ||
bookmarks.emplace_back(this->model.x()-v->x()+50, this->model.y()-v->y()+50, v->zoomFactor(), | ||
v->name()+"@("+to_string(int(v->x()))+","+to_string(int(v->y()))+")"); | ||
items.push_back(*i); | ||
} | ||
return false; | ||
}); | ||
} | ||
|
||
void VariableInstanceList::gotoInstance(size_t i) { | ||
if (i<bookmarks.size()) | ||
{ | ||
assert(bookmarks.size()==items.size()); | ||
model.gotoBookmark_b(bookmarks[i]); | ||
items[i]->selected=true; | ||
} | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
@copyright Steve Keen 2020 | ||
@author Russell Standish | ||
This file is part of Minsky. | ||
Minsky is free software: you can redistribute it and/or modify it | ||
under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
Minsky is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with Minsky. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef VARIABLEINSTANCELIST_H | ||
#define VARIABLEINSTANCELIST_H | ||
#include "bookmark.h" | ||
#include "item.h" | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
/// @file create a list of bookmarks for all instance of a variable on | ||
/// current canvas | ||
|
||
namespace minsky | ||
{ | ||
class Group; | ||
|
||
class VariableInstanceList | ||
{ | ||
Group& model; | ||
std::vector<Bookmark> bookmarks; | ||
std::vector<ItemPtr> items; | ||
public: | ||
/// @param model top level group to obtain instances from | ||
/// @param valueId id of variables to obtain the instances of | ||
VariableInstanceList(Group& model, const std::string& valueId); | ||
/// zoom model to instance number in the list | ||
void gotoInstance(size_t); | ||
/// return the list of names | ||
std::vector<std::string> names() const { | ||
std::vector<std::string> r; | ||
for (auto& b: bookmarks) r.push_back(b.name); | ||
return r; | ||
} | ||
}; | ||
} | ||
|
||
#include "variableInstanceList.cd" | ||
#endif |