Some fixes in Body visualls (ongoing)

This commit is contained in:
jriegel
2013-01-02 12:31:04 +01:00
committed by Stefan Tröger
parent 96f2a734ae
commit 39d6d914a8
5 changed files with 91 additions and 17 deletions

View File

@@ -41,15 +41,56 @@ ViewProviderBody::ViewProviderBody()
{
pcBodyChildren = new SoGroup();
pcBodyChildren->ref();
pcBodyTip = new SoGroup();
pcBodyTip->ref();
}
ViewProviderBody::~ViewProviderBody()
{
pcBodyChildren->unref();
pcBodyChildren = 0;
pcBodyTip->unref();
pcBodyTip = 0;
}
void ViewProviderBody::attach(App::DocumentObject *pcFeat)
{
// call parent attach method
ViewProviderPart::attach(pcFeat);
// putting all together with the switch
addDisplayMaskMode(pcBodyTip, "Body");
addDisplayMaskMode(pcBodyChildren, "Through");
}
void ViewProviderBody::setDisplayMode(const char* ModeName)
{
if ( strcmp("Body",ModeName)==0 )
setDisplayMaskMode("Body");
if ( strcmp("Main",ModeName)==0 )
setDisplayMaskMode("Main");
if ( strcmp("Through",ModeName)==0 )
setDisplayMaskMode("Through");
ViewProviderGeometryObject::setDisplayMode( ModeName );
}
std::vector<std::string> ViewProviderBody::getDisplayModes(void) const
{
// get the modes of the father
std::vector<std::string> StrList = ViewProviderGeometryObject::getDisplayModes();
// add your own modes
StrList.push_back("Through");
StrList.push_back("Body");
return StrList;
}
bool ViewProviderBody::doubleClicked(void)
{
// assure the PartDesign workbench