-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetagraphdx.h
544 lines (507 loc) · 23.1 KB
/
metagraphdx.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
// SPDX-FileCopyrightText: 2000-2010 University College London, Alasdair Turner
// SPDX-FileCopyrightText: 2011-2012 Tasos Varoudis
// SPDX-FileCopyrightText: 2024 Petros Koutsolampros
//
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
// Interface: the meta graph loads and holds all sorts of arbitrary data...
#include "options.h"
#include "pointmapdx.h"
#include "shapegraphdx.h"
#include "shapemapdx.h"
#include "shapemapgroupdatadx.h"
#include "salalib/bspnodetree.h"
#include "salalib/connector.h"
#include "salalib/ianalysis.h"
#include "salalib/importtypedefs.h"
#include "salalib/isovist.h"
#include "salalib/metagraph.h"
#include "salalib/metagraphreadwrite.h"
#include "salalib/pushvalues.h"
#include "salalib/spacepix.h"
#include "salalib/genlib/p2dpoly.h"
#include <memory>
#include <mutex>
#include <optional>
#include <vector>
///////////////////////////////////////////////////////////////////////////////////
class Communicator;
// A meta graph is precisely what it says it is
class MetaGraphDX {
MetaGraph m_metaGraph;
MetaGraphReadWrite::ReadStatus m_readStatus = MetaGraphReadWrite::ReadStatus::OK;
int m_state;
int m_viewClass;
bool m_showGrid;
bool m_showText;
struct ShapeMapGroup {
ShapeMapGroupDataDX groupData;
std::vector<ShapeMapDX> maps;
ShapeMapGroup(const std::string &groupName) : groupData(groupName) {}
ShapeMapGroup(ShapeMapGroup &&other)
: groupData(std::move(other.groupData)), maps(std::move(other.maps)) {}
ShapeMapGroup &operator=(ShapeMapGroup &&other) = default;
size_t addMap(std::unique_ptr<ShapeMap> &&shapeMap) {
maps.push_back(std::move(shapeMap));
if (maps.size() == 1) {
groupData.setRegion(maps.back().getRegion());
} else {
groupData.setRegion(runion(groupData.getRegion(), maps.back().getRegion()));
}
return maps.size() - 1;
}
};
std::vector<ShapeMapGroup> m_drawingFiles;
std::vector<ShapeMapDX> m_dataMaps;
std::vector<ShapeGraphDX> m_shapeGraphs;
std::vector<PointMapDX> m_pointMaps;
std::optional<size_t> m_displayedDatamap = std::nullopt;
std::optional<size_t> m_displayedPointmap = std::nullopt;
std::optional<size_t> m_displayedShapegraph = std::nullopt;
BSPNodeTree m_bspNodeTree;
public:
MetaGraphDX(std::string name = "");
MetaGraphDX(MetaGraphDX &&other)
: m_drawingFiles(std::move(other.m_drawingFiles)), m_dataMaps(std::move(other.m_dataMaps)),
m_shapeGraphs(std::move(other.m_shapeGraphs)), m_pointMaps(std::move(other.m_pointMaps)) {
}
MetaGraphDX &operator=(MetaGraphDX &&other) = default;
~MetaGraphDX(){};
public:
enum {
SHOWHIDEVGA = 0x0100,
SHOWVGATOP = 0x0200,
SHOWHIDEAXIAL = 0x0400,
SHOWAXIALTOP = 0x0800,
SHOWHIDESHAPE = 0x1000,
SHOWSHAPETOP = 0x2000
};
enum {
VIEWNONE = 0x00,
VIEWVGA = 0x01,
VIEWBACKVGA = 0x02,
VIEWAXIAL = 0x04,
VIEWBACKAXIAL = 0x08,
VIEWDATA = 0x20,
VIEWBACKDATA = 0x40,
VIEWFRONT = 0x25
};
enum {
ADD = 0x0001,
REPLACE = 0x0002,
CAT = 0x0010,
DXF = 0x0020,
NTF = 0x0040,
RT1 = 0x0080,
GML = 0x0100
};
enum {
NONE = 0x0000,
POINTMAPS = 0x0002,
LINEDATA = 0x0004,
ANGULARGRAPH = 0x0010,
DATAMAPS = 0x0020,
AXIALLINES = 0x0040,
SHAPEGRAPHS = 0x0100,
BUGGY = 0x8000
};
enum { NOT_EDITABLE = 0, EDITABLE_OFF = 1, EDITABLE_ON = 2 };
std::string &getName() { return m_metaGraph.name; }
const QtRegion &getRegion() { return m_metaGraph.region; }
void setRegion(Point2f &bottomLeft, Point2f &topRight) {
m_metaGraph.region.bottomLeft = bottomLeft;
m_metaGraph.region.topRight = topRight;
}
MetaGraphReadWrite::ReadStatus getReadStatus() const { return m_readStatus; };
bool isShown() const {
for (auto &drawingFile : m_drawingFiles)
for (auto &map : drawingFile.maps)
if (map.isShown())
return true;
return false;
}
auto &getInternalData() { return m_metaGraph; }
auto &getFileProperties() { return m_metaGraph.fileProperties; }
auto &getDrawingFiles() { return m_drawingFiles; }
// P.K. The MetaGraph file format does not really store enough information
// about the ShapeMap groups (drawing files with their layers as ShapeMaps)
// so we resort to just checking if all the group maps are visible. Perhaps
// ShapeMapGroupDataDX should also have an m_show variable
bool isShown(const ShapeMapGroup &spf) const {
for (auto &pixel : spf.maps)
if (pixel.isShown())
return true;
return false;
}
// TODO: drawing state functions/fields that should be eventually removed
void makeViewportShapes(const QtRegion &viewport) const;
bool findNextShape(const ShapeMapGroup &spf, bool &nextlayer) const;
bool findNextShape(bool &nextlayer) const;
const SalaShape &getNextShape() const {
auto ¤tDrawingFile = m_drawingFiles[static_cast<size_t>(currentLayer)];
return currentDrawingFile
.maps[static_cast<size_t>(currentDrawingFile.groupData.getCurrentLayer())]
.getNextShape();
}
mutable int currentLayer;
public:
int getVersion() {
// note, if unsaved, m_file_version is -1
return m_metaGraph.version;
}
std::vector<PointMapDX> &getPointMaps() { return m_pointMaps; }
bool hasDisplayedPointMap() const { return m_displayedPointmap.has_value(); }
PointMapDX &getDisplayedPointMap() { return m_pointMaps[m_displayedPointmap.value()]; }
const PointMapDX &getDisplayedPointMap() const {
return m_pointMaps[m_displayedPointmap.value()];
}
void setDisplayedPointMapRef(size_t map) {
if (m_displayedPointmap.has_value() && m_displayedPointmap != map)
getDisplayedPointMap().clearSel();
m_displayedPointmap = map;
}
size_t getDisplayedPointMapRef() const { return m_displayedPointmap.value(); }
void redoPointMapBlockLines() // (flags blockedlines, but also flags that you need to rebuild a
// bsp tree if you have one)
{
for (auto &pointMap : m_pointMaps) {
pointMap.getInternalMap().resetBlockedLines();
}
}
size_t addNewPointMap(const std::string &name = std::string("VGA Map"));
private:
// helpful to know this for creating fewest line maps, although has to be reread at input
std::optional<AllLine::MapData> m_allLineMapData = std::nullopt;
void removePointMap(size_t i) {
if (m_displayedPointmap.has_value()) {
if (m_pointMaps.size() == 1)
m_displayedPointmap = std::nullopt;
else if (m_displayedPointmap.value() != 0 && m_displayedPointmap.value() >= i)
m_displayedPointmap.value()--;
}
m_pointMaps.erase(std::next(m_pointMaps.begin(), static_cast<int>(i)));
}
public:
int getState() const { return m_state; }
// use with caution: only very rarely needed outside MetaGraph itself
void setState(int state) { m_state = state; }
size_t loadLineData(Communicator *communicator, const std::string &fileName, int loadType);
size_t loadLineData(Communicator *communicator, const std::string &fileName,
depthmapX::ImportFileType importFileType, bool replace);
size_t addDrawingFile(std::string name, std::vector<ShapeMap> &&maps);
ShapeMapDX &createNewShapeMap(depthmapX::ImportType mapType, std::string name);
void deleteShapeMap(depthmapX::ImportType mapType, ShapeMapDX &shapeMap);
void updateParentRegions(ShapeMap &shapeMap);
bool clearPoints();
bool setGrid(double spacing, const Point2f &offset = Point2f()); // override of PointMap
void setShowGrid(bool showGrid) { m_showGrid = showGrid; }
bool getShowGrid() const { return m_showGrid; }
void setShowText(bool showText) { m_showText = showText; }
bool getShowText() const { return m_showText; }
bool makePoints(const Point2f &p, int semifilled,
Communicator *communicator = nullptr); // override of PointMap
bool hasVisibleDrawingShapes();
std::vector<std::pair<std::reference_wrapper<const ShapeMapDX>, int>> getShownDrawingMaps();
std::vector<std::pair<std::reference_wrapper<const ShapeMap>, int>>
getAsInternalMaps(std::vector<std::pair<std::reference_wrapper<const ShapeMapDX>, int>> maps);
std::vector<Line> getShownDrawingFilesAsLines();
std::vector<SalaShape> getShownDrawingFilesAsShapes();
bool makeGraph(Communicator *communicator, int algorithm, double maxdist);
bool unmakeGraph(bool removeLinks);
bool analyseGraph(Communicator *communicator, Options options,
bool simpleVersion); // <- options copied to keep thread safe
//
// helpers for editing maps
bool isEditableMap();
ShapeMapDX &getEditableMap();
// currently only making / moving lines, but should be able to extend this to polys fairly
// easily:
bool makeShape(const Line &line);
bool moveSelShape(const Line &line);
// onto polys as well:
int polyBegin(const Line &line);
bool polyAppend(int shapeRef, const Point2f &point);
bool polyClose(int shapeRef);
bool polyCancel(int shapeRef);
//
size_t addShapeGraph(ShapeGraphDX &&shapeGraph);
size_t addShapeGraph(ShapeGraph &&shapeGraph);
size_t addShapeGraph(const std::string &name, int type);
size_t addShapeMap(const std::string &name);
void removeDisplayedMap();
//
// various map conversions
bool convertDrawingToAxial(Communicator *comm,
std::string layerName); // n.b., name copied for thread safety
bool convertDataToAxial(Communicator *comm, std::string layerName, bool keeporiginal,
bool pushvalues);
bool convertDrawingToSegment(Communicator *comm, std::string layerName);
bool convertDataToSegment(Communicator *comm, std::string layerName, bool keeporiginal,
bool pushvalues);
bool convertToData(Communicator *, std::string layerName, bool keeporiginal, int shapeMapType,
bool copydata);
bool convertToDrawing(Communicator *, std::string layerName, bool fromDisplayedDataMap);
bool convertToConvex(Communicator *comm, std::string layerName, bool keeporiginal,
int shapeMapType, bool copydata);
bool convertAxialToSegment(Communicator *comm, std::string layerName, bool keeporiginal,
bool pushvalues, double stubremoval);
int loadMifMap(Communicator *comm, std::istream &miffile, std::istream &midfile);
bool makeAllLineMap(Communicator *communicator, const Point2f &seed);
bool makeFewestLineMap(Communicator *communicator, int replace);
bool analyseAxial(Communicator *communicator, Options options,
bool forceLegacyColumnOrder = false); // <- options copied to keep thread safe
bool analyseSegmentsTulip(
Communicator *communicator, Options options,
bool forceLegacyColumnOrder = false); // <- options copied to keep thread safe
bool analyseSegmentsAngular(Communicator *communicator,
Options options); // <- options copied to keep thread safe
bool analyseTopoMetMultipleRadii(Communicator *communicator,
Options options); // <- options copied to keep thread safe
bool analyseTopoMet(Communicator *communicator,
Options options); // <- options copied to keep thread safe
//
bool hasAllLineMap() { return m_allLineMapData.has_value(); }
bool hasFewestLineMaps() {
for (const auto &shapeGraph : m_shapeGraphs) {
if (shapeGraph.getName() == "Fewest-Line Map (Subsets)" ||
shapeGraph.getName() == "Fewest Line Map (Subsets)" ||
shapeGraph.getName() == "Fewest-Line Map (Minimal)" ||
shapeGraph.getName() == "Fewest Line Map (Minimal)") {
return true;
}
}
return false;
}
bool pushValuesToLayer(int desttype, size_t destlayer, PushValues::Func pushFunc,
bool countCol = false);
bool pushValuesToLayer(int sourcetype, size_t sourcelayer, int desttype, size_t destlayer,
std::optional<size_t> colIn, size_t colOut, PushValues::Func pushFunc,
bool createCountCol = false);
//
std::optional<size_t> getDisplayedMapRef() const;
//
// NB -- returns 0 (not editable), 1 (editable off) or 2 (editable on)
int isEditable() const;
bool canUndo() const;
void undo();
bool hasDisplayedDataMap() const { return m_displayedDatamap.has_value(); }
ShapeMapDX &getDisplayedDataMap() { return m_dataMaps[m_displayedDatamap.value()]; }
const ShapeMapDX &getDisplayedDataMap() const { return m_dataMaps[m_displayedDatamap.value()]; }
size_t getDisplayedDataMapRef() const { return m_displayedDatamap.value(); }
void removeDataMap(size_t i) {
if (m_displayedDatamap.has_value()) {
if (m_dataMaps.size() == 1)
m_displayedDatamap = std::nullopt;
else if (m_displayedDatamap.value() != 0 && m_displayedDatamap.value() >= i)
m_displayedDatamap.value()--;
}
m_dataMaps.erase(std::next(m_dataMaps.begin(), static_cast<int>(i)));
}
void setDisplayedDataMapRef(size_t map) {
if (m_displayedDatamap.has_value() && m_displayedDatamap != map)
getDisplayedDataMap().clearSel();
m_displayedDatamap = map;
}
template <class T>
std::optional<size_t> getMapRef(std::vector<T> &maps, const std::string &name) const {
// note, only finds first map with this name
for (size_t i = 0; i < maps.size(); i++) {
if (maps[i].getName() == name)
return std::optional<size_t>{i};
}
return std::nullopt;
}
std::vector<ShapeGraphDX> &getShapeGraphs() { return m_shapeGraphs; }
bool hasDisplayedShapeGraph() const { return m_displayedShapegraph.has_value(); }
ShapeGraphDX &getDisplayedShapeGraph() { return m_shapeGraphs[m_displayedShapegraph.value()]; }
const ShapeGraphDX &getDisplayedShapeGraph() const {
return m_shapeGraphs[m_displayedShapegraph.value()];
}
void unsetDisplayedShapeGraphRef() { m_displayedShapegraph = std::nullopt; }
void setDisplayedShapeGraphRef(size_t map) {
if (m_displayedShapegraph.has_value() && m_displayedShapegraph != map)
getDisplayedShapeGraph().clearSel();
m_displayedShapegraph = map;
}
size_t getDisplayedShapeGraphRef() const { return m_displayedShapegraph.value(); }
void removeShapeGraph(size_t i) {
if (m_displayedShapegraph.has_value()) {
if (m_shapeGraphs.size() == 1)
m_displayedShapegraph = std::nullopt;
else if (m_displayedShapegraph.value() > 0 && m_displayedShapegraph.value() >= i)
m_displayedShapegraph.value()--;
}
m_shapeGraphs.erase(std::next(m_shapeGraphs.begin(), static_cast<int>(i)));
}
std::vector<ShapeMapDX> &getDataMaps() { return m_dataMaps; }
//
int getDisplayedMapType();
AttributeTable &getDisplayedMapAttributes();
bool hasVisibleDrawingLayers();
QtRegion getBoundingBox() const;
//
int getDisplayedAttribute() const;
void setDisplayedAttribute(int col);
std::optional<size_t> addAttribute(const std::string &name);
void removeAttribute(size_t col);
bool isAttributeLocked(size_t col);
AttributeTable &getAttributeTable(std::optional<size_t> type = std::nullopt,
std::optional<size_t> layer = std::nullopt);
const AttributeTable &getAttributeTable(std::optional<size_t> type = std::nullopt,
std::optional<size_t> layer = std::nullopt) const;
int getLineFileCount() const { return (int)m_drawingFiles.size(); }
const std::string &getLineFileName(size_t fileIdx) const {
return m_drawingFiles[fileIdx].groupData.getName();
}
size_t getLineLayerCount(size_t fileIdx) const { return m_drawingFiles[fileIdx].maps.size(); }
ShapeMapDX &getLineLayer(size_t fileIdx, size_t layerIdx) {
return m_drawingFiles[fileIdx].maps[layerIdx];
}
const ShapeMapDX &getLineLayer(size_t fileIdx, size_t layerIdx) const {
return m_drawingFiles[fileIdx].maps[layerIdx];
}
int getViewClass() { return m_viewClass; }
// These functions make specifying conditions to do things much easier:
bool viewingNone() { return (m_viewClass == VIEWNONE); }
bool viewingProcessed() {
return ((m_viewClass & (VIEWAXIAL | VIEWDATA)) ||
(m_viewClass & VIEWVGA && getDisplayedPointMap().getInternalMap().isProcessed()));
}
bool viewingShapes() { return (m_viewClass & (VIEWAXIAL | VIEWDATA)) != 0; }
bool viewingProcessedLines() { return ((m_viewClass & VIEWAXIAL) == VIEWAXIAL); }
bool viewingProcessedShapes() { return ((m_viewClass & VIEWDATA) == VIEWDATA); }
bool viewingProcessedPoints() {
return ((m_viewClass & VIEWVGA) && getDisplayedPointMap().getInternalMap().isProcessed());
}
bool viewingUnprocessedPoints() {
return ((m_viewClass & VIEWVGA) && !getDisplayedPointMap().getInternalMap().isProcessed());
}
//
bool setViewClass(int command);
//
double getLocationValue(const Point2f &point);
//
public:
// these are dependent on what the view class is:
bool isSelected() // does a selection exist
{
if (m_viewClass & VIEWVGA)
return getDisplayedPointMap().isSelected();
else if (m_viewClass & VIEWAXIAL)
return getDisplayedShapeGraph().hasSelectedElements();
else if (m_viewClass & VIEWDATA)
return getDisplayedDataMap().hasSelectedElements();
else
return false;
}
bool setCurSel(QtRegion &r, bool add = false) // set current selection
{
if (m_viewClass & VIEWAXIAL)
return getDisplayedShapeGraph().setCurSel(r, add);
else if (m_viewClass & VIEWDATA)
return getDisplayedDataMap().setCurSel(r, add);
else if (m_viewClass & VIEWVGA)
return getDisplayedPointMap().setCurSel(r, add);
else if (m_state & POINTMAPS && !getDisplayedPointMap()
.getInternalMap()
.isProcessed()) // this is a default select application
return getDisplayedPointMap().setCurSel(r, add);
else if (m_state & DATAMAPS) // I'm not sure why this is a possibility, but it appears
// you might have state & DATAMAPS without VIEWDATA...
return getDisplayedDataMap().setCurSel(r, add);
else
return false;
}
bool clearSel() {
// really needs a separate clearSel for the datalayers... at the moment this is handled
// in PointMap
if (m_viewClass & VIEWVGA)
return getDisplayedPointMap().clearSel();
else if (m_viewClass & VIEWAXIAL)
return getDisplayedShapeGraph().clearSel();
else if (m_viewClass & VIEWDATA)
return getDisplayedDataMap().clearSel();
else
return false;
}
int getSelCount() {
if (m_viewClass & VIEWVGA)
return getDisplayedPointMap().getSelCount();
else if (m_viewClass & VIEWAXIAL)
return (int)getDisplayedShapeGraph().getSelCount();
else if (m_viewClass & VIEWDATA)
return (int)getDisplayedDataMap().getSelCount();
else
return 0;
}
float getSelAvg() {
if (m_viewClass & VIEWVGA)
return (float)getDisplayedPointMap().getDisplayedSelectedAvg();
else if (m_viewClass & VIEWAXIAL)
return (float)getDisplayedShapeGraph().getDisplayedSelectedAvg();
else if (m_viewClass & VIEWDATA)
return (float)getDisplayedDataMap().getDisplayedSelectedAvg();
else
return -1.0f;
}
QtRegion getSelBounds() {
if (m_viewClass & VIEWVGA)
return getDisplayedPointMap().getSelBounds();
else if (m_viewClass & VIEWAXIAL)
return getDisplayedShapeGraph().getSelBounds();
else if (m_viewClass & VIEWDATA)
return getDisplayedDataMap().getSelBounds();
else
return QtRegion();
}
// setSelSet expects a set of ref ids:
void setSelSet(const std::vector<int> &selset, bool add = false) {
if (m_viewClass & VIEWVGA && m_state & POINTMAPS)
getDisplayedPointMap().setCurSel(selset, add);
else if (m_viewClass & VIEWAXIAL)
getDisplayedShapeGraph().setCurSel(selset, add);
else // if (m_viewClass & VIEWDATA)
getDisplayedDataMap().setCurSel(selset, add);
}
std::set<int> &getSelSet() {
if (m_viewClass & VIEWVGA && m_state & POINTMAPS)
return getDisplayedPointMap().getSelSet();
else if (m_viewClass & VIEWAXIAL)
return getDisplayedShapeGraph().getSelSet();
else // if (m_viewClass & VIEWDATA)
return getDisplayedDataMap().getSelSet();
}
const std::set<int> &getSelSet() const {
if (m_viewClass & VIEWVGA && m_state & POINTMAPS)
return getDisplayedPointMap().getSelSet();
else if (m_viewClass & VIEWAXIAL)
return getDisplayedShapeGraph().getSelSet();
else // if (m_viewClass & VIEWDATA)
return getDisplayedDataMap().getSelSet();
}
public:
void runAgentEngine(Communicator *comm, std::unique_ptr<IAnalysis> &analysis);
// thru vision
bool analyseThruVision(Communicator *comm = nullptr,
std::optional<size_t> gatelayer = std::nullopt);
public: // BSP tree for making isovists
bool makeBSPtree(BSPNodeTree &bspNodeTree, Communicator *communicator = nullptr);
void resetBSPtree() { m_bspNodeTree.resetBSPtree(); }
// returns 0: fail, 1: made isovist, 2: made isovist and added new shapemap layer
int makeIsovist(Communicator *communicator, const Point2f &p, double startangle = 0,
double endangle = 0, bool = true);
// returns 0: fail, 1: made isovist, 2: made isovist and added new shapemap layer
int makeIsovistPath(Communicator *communicator, double fovAngle = 2.0 * M_PI, bool = true);
bool makeIsovist(const Point2f &p, Isovist &iso);
protected:
// properties
public:
// likely to use communicator if too slow...
MetaGraphReadWrite::ReadStatus readFromFile(const std::string &filename);
MetaGraphReadWrite::ReadStatus readFromStream(std::istream &stream, const std::string &);
MetaGraphReadWrite::ReadStatus write(const std::string &filename, int version,
bool currentlayer = false, bool ignoreDisplayData = false);
std::vector<SimpleLine> getVisibleDrawingLines();
protected:
std::streampos skipVirtualMem(std::istream &stream);
};