Skip to content

Commit

Permalink
Fix all-line map generation
Browse files Browse the repository at this point in the history
  • Loading branch information
pklampros committed Jul 13, 2024
1 parent d784a07 commit 6e2c3ac
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 99 deletions.
16 changes: 8 additions & 8 deletions depthmapX/graphdoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ LayerManagerImpl &QGraphDoc::getLayers(int type, std::optional<size_t> layer) {
break;
case MetaGraphDX::VIEWAXIAL:
tab = (!layer.has_value()) ? &(m_meta_graph->getDisplayedShapeGraph().getLayers())
: &(m_meta_graph->getShapeGraphs()[layer.value()]->getLayers());
: &(m_meta_graph->getShapeGraphs()[layer.value()].getLayers());
break;
case MetaGraphDX::VIEWDATA:
tab = (!layer.has_value()) ? &(m_meta_graph->getDisplayedDataMap().getLayers()) //
Expand All @@ -228,7 +228,7 @@ const LayerManagerImpl &QGraphDoc::getLayers(int type, std::optional<size_t> lay
break;
case MetaGraphDX::VIEWAXIAL:
tab = (!layer.has_value()) ? &(m_meta_graph->getDisplayedShapeGraph().getLayers())
: &(m_meta_graph->getShapeGraphs()[layer.value()]->getLayers());
: &(m_meta_graph->getShapeGraphs()[layer.value()].getLayers());
break;
case MetaGraphDX::VIEWDATA:
tab = (!layer.has_value()) ? &(m_meta_graph->getDisplayedDataMap().getLayers()) //
Expand All @@ -252,7 +252,7 @@ AttributeTableHandle &QGraphDoc::getAttributeTableHandle(int type, std::optional
case MetaGraphDX::VIEWAXIAL:
tab = (!layer.has_value())
? &(m_meta_graph->getDisplayedShapeGraph().getAttributeTableHandle())
: &(m_meta_graph->getShapeGraphs()[layer.value()]->getAttributeTableHandle());
: &(m_meta_graph->getShapeGraphs()[layer.value()].getAttributeTableHandle());
break;
case MetaGraphDX::VIEWDATA:
tab = (!layer.has_value())
Expand All @@ -278,7 +278,7 @@ const AttributeTableHandle &QGraphDoc::getAttributeTableHandle(int type,
case MetaGraphDX::VIEWAXIAL:
tab = (!layer.has_value())
? &(m_meta_graph->getDisplayedShapeGraph().getAttributeTableHandle())
: &(m_meta_graph->getShapeGraphs()[layer.value()]->getAttributeTableHandle());
: &(m_meta_graph->getShapeGraphs()[layer.value()].getAttributeTableHandle());
break;
case MetaGraphDX::VIEWDATA:
tab = (!layer.has_value())
Expand Down Expand Up @@ -307,15 +307,15 @@ void QGraphDoc::OnLayerNew() {
} else if (dlg.m_layer_type == 1) {
int ref = m_meta_graph->addShapeGraph(dlg.m_name.toStdString(), ShapeMap::CONVEXMAP);
m_meta_graph->setDisplayedShapeGraphRef(ref);
map = m_meta_graph->getShapeGraphs()[size_t(ref)].get();
map = &m_meta_graph->getShapeGraphs()[size_t(ref)];
} else if (dlg.m_layer_type == 2) {
int ref = m_meta_graph->addShapeGraph(dlg.m_name.toStdString(), ShapeMap::AXIALMAP);
m_meta_graph->setDisplayedShapeGraphRef(ref);
map = m_meta_graph->getShapeGraphs()[size_t(ref)].get();
map = &m_meta_graph->getShapeGraphs()[size_t(ref)];
} else if (dlg.m_layer_type == 3) {
int ref = m_meta_graph->addShapeGraph(dlg.m_name.toStdString(), ShapeMap::PESHMAP);
m_meta_graph->setDisplayedShapeGraphRef(ref);
map = m_meta_graph->getShapeGraphs()[size_t(ref)].get();
map = &m_meta_graph->getShapeGraphs()[size_t(ref)];
}

QtRegion r = m_meta_graph->getBoundingBox();
Expand Down Expand Up @@ -2243,7 +2243,7 @@ void QGraphDoc::OnPushToLayer() {
i != m_meta_graph->getDisplayedShapeGraphRef()) {
names.insert(
std::make_pair(std::pair<int, int>(MetaGraphDX::VIEWAXIAL, int(i)),
std::string("Shape Graphs: ") + shapegraphs[i]->getName()));
std::string("Shape Graphs: ") + shapegraphs[i].getName()));
}
}
for (i = 0; i < m_meta_graph->getPointMaps().size(); i++) {
Expand Down
19 changes: 10 additions & 9 deletions depthmapX/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,9 +1225,9 @@ void MainWindow::OnSelchangingTree(QTreeWidgetItem *hItem, int col) {
} else if (entry.m_subcat == -1 && m_indexWidget->isEditableColumn(col)) {
// hit editable box
if (entry.m_type == 1) {
int type = graph->getShapeGraphs()[entry.m_cat]->getInternalMap().getMapType();
int type = graph->getShapeGraphs()[entry.m_cat].getInternalMap().getMapType();
if (type != ShapeMap::SEGMENTMAP && type != ShapeMap::ALLLINEMAP) {
graph->getShapeGraphs()[entry.m_cat]->setEditable(
graph->getShapeGraphs()[entry.m_cat].setEditable(
m_indexWidget->isItemSetEditable(hItem));
update = true;
}
Expand All @@ -1247,7 +1247,7 @@ void MainWindow::OnSelchangingTree(QTreeWidgetItem *hItem, int col) {
// They've clicked on the displayed layers
if (entry.m_type == 1) {
update = true;
graph->getShapeGraphs()[entry.m_cat]->getInternalMap().setLayerVisible(
graph->getShapeGraphs()[entry.m_cat].getInternalMap().setLayerVisible(
entry.m_subcat, m_indexWidget->isItemSetVisible(hItem));
} else if (entry.m_type == 2) {
update = true;
Expand Down Expand Up @@ -1347,11 +1347,11 @@ void MainWindow::SetGraphTreeChecks() {
}
break;
case 1: {
int type = graph->getShapeGraphs()[entry.m_cat]->getInternalMap().getMapType();
int type = graph->getShapeGraphs()[entry.m_cat].getInternalMap().getMapType();
if (type == ShapeMap::SEGMENTMAP || type == ShapeMap::ALLLINEMAP) {
editable = MetaGraphDX::NOT_EDITABLE;
} else {
editable = graph->getShapeGraphs()[entry.m_cat]->isEditable()
editable = graph->getShapeGraphs()[entry.m_cat].isEditable()
? MetaGraphDX::EDITABLE_ON
: MetaGraphDX::EDITABLE_OFF;
}
Expand All @@ -1378,7 +1378,7 @@ void MainWindow::SetGraphTreeChecks() {
// do not currently have layers supported
bool show = false;
if (entry.m_type == 1) {
show = graph->getShapeGraphs()[entry.m_cat]->getInternalMap().isLayerVisible(
show = graph->getShapeGraphs()[entry.m_cat].getInternalMap().isLayerVisible(
entry.m_subcat);
} else if (entry.m_type == 2) {
show = graph->getDataMaps()[entry.m_cat].getInternalMap().isLayerVisible(
Expand Down Expand Up @@ -1465,13 +1465,13 @@ void MainWindow::MakeGraphTree() {
m_treeroots[1] = hItem;
}
for (size_t i = 0; i < m_treeDoc->m_meta_graph->getShapeGraphs().size(); i++) {
QString name = QString(m_treeDoc->m_meta_graph->getShapeGraphs()[i]->getName().c_str());
QString name = QString(m_treeDoc->m_meta_graph->getShapeGraphs()[i].getName().c_str());
QTreeWidgetItem *hItem = m_indexWidget->addNewItem(name, m_treeroots[1]);
m_indexWidget->setItemVisibility(hItem, Qt::Unchecked);
m_indexWidget->setItemEditability(hItem, Qt::Unchecked);
ItemTreeEntry entry(1, (short)i, -1);
m_treegraphmap.insert(std::make_pair(hItem, entry));
LayerManagerImpl &layers = m_treeDoc->m_meta_graph->getShapeGraphs()[i]->getLayers();
LayerManagerImpl &layers = m_treeDoc->m_meta_graph->getShapeGraphs()[i].getLayers();
if (layers.getNumLayers() > 1) {
for (int j = 0; j < layers.getNumLayers(); j++) {
QString name = QString(layers.getLayerName(j).c_str());
Expand Down Expand Up @@ -2637,7 +2637,8 @@ void MainWindow::updateToolbar() {
(m_p->m_meta_graph->getDisplayedPointMap().getFilledPointCount() > 1)) ||
(((m_p->m_meta_graph->getViewClass() & MetaGraphDX::VIEWAXIAL) &&
(m_p->m_meta_graph->getState() & MetaGraphDX::SHAPEGRAPHS)) &&
(!m_p->m_meta_graph->getDisplayedShapeGraph().isSegmentMap()))))
(m_p->m_meta_graph->hasDisplayedShapeGraph() &&
!m_p->m_meta_graph->getDisplayedShapeGraph().isSegmentMap()))))
JoinToolButton->setEnabled(true);
else {
if (tmpView) {
Expand Down
Loading

0 comments on commit 6e2c3ac

Please sign in to comment.