Skip to content

Commit b79c433

Browse files
committed
Working on reverting network editor space change
1 parent a4b8a1e commit b79c433

File tree

5 files changed

+22
-13
lines changed

5 files changed

+22
-13
lines changed

src/Dataflow/Engine/Controller/NetworkEditorController.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -645,12 +645,7 @@ ExecutionContextHandle NetworkEditorController::createExecutionContext(const Exe
645645
boost::shared_ptr<boost::thread> NetworkEditorController::executeGeneric(const ExecutableLookup* lookup, ModuleFilter filter)
646646
{
647647
initExecutor();
648-
649-
650-
651-
652648
auto context = createExecutionContext(lookup, filter);
653-
654649
return executionManager_.enqueueContext(context);
655650
}
656651

src/Interface/Application/ModuleProxyWidget.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ void ModuleProxyWidget::snapToGrid()
340340

341341
void ModuleProxyWidget::keepInScene()
342342
{
343+
#if 0 //post-ibbm
343344
//qDebug() << __FUNCTION__ << pos();
344345
if (x() < 0)
345346
setPos(10, y());
@@ -352,6 +353,7 @@ void ModuleProxyWidget::keepInScene()
352353
setPos(x(), NetworkBoundaries::sceneHeight - 10);
353354

354355
//qDebug() << "~" << __FUNCTION__ << pos();
356+
#endif
355357
}
356358

357359
void ModuleProxyWidget::mouseMoveEvent(QGraphicsSceneMouseEvent *event)

src/Interface/Application/NetworkEditor.cc

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ NetworkEditor::NetworkEditor(const NetworkEditorParameters& params, QWidget* par
8585

8686
connect(scene_, SIGNAL(changed(const QList<QRectF>&)), this, SIGNAL(sceneChanged(const QList<QRectF>&)));
8787

88-
setSceneRect(QRectF(0, 0, sceneWidth, sceneHeight));
88+
//old
89+
setSceneRect(QRectF(-1000, -1000, 2000, 2000));
90+
centerOn(100, 100);
91+
//new
92+
//setSceneRect(QRectF(0, 0, sceneWidth, sceneHeight));
8993
//centerOn(sceneWidth / 2, sceneHeight / 4);
9094

9195
setMouseAsDragMode();
@@ -142,6 +146,8 @@ boost::shared_ptr<NetworkEditorControllerGuiProxy> NetworkEditor::getNetworkEdit
142146

143147
QPointF NetworkBoundaries::keepInScene(const QPointF& p)
144148
{
149+
return p;
150+
#if 0 //post-ibbm
145151
auto adjusted = p;
146152
if (adjusted.x() < 0)
147153
adjusted.setX(0);
@@ -155,6 +161,7 @@ QPointF NetworkBoundaries::keepInScene(const QPointF& p)
155161

156162
return adjusted;
157163
//return QPointF(static_cast<int>(p.x()) % sceneWidth, static_cast<int>(p.y()) % sceneHeight);
164+
#endif
158165
}
159166

160167
void NetworkEditor::addModuleWidget(const std::string& name, ModuleHandle module, const ModuleCounter& count)
@@ -595,7 +602,7 @@ void NetworkEditor::copy()
595602
auto selected = scene_->selectedItems();
596603
if (selected.empty())
597604
return;
598-
605+
599606
auto modSelected = [&selected](ModuleHandle mod)
600607
{
601608
for (const auto& item : selected)
@@ -1186,9 +1193,8 @@ SubnetworksHandle NetworkEditor::dumpSubnetworks(ModuleFilter modFilter) const
11861193
return subnets;
11871194
}
11881195

1189-
void NetworkEditor::updateModulePositions(const ModulePositions& modulePositions, bool selectAll)
1196+
QPointF NetworkEditor::getModulePositionAdjustment(const ModulePositions& modulePositions)
11901197
{
1191-
QPointF furthestFromOrigin(0,0);
11921198
std::vector<QPointF> positions;
11931199
Q_FOREACH(QGraphicsItem* item, scene_->items())
11941200
{
@@ -1212,7 +1218,12 @@ void NetworkEditor::updateModulePositions(const ModulePositions& modulePositions
12121218
adjustment = { minX.x(), minY.y() };
12131219
}
12141220
}
1221+
return adjustment;
1222+
}
12151223

1224+
void NetworkEditor::updateModulePositions(const ModulePositions& modulePositions, bool selectAll)
1225+
{
1226+
const auto adjustment = QPointF(); // TODO: after ibbm, work on resizing of network editor space
12161227
Q_FOREACH(QGraphicsItem* item, scene_->items())
12171228
{
12181229
if (auto w = dynamic_cast<ModuleProxyWidget*>(item))

src/Interface/Application/NetworkEditor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ namespace Gui {
397397
QList<QGraphicsItem*> includeConnections(QList<QGraphicsItem*> items) const;
398398
QRectF visibleRect() const;
399399
void deleteImpl(QList<QGraphicsItem*> items);
400+
QPointF getModulePositionAdjustment(const SCIRun::Dataflow::Networks::ModulePositions& modulePositions);
400401

401402
// default constructed
402403
bool modulesSelectedByCL_{ false };

src/Modules/Math/BooleanCompare.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ namespace Math {
4343
{
4444
public:
4545
BooleanCompare();
46-
virtual void execute();
47-
virtual void setStateDefaults();
46+
virtual void execute() override;
47+
virtual void setStateDefaults() override;
4848

4949
INPUT_PORT(0, MatrixA, Matrix);
5050
INPUT_PORT(1, MatrixB, Matrix);
5151
INPUT_PORT(2, PossibleOutput, Matrix);
5252
OUTPUT_PORT(0, OutputMatrix, Matrix);
5353
OUTPUT_PORT(1, BooleanResult, Matrix);
54-
54+
5555
MODULE_TRAITS_AND_INFO(ModuleHasUIAndAlgorithm)
5656
NEW_HELP_WEBPAGE_ONLY
57-
57+
5858
};
5959
}}}
6060

0 commit comments

Comments
 (0)