worked on 3D viz

scaling, moving by finger
some fixes / improvement
This commit is contained in:
k-a-z-u
2018-02-06 17:35:10 +01:00
parent 076c0e9157
commit bce771d6d6
28 changed files with 547 additions and 155 deletions

View File

@@ -50,17 +50,17 @@ protected:
MapLayerType type;
/** whether this layer is visible */
bool visible;
//bool visible;
public:
/** ctor */
MapLayer(MapLayer* parent) : parent(parent), type(MapLayerType::UNKNOWN), visible(true) {
MapLayer(MapLayer* parent) : parent(parent), type(MapLayerType::UNKNOWN) {
if (parent) {parent->addSublayer(this);} // attach myself as child of my parent
}
/** ctor */
MapLayer(MapLayer* parent, MapLayerType type) : parent(parent), type(type), visible(true) {
MapLayer(MapLayer* parent, MapLayerType type) : parent(parent), type(type) {
if (parent) {parent->addSublayer(this);} // attach myself as child of my parent
}
@@ -104,14 +104,15 @@ public:
void removeSublayer(const MapLayer* layer) { sublayers.erase(std::remove(sublayers.begin(), sublayers.end(), layer), sublayers.end()); }
/** is this layer currently visible? */
bool isVisible() const {return visible;}
// bool isVisible() const {return visible;}
virtual bool isVisible() const = 0;
/** make this layer visible */
virtual void setVisible(const bool visible) {
this->visible = visible;
onVisibilityChanged(visible);
}
// virtual void setVisible(const bool visible) {
// this->visible = visible;
// onVisibilityChanged(visible);
// }
virtual void setVisible(const bool visible) = 0;
/** get all sub-layers within this layer */
const std::vector<MapLayer*>& getSubLayers() const {return sublayers;}
@@ -145,7 +146,7 @@ public:
}
}
private:
protected:
void onElemAdded(MapModelElement* e) {
if (parent) {parent->onElemAdded(e);}
@@ -182,6 +183,14 @@ public:
std::string getLayerName() const override {return "root";}
bool isVisible() const override {
return true;
}
void setVisible(const bool visible) override {
throw "error";
}
};