23
#include "PreCompiled.h"
25
#include <App/DocumentObject.h>
26
#include <Mod/Drawing/App/FeatureClip.h>
27
#include <Mod/Drawing/App/FeatureView.h>
29
#include "ViewProviderView.h"
32
using namespace DrawingGui;
34
PROPERTY_SOURCE(DrawingGui::ViewProviderDrawingView, Gui::ViewProviderDocumentObject)
36
ViewProviderDrawingView::ViewProviderDrawingView()
41
DisplayMode.setStatus(App::Property::Hidden, true);
44
ViewProviderDrawingView::~ViewProviderDrawingView()
47
void ViewProviderDrawingView::attach(App::DocumentObject* pcFeat)
50
ViewProviderDocumentObject::attach(pcFeat);
53
void ViewProviderDrawingView::setDisplayMode(const char* ModeName)
55
ViewProviderDocumentObject::setDisplayMode(ModeName);
58
std::vector<std::string> ViewProviderDrawingView::getDisplayModes(void) const
60
std::vector<std::string> StrList = ViewProviderDocumentObject::getDisplayModes();
64
void ViewProviderDrawingView::show(void)
66
ViewProviderDocumentObject::show();
68
App::DocumentObject* obj = getObject();
69
if (!obj || obj->isRestoring()) {
72
if (obj->isDerivedFrom<Drawing::FeatureView>()) {
75
static_cast<Drawing::FeatureView*>(obj)->Visible.setValue(true);
76
std::vector<App::DocumentObject*> inp = obj->getInList();
77
for (std::vector<App::DocumentObject*>::iterator it = inp.begin(); it != inp.end(); ++it) {
83
void ViewProviderDrawingView::hide(void)
85
ViewProviderDocumentObject::hide();
87
App::DocumentObject* obj = getObject();
88
if (!obj || obj->isRestoring()) {
91
if (obj->isDerivedFrom<Drawing::FeatureView>()) {
94
static_cast<Drawing::FeatureView*>(obj)->Visible.setValue(false);
95
std::vector<App::DocumentObject*> inp = obj->getInList();
96
for (std::vector<App::DocumentObject*>::iterator it = inp.begin(); it != inp.end(); ++it) {
102
bool ViewProviderDrawingView::isShow(void) const
104
return Visibility.getValue();
107
void ViewProviderDrawingView::startRestoring()
112
void ViewProviderDrawingView::finishRestoring()
117
void ViewProviderDrawingView::updateData(const App::Property*)
125
PROPERTY_SOURCE_TEMPLATE(DrawingGui::ViewProviderDrawingViewPython,
126
DrawingGui::ViewProviderDrawingView)
130
template class DrawingGuiExport ViewProviderPythonFeatureT<DrawingGui::ViewProviderDrawingView>;
136
PROPERTY_SOURCE(DrawingGui::ViewProviderDrawingClip, Gui::ViewProviderDocumentObjectGroup)
138
ViewProviderDrawingClip::ViewProviderDrawingClip()
143
DisplayMode.setStatus(App::Property::Hidden, true);
146
ViewProviderDrawingClip::~ViewProviderDrawingClip()
149
void ViewProviderDrawingClip::attach(App::DocumentObject* pcFeat)
152
ViewProviderDocumentObject::attach(pcFeat);
155
void ViewProviderDrawingClip::setDisplayMode(const char* ModeName)
157
ViewProviderDocumentObject::setDisplayMode(ModeName);
160
std::vector<std::string> ViewProviderDrawingClip::getDisplayModes(void) const
163
std::vector<std::string> StrList;
167
void ViewProviderDrawingClip::show(void)
169
ViewProviderDocumentObjectGroup::show();
171
App::DocumentObject* obj = getObject();
172
if (!obj || obj->isRestoring()) {
175
if (obj->isDerivedFrom<Drawing::FeatureClip>()) {
178
static_cast<Drawing::FeatureClip*>(obj)->Visible.setValue(true);
179
std::vector<App::DocumentObject*> inp = obj->getInList();
180
for (std::vector<App::DocumentObject*>::iterator it = inp.begin(); it != inp.end(); ++it) {
186
void ViewProviderDrawingClip::hide(void)
188
ViewProviderDocumentObjectGroup::hide();
190
App::DocumentObject* obj = getObject();
191
if (!obj || obj->isRestoring()) {
194
if (obj->isDerivedFrom<Drawing::FeatureClip>()) {
197
static_cast<Drawing::FeatureClip*>(obj)->Visible.setValue(false);
198
std::vector<App::DocumentObject*> inp = obj->getInList();
199
for (std::vector<App::DocumentObject*>::iterator it = inp.begin(); it != inp.end(); ++it) {
205
bool ViewProviderDrawingClip::isShow(void) const
207
return Visibility.getValue();
210
void ViewProviderDrawingClip::startRestoring()
215
void ViewProviderDrawingClip::finishRestoring()
220
void ViewProviderDrawingClip::updateData(const App::Property*)