Skip to content

Commit

Permalink
Merge pull request #367 from pklampros/push_ref_to_layer
Browse files Browse the repository at this point in the history
Allow pushing the Ref or Key value to another layer
  • Loading branch information
pklampros authored Jul 31, 2020
2 parents bd5e770 + 6cbbe2d commit 772b0f8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions salalib/mgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1842,7 +1842,8 @@ bool MetaGraph::pushValuesToLayer(int sourcetype, int sourcelayer, int desttype,
m_dataMaps[sourcelayer].getAttributeRowFromShapeIndex(gate);

if (isObjectVisible(m_dataMaps[sourcelayer].getLayers(), row_in)) {
double thisval = row_in.getValue(col_in);
double thisval = gate;
if(col_in != -1) thisval = row_in.getValue(col_in);
pushValue(val,count,thisval,push_func);
}
}
Expand Down Expand Up @@ -1874,7 +1875,8 @@ bool MetaGraph::pushValuesToLayer(int sourcetype, int sourcelayer, int desttype,
std::vector<int> gatelist;
if (desttype == VIEWDATA) {
gatelist = m_dataMaps[size_t(destlayer)].pointInPolyList(m_pointMaps[size_t(sourcelayer)].getPoint(pix_in).m_location);
double thisval = iter_in->getRow().getValue(col_in);
double thisval = iter_in->getKey().value;
if(col_in != -1) thisval = iter_in->getRow().getValue(col_in);
for (int gate: gatelist) {
AttributeRow &row_out =
m_dataMaps[destlayer].getAttributeRowFromShapeIndex(gate);
Expand All @@ -1887,7 +1889,8 @@ bool MetaGraph::pushValuesToLayer(int sourcetype, int sourcelayer, int desttype,
} else if (desttype == VIEWAXIAL) {
// note, "axial" could be convex map, and hence this would be a valid operation
gatelist = m_shapeGraphs[size_t(destlayer)]->pointInPolyList(m_pointMaps[size_t(sourcelayer)].getPoint(pix_in).m_location);
double thisval = iter_in->getRow().getValue(col_in);
double thisval = iter_in->getKey().value;
if(col_in != -1) thisval = iter_in->getRow().getValue(col_in);
for (int gate: gatelist) {
int key_out = m_shapeGraphs[destlayer]->getShapeRefFromIndex(gate)->first;
AttributeRow &row_out =
Expand Down Expand Up @@ -1915,7 +1918,8 @@ bool MetaGraph::pushValuesToLayer(int sourcetype, int sourcelayer, int desttype,
if (desttype == VIEWDATA) {
auto dataMap = m_shapeGraphs[size_t(sourcelayer)]->getAllShapes();
gatelist = m_dataMaps[size_t(destlayer)].shapeInPolyList(dataMap[key_in]);
double thisval = iter_in->getRow().getValue(col_in);
double thisval = iter_in->getKey().value;
if(col_in != -1) thisval = iter_in->getRow().getValue(col_in);
for (int gate: gatelist) {
int key_out = m_dataMaps[destlayer].getShapeRefFromIndex(gate)->first;
AttributeRow &row_out =
Expand All @@ -1930,7 +1934,8 @@ bool MetaGraph::pushValuesToLayer(int sourcetype, int sourcelayer, int desttype,
else if (desttype == VIEWAXIAL) {
auto shapeMap = m_shapeGraphs[size_t(sourcelayer)]->getAllShapes();
gatelist = m_shapeGraphs[size_t(destlayer)]->shapeInPolyList(shapeMap[key_in]);
double thisval = iter_in->getRow().getValue(col_in);
double thisval = iter_in->getKey().value;
if(col_in != -1) thisval = iter_in->getRow().getValue(col_in);
for (int gate: gatelist) {
int key_out = m_shapeGraphs[destlayer]->getShapeRefFromIndex(gate)->first;
AttributeRow &row_out = table_out.getRow(AttributeKey(key_out));
Expand Down

0 comments on commit 772b0f8

Please sign in to comment.