1 /*
2  Copyright (C) 2010-2014 Kristian Duske
3 
4  This file is part of TrenchBroom.
5 
6  TrenchBroom is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  TrenchBroom is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with TrenchBroom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #include "MapViewContainer.h"
21 
22 #include "View/MapViewBase.h"
23 
24 namespace TrenchBroom {
25     namespace View {
MapViewContainer(wxWindow * parent)26         MapViewContainer::MapViewContainer(wxWindow* parent) :
27         wxPanel(parent),
28         MapView() {}
29 
~MapViewContainer()30         MapViewContainer::~MapViewContainer() {}
31 
canMaximizeCurrentView() const32         bool MapViewContainer::canMaximizeCurrentView() const {
33             return doCanMaximizeCurrentView();
34         }
35 
currentViewMaximized() const36         bool MapViewContainer::currentViewMaximized() const {
37             return doCurrentViewMaximized();
38         }
39 
toggleMaximizeCurrentView()40         void MapViewContainer::toggleMaximizeCurrentView() {
41             doToggleMaximizeCurrentView();
42         }
43 
doCanFlipObjects() const44         bool MapViewContainer::doCanFlipObjects() const {
45             MapView* current = currentMapView();
46             if (current == NULL)
47                 return false;
48             return current->canFlipObjects();
49         }
50 
doFlipObjects(const Math::Direction direction)51         void MapViewContainer::doFlipObjects(const Math::Direction direction) {
52             MapView* current = currentMapView();
53             assert(current != NULL);
54             current->flipObjects(direction);
55         }
56 
doGetPasteObjectsDelta(const BBox3 & bounds,const BBox3 & referenceBounds) const57         Vec3 MapViewContainer::doGetPasteObjectsDelta(const BBox3& bounds, const BBox3& referenceBounds) const {
58             MapView* current = currentMapView();
59             assert(current != NULL);
60             return current->pasteObjectsDelta(bounds, referenceBounds);
61         }
62 
currentMapView() const63         MapView* MapViewContainer::currentMapView() const {
64             return doGetCurrentMapView();
65         }
66     }
67 }
68