23
#include "PreCompiled.h"
25
#include <Inventor/manips/SoTransformerManip.h>
26
#include <Inventor/nodes/SoDrawStyle.h>
27
#include <Inventor/nodes/SoMaterial.h>
28
#include <Inventor/nodes/SoNormalBinding.h>
29
#include <Inventor/nodes/SoSeparator.h>
32
#include <Gui/SoFCSelection.h>
33
#include <Mod/Mesh/App/MeshFeature.h>
35
#include "ViewProviderTransform.h"
38
using namespace MeshGui;
41
PROPERTY_SOURCE(MeshGui::ViewProviderMeshTransform, MeshGui::ViewProviderMesh)
43
ViewProviderMeshTransform::ViewProviderMeshTransform()
46
pcTransformerDragger = new SoTransformerManip();
47
pcTransformerDragger->ref();
51
ViewProviderMeshTransform::~ViewProviderMeshTransform()
53
pcTransformerDragger->unref();
56
void ViewProviderMeshTransform::attach(App::DocumentObject* pcFeat)
59
ViewProviderMesh::attach(pcFeat);
61
SoSeparator* pcEditRoot = new SoSeparator();
64
SoDrawStyle* pcFlatStyle = new SoDrawStyle();
65
pcFlatStyle->style = SoDrawStyle::FILLED;
66
SoNormalBinding* pcBinding = new SoNormalBinding();
67
pcBinding->value = SoNormalBinding::PER_FACE;
69
pcEditRoot->addChild(pcTransformerDragger);
70
pcEditRoot->addChild(pcFlatStyle);
71
pcEditRoot->addChild(pcShapeMaterial);
72
pcEditRoot->addChild(pcBinding);
73
pcEditRoot->addChild(pcHighlight);
76
addDisplayMaskMode(pcEditRoot, "Edit");
79
void ViewProviderMeshTransform::updateData(const App::Property* prop)
81
ViewProviderMesh::updateData(prop);
84
void ViewProviderMeshTransform::setDisplayMode(const char* ModeName)
86
if (strcmp("Transform", ModeName) == 0) {
87
setDisplayMaskMode("Edit");
89
ViewProviderMesh::setDisplayMode(ModeName);
92
const char* ViewProviderMeshTransform::getDefaultDisplayMode() const
97
std::vector<std::string> ViewProviderMeshTransform::getDisplayModes() const
99
std::vector<std::string> StrList = ViewProviderMesh::getDisplayModes();
100
StrList.emplace_back("Transform");