comparison layer/TimeInstantLayer.cpp @ 1471:f2525e6cbdf1 by-id

More layer updates
author Chris Cannam
date Mon, 01 Jul 2019 14:17:13 +0100
parents 696e569ff21b
children 36ad3cdabf55
comparison
equal deleted inserted replaced
1470:696e569ff21b 1471:f2525e6cbdf1
62 } 62 }
63 63
64 void 64 void
65 TimeInstantLayer::setModel(ModelId modelId) 65 TimeInstantLayer::setModel(ModelId modelId)
66 { 66 {
67 auto newModel = ModelById::getAs<SparseOneDimensionalModel>(modelId);
68 if (!modelId.isNone() && !newModel) {
69 throw std::logic_error("Not a SparseOneDimensionalModel");
70 }
71
67 if (m_model == modelId) return; 72 if (m_model == modelId) return;
68 m_model = modelId; 73 m_model = modelId;
69 74
70 auto newModel = ModelById::getAs<SparseOneDimensionalModel>(modelId); 75 if (newModel) {
71 76 connectSignals(m_model);
72 connectSignals(m_model); 77 if (newModel->getRDFTypeURI().endsWith("Segment")) {
73 78 setPlotStyle(PlotSegmentation);
74 #ifdef DEBUG_TIME_INSTANT_LAYER 79 }
75 cerr << "TimeInstantLayer::setModel(" << modelId << ")" << endl;
76 #endif
77
78 if (newModel && newModel->getRDFTypeURI().endsWith("Segment")) {
79 setPlotStyle(PlotSegmentation);
80 } 80 }
81 81
82 emit modelReplaced(); 82 emit modelReplaced();
83 } 83 }
84 84