Files
create/src/Mod/PartDesign/Gui/ViewProvider.h
Stefan Tröger 48b2bb86ab PartDesign: body is responsible for visuals
-Hide all visual properties of features when they are part of a body
-Propagate all body visual changes to features
-Separate display mode from body mode to enable setting display mode for both "tip" and "through" modes
-Use default visuals for body shape and only make "through" a new display mask mode for the children
2016-04-12 18:12:23 +02:00

78 lines
3.0 KiB
C++

/***************************************************************************
* Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef PARTGUI_ViewProvider_H
#define PARTGUI_ViewProvider_H
#include <Mod/Part/Gui/ViewProvider.h>
namespace PartDesignGui {
class TaskDlgFeatureParameters;
/**
* A common base class for all part design features view providers
*/
class PartDesignGuiExport ViewProvider : public PartGui::ViewProviderPart {
typedef PartGui::ViewProviderPart inherited;
PROPERTY_HEADER(PartDesignGui::ViewProvider);
public:
/// constructor
ViewProvider();
/// destructor
virtual ~ViewProvider();
virtual bool doubleClicked(void);
void updateData(const App::Property*);
void onChanged(const App::Property* prop);
//body mode means that the object is part of a body and that the body is used to set the
//visual properties, not the features. Hence setting body mode to true will hide most
//viewprovider properties.
void setBodyMode(bool bodymode);
protected:
virtual bool setEdit(int ModNum);
virtual void unsetEdit(int ModNum);
virtual bool onDelete(const std::vector<std::string> &);
/**
* Returns a newly create dialog for the part to be placed in the task view
* Must be reimplemented in subclasses.
*/
virtual TaskDlgFeatureParameters *getEditDialog();
std::string oldWb;
App::DocumentObject* oldTip;
};
} // namespace PartDesignGui
#endif // PARTGUI_ViewProviderHole_H