Skip to content

Commit 413a40a

Browse files
committed
Merge branch 'master' into vecGlyphs
2 parents dcb15af + 1a75a30 commit 413a40a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+300
-160
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ MESSAGE(STATUS "Git version commit hash: " "${VERSION_HASHVAR}")
119119
string(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION_TAG}")
120120
string(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${VERSION_TAG}")
121121
#TODO: make generic
122-
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\-(alpha.[A-Za-z0-9_]+)\\-?.*" "\\1" VERSION_PATCH "${VERSION_TAG}")
122+
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\-(beta.[A-Za-z0-9_]+)\\-?.*" "\\1" VERSION_PATCH "${VERSION_TAG}")
123123
#TODO: parse SHA
124124
#string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1" VERSION_SHA1 "${VERSION}")
125125
#set(VERSION_SHORT "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")

src/Core/Algorithms/Legacy/Fields/FieldData/SetFieldData.cc

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,7 @@ bool SetFieldDataAlgo::setvectordata(VField* ofield, DenseMatrixHandle data, siz
282282
else if (((nrows == 1) && (ncols == 3)) || ((ncols == 1) && (nrows == 3)))
283283
{
284284
Vector v;
285-
if ((nrows == 1) && (nrows == 3)) { v[0] = (*data)(0, 0); v[1] = (*data)(0, 1); v[2] = (*data)(0, 2); }
286-
if ((ncols == 1) && (ncols == 3)) { v[0] = (*data)(0, 0); v[1] = (*data)(1, 0); v[2] = (*data)(2, 0); }
285+
v[0] = (*data)(0, 0); v[1] = (*data)(0, 1); v[2] = (*data)(0, 2);
287286
ofield->set_all_values(v);
288287
}
289288
else
@@ -301,86 +300,58 @@ bool SetFieldDataAlgo::settensordata(VField* ofield, DenseMatrixHandle data, siz
301300
/// Handle 6 by n data
302301
if ((ncols == 6) && (nrows == numvals))
303302
{
304-
Vector v[6];
305303
for (VMesh::index_type i = 0; i < numnvals; i++)
306304
{
307-
v[0] = (*data)(i, 0); v[1] = (*data)(i, 1); v[2] = (*data)(i, 2);
308-
v[3] = (*data)(i, 3); v[4] = (*data)(i, 4); v[5] = (*data)(i, 5);
309-
ofield->set_values(v, i);
305+
ofield->set_value(Tensor((*data)(i, 0),(*data)(i, 1),(*data)(i, 2),(*data)(i, 3),(*data)(i, 4),(*data)(i, 5)), i);
310306
}
311307
for (VMesh::index_type i=numnvals; i< numevals+numnvals; i++)
312308
{
313-
v[0]=(* data)(i,0); v[1]=(* data)(i,1); v[2]=(* data)(i,2);
314-
v[3]=(* data)(i,3); v[4]=(* data)(i,4); v[5]=(* data)(i,5);
315-
ofield->set_evalues(v,i);
309+
ofield->set_evalue(Tensor((*data)(i, 0),(*data)(i, 1),(*data)(i, 2),(*data)(i, 3),(*data)(i, 4),(*data)(i, 5)), i);
316310
}
317311
}
318312
else if ((nrows == 6) && (ncols == numvals))
319313
{
320-
Vector v[6];
321314
for (VMesh::index_type i = 0; i < numnvals; i++)
322315
{
323-
v[0] = (*data)(0, i); v[1] = (*data)(1, i); v[2] = (*data)(2, i);
324-
v[3] = (*data)(3, i); v[4] = (*data)(4, i); v[5] = (*data)(5, i);
325-
ofield->set_values(v, i);
316+
ofield->set_value(Tensor((*data)(0,i),(*data)(1,i),(*data)(2,i),(*data)(3,i),(*data)(4,i),(*data)(5,i)), i);
317+
std::cout<<"nodes. vector = "<<(*data)(0,i)<<","<<(*data)(1,i)<<","<<(*data)(2,i)<<","<<(*data)(3,i)<<","<<(*data)(4,i)<<","<<(*data)(5,i)<<std::endl;
326318
}
327319
for (VMesh::index_type i=numnvals; i< numevals+numnvals; i++)
328320
{
329-
v[0]=(* data)(0,i); v[1]=(* data)(1,i); v[2]=(* data)(2,i);
330-
v[3]=(* data)(3,i); v[4]=(* data)(4,i); v[5]=(* data)(5,i);
331-
ofield->set_evalues(v,i);
321+
ofield->set_evalue(Tensor((*data)(0,i),(*data)(1,i),(*data)(2,i),(*data)(3,i),(*data)(4,i),(*data)(5,i)), i);
332322
}
333323
}
334324
else if (((nrows == 1) && (ncols == 6)) || ((ncols == 1) && (nrows == 6)))
335325
{
336-
Vector v;
337-
if ((nrows == 1) && (ncols == 6)) { v[0] = (*data)(0, 0); v[1] = (*data)(0, 1); v[2] = (*data)(0, 2); v[3] = (*data)(0, 3); v[4] = (*data)(0, 4); v[5] = (*data)(0, 5); }
338-
if ((ncols == 1) && (nrows == 6)) { v[0] = (*data)(0, 0); v[1] = (*data)(1, 0); v[2] = (*data)(2, 0); v[3] = (*data)(3, 0); v[4] = (*data)(4, 0); v[5] = (*data)(5, 0); }
339-
ofield->set_all_values(v);
326+
ofield->set_all_values(Tensor((*data)(0, 0),(*data)(0, 1),(*data)(0, 2),(*data)(0, 3),(*data)(0, 4),(*data)(0, 5)));
327+
340328
}
341329
/// Handle 9 by n data
342330
else if ((ncols == 9) && (nrows == numvals))
343331
{
344-
Vector v[9];
345332
for (VMesh::index_type i = 0; i < numnvals; i++)
346333
{
347-
v[0] = (*data)(i, 0); v[1] = (*data)(i, 1); v[2] = (*data)(i, 2);
348-
v[3] = (*data)(i, 3); v[4] = (*data)(i, 4); v[5] = (*data)(i, 5);
349-
v[6] = (*data)(i, 6); v[7] = (*data)(i, 7); v[8] = (*data)(i, 8);
350-
ofield->set_values(v, i);
334+
ofield->set_value(Tensor((*data)(i, 0),(*data)(i, 1),(*data)(i, 2),(*data)(i, 3),(*data)(i, 4),(*data)(i, 8)), i);
351335
}
352336
for (VMesh::index_type i=numnvals; i< numevals+numnvals; i++)
353337
{
354-
v[0]=(* data)(i,0); v[1]=(* data)(i,1); v[2]=(* data)(i,2);
355-
v[3]=(* data)(i,3); v[4]=(* data)(i,4); v[5]=(* data)(i,5);
356-
v[6]=(* data)(i,6); v[7]=(* data)(i,7); v[8]=(* data)(i,8);
357-
ofield->set_evalues(v,i);
338+
ofield->set_evalue(Tensor((*data)(i, 0),(*data)(i, 1),(*data)(i, 2),(*data)(i, 3),(*data)(i, 4),(*data)(i, 8)), i);
358339
}
359340
}
360341
else if ((nrows == 9) && (ncols == numvals))
361342
{
362-
Vector v[9];
363343
for (VMesh::index_type i = 0; i < numnvals; i++)
364344
{
365-
v[0] = (*data)(0, i); v[1] = (*data)(1, i); v[2] = (*data)(2, i);
366-
v[3] = (*data)(3, i); v[4] = (*data)(4, i); v[5] = (*data)(5, i);
367-
v[6] = (*data)(6, i); v[7] = (*data)(7, i); v[8] = (*data)(8, i);
368-
ofield->set_values(v, i);
345+
ofield->set_value(Tensor((*data)(0,i),(*data)(1,i),(*data)(2,i),(*data)(3,i),(*data)(4,i),(*data)(8,i)), i);
369346
}
370347
for (VMesh::index_type i=numnvals; i< numevals+numnvals; i++)
371348
{
372-
v[0]=(* data)(0,i); v[1]=(* data)(1,i); v[2]=(* data)(2,i);
373-
v[3]=(* data)(3,i); v[4]=(* data)(4,i); v[5]=(* data)(5,i);
374-
v[6]=(* data)(6,i); v[7]=(* data)(7,i); v[8]=(* data)(8,i);
375-
ofield->set_evalues(v,i);
349+
ofield->set_evalue(Tensor((*data)(0,i),(*data)(1,i),(*data)(2,i),(*data)(3,i),(*data)(4,i),(*data)(8,i)), i);
376350
}
377351
}
378352
else if (((nrows == 1) && (ncols == 9)) || ((ncols == 1) && (nrows == 9)))
379353
{
380-
Vector v;
381-
if ((nrows == 1) && (ncols == 9)) { v[0] = (*data)(0, 0); v[1] = (*data)(0, 1); v[2] = (*data)(0, 2); v[3] = (*data)(0, 3); v[4] = (*data)(0, 4); v[5] = (*data)(0, 5); }
382-
if ((ncols == 1) && (nrows == 9)) { v[0] = (*data)(0, 0); v[1] = (*data)(1, 0); v[2] = (*data)(2, 0); v[3] = (*data)(3, 0); v[4] = (*data)(4, 0); v[5] = (*data)(5, 0); }
383-
ofield->set_all_values(v);
354+
ofield->set_all_values(Tensor((*data)(0, 0),(*data)(0, 1),(*data)(0, 2),(*data)(0, 3),(*data)(0, 4),(*data)(0, 8)));
384355
}
385356
else
386357
{

src/Core/Algorithms/Math/AddKnownsToLinearSystem.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ bool AddKnownsToLinearSystemAlgo::run(SparseRowMatrixHandle stiff,
6565

6666
SparseRowMatrixFromMap::Values additionalData;
6767

68-
// Making sure the stiff matrix (left hand side) is symmetric
69-
if (!isSymmetricMatrix(*stiff,bound_for_equality))
70-
{
71-
std::ostringstream ostr1;
72-
ostr1 << "matrix A is not symmetrical due to a difference of " << bound_for_equality << std::endl;
73-
THROW_ALGORITHM_INPUT_ERROR(ostr1.str());
74-
}
7568

7669
// Storing the number of columns in m and rows in n from the stiff matrix, m == n
7770
const unsigned int numCols = static_cast<unsigned int>(stiff->ncols());

src/Core/Command/Command.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ namespace SCIRun
8888
ImportNetworkFile,
8989
RunPythonScript,
9090
SetupDataDirectory,
91+
DisableViewScenes,
9192
ExecuteCurrentNetwork,
9293
InteractiveMode,
9394
SetupQuitAfterExecute,

src/Core/ConsoleApplication/ConsoleCommandFactory.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ CommandHandle ConsoleGlobalCommandFactory::create(GlobalCommands type) const
6868
return boost::make_shared<QuitAfterExecuteCommandConsole>();
6969
case GlobalCommands::QuitCommand:
7070
return boost::make_shared<QuitCommandConsole>();
71+
case GlobalCommands::DisableViewScenes:
72+
return boost::make_shared<NothingCommand>();
7173
default:
7274
THROW_INVALID_ARGUMENT("Unknown global command type.");
7375
}

src/Core/ConsoleApplication/ConsoleCommands.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,14 @@ namespace Console {
4141
public:
4242
LoadFileCommandConsole();
4343
virtual bool execute() override;
44-
private:
45-
int index_ = 0;
44+
// private:
45+
// int index_ = 0;
4646
};
4747

4848
class SCISHARE SaveFileCommandConsole : public Core::Commands::ConsoleCommand
4949
{
5050
public:
51-
//LoadFileCommandConsole();
5251
virtual bool execute() override;
53-
//private:
54-
// int index_ = 0;
5552
};
5653

5754
class SCISHARE RunPythonScriptCommandConsole : public Core::Commands::ConsoleCommand

src/Dataflow/Engine/Controller/PythonImpl.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ namespace SCIRun {
524524
class PythonImplImpl
525525
{
526526
public:
527-
std::map<std::string, std::map<int, std::map<std::string, std::map<int, std::string>>>> connectionIdLookup_; //seems silly
527+
std::map<std::string, std::map<int, std::map<std::string, std::map<int, std::string>>>> connectionIdLookup_;
528528
};
529529
}
530530
}
@@ -612,6 +612,8 @@ boost::shared_ptr<PyModule> PythonImpl::findModule(const std::string& id) const
612612

613613
std::string PythonImpl::executeAll(const ExecutableLookup* lookup)
614614
{
615+
cmdFactory_->create(GlobalCommands::DisableViewScenes)->execute();
616+
615617
nec_.executeAll(lookup);
616618
return "Execution started."; //TODO: attach log for execution ended event.
617619
}

src/Dataflow/Network/Connection.cc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Copyright (c) 2015 Scientific Computing and Imaging Institute,
77
University of Utah.
88
9-
9+
1010
Permission is hereby granted, free of charge, to any person obtaining a
1111
copy of this software and associated documentation files (the "Software"),
1212
to deal in the Software without restriction, including without limitation
@@ -38,7 +38,7 @@ Connection::Connection(OutputPortHandle oport, InputPortHandle iport, const Conn
3838
ENSURE_NOT_NULL(oport_, "output port is null");
3939
ENSURE_NOT_NULL(iport_, "input port is null");
4040

41-
/// @todo: this is already checked in the controller layer. Do we need a redundant check here?
41+
/// @todo: this is already checked in the controller layer. Do we need a redundant check here?
4242
//if (oport_->get_colorname() != iport_->get_colorname())
4343
// THROW_INVALID_ARGUMENT("Ports do not have matching type.");
4444

@@ -51,3 +51,15 @@ Connection::~Connection()
5151
oport_->detach(this);
5252
iport_->detach(this);
5353
}
54+
55+
std::string Connection::id() const
56+
{
57+
return id_;
58+
}
59+
60+
void Connection::setDisable(bool disable)
61+
{
62+
disabled_ = disable;
63+
if (!disabled_)
64+
iport_->resendNewDataSignal();
65+
}

src/Dataflow/Network/Connection.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ namespace SCIRun {
4848
OutputPortHandle oport_;
4949
InputPortHandle iport_;
5050

51+
std::string id() const;
5152
ConnectionId id_;
5253

5354
bool disabled() const { return disabled_; }
54-
void setDisable(bool disable) { disabled_ = disable; }
55+
void setDisable(bool disable);
5556
private:
5657
bool disabled_ {false};
5758
};

src/Dataflow/Network/DataflowInterfaces.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Copyright (c) 2015 Scientific Computing and Imaging Institute,
77
University of Utah.
88
9-
9+
1010
Permission is hereby granted, free of charge, to any person obtaining a
1111
copy of this software and associated documentation files (the "Software"),
1212
to deal in the Software without restriction, including without limitation
@@ -28,7 +28,7 @@
2828
/// @todo Documentation Dataflow/Network/DataflowInterfaces.h
2929

3030
#ifndef DATAFLOW_NETWORK_DATAFLOW_INTERFACES_H
31-
#define DATAFLOW_NETWORK_DATAFLOW_INTERFACES_H
31+
#define DATAFLOW_NETWORK_DATAFLOW_INTERFACES_H
3232

3333
#include <Dataflow/Network/NetworkFwd.h>
3434
#include <Core/Datatypes/Datatype.h>
@@ -51,12 +51,12 @@ namespace Networks {
5151
};
5252

5353
typedef boost::signals2::signal<void(SCIRun::Core::Datatypes::DatatypeHandle)> DataHasChangedSignalType;
54-
54+
5555
class SCISHARE DatatypeSinkInterface
5656
{
5757
public:
5858
virtual ~DatatypeSinkInterface() {}
59-
59+
6060
// "mailbox" interface
6161
//virtual bool hasData() const = 0;
6262
//virtual void setHasData(bool dataPresent) = 0;
@@ -68,6 +68,7 @@ namespace Networks {
6868
virtual bool hasChanged() const = 0;
6969
virtual void invalidateProvider() = 0;
7070
virtual boost::signals2::connection connectDataHasChanged(const DataHasChangedSignalType::slot_type& subscriber) = 0;
71+
virtual void forceFireDataHasChanged() = 0;
7172
};
7273

7374
}}}

0 commit comments

Comments
 (0)