add ViewProviders & Tree icons for Part Point, Ellipse, & Helix

Add ViewProviders to select an icon for the part primitives
Point, Ellipse, Helix,
Also return Part Box tree icon to "Tree_Part.svg"
This commit is contained in:
jmaustpc 2013-03-10 00:26:18 +11:00 committed by Yorik van Havre
parent 7e3807ab49
commit 85bcb92856
10 changed files with 442 additions and 1 deletions

View File

@ -67,6 +67,10 @@ public:
App::DocumentObjectExecReturn *execute(void);
short mustExecute() const;
void onChanged(const App::Property*);
/// returns the type name of the ViewProvider
const char* getViewProviderName(void) const {
return "PartGui::ViewProviderPointParametric";
}
//@}
};
@ -238,6 +242,10 @@ public:
/// recalculate the feature
App::DocumentObjectExecReturn *execute(void);
short mustExecute() const;
/// returns the type name of the ViewProvider
const char* getViewProviderName(void) const {
return "PartGui::ViewProviderHelixParametric";
}
//@}
protected:
@ -295,6 +303,10 @@ public:
App::DocumentObjectExecReturn *execute(void);
short mustExecute() const;
void onChanged(const App::Property*);
/// returns the type name of the ViewProvider
const char* getViewProviderName(void) const {
return "PartGui::ViewProviderEllipseParametric";
}
//@}
private:

View File

@ -38,6 +38,9 @@
#include "ViewProviderBoolean.h"
#include "ViewProviderCircleParametric.h"
#include "ViewProviderLineParametric.h"
#include "ViewProviderPointParametric.h"
#include "ViewProviderEllipseParametric.h"
#include "ViewProviderHelixParametric.h"
#include "DlgSettingsGeneral.h"
#include "DlgSettings3DViewPartImp.h"
@ -116,6 +119,9 @@ void PartGuiExport initPartGui()
PartGui::ViewProviderMultiCommon ::init();
PartGui::ViewProviderCircleParametric ::init();
PartGui::ViewProviderLineParametric ::init();
PartGui::ViewProviderPointParametric ::init();
PartGui::ViewProviderEllipseParametric ::init();
PartGui::ViewProviderHelixParametric ::init();
PartGui::Workbench ::init();

View File

@ -140,6 +140,12 @@ SET(PartGui_SRCS
ViewProviderCircleParametric.h
ViewProviderLineParametric.cpp
ViewProviderLineParametric.h
ViewProviderPointParametric.cpp
ViewProviderPointParametric.h
ViewProviderEllipseParametric.cpp
ViewProviderEllipseParametric.h
ViewProviderHelixParametric.cpp
ViewProviderHelixParametric.h
ViewProviderCurveNet.cpp
ViewProviderCurveNet.h
ViewProviderImport.cpp

View File

@ -48,7 +48,7 @@ PROPERTY_SOURCE(PartGui::ViewProviderBox, PartGui::ViewProviderPart)
ViewProviderBox::ViewProviderBox()
{
sPixmap = "Part_Box.svg";
sPixmap = "Tree_Part.svg";
}
ViewProviderBox::~ViewProviderBox()

View File

@ -0,0 +1,75 @@
/***************************************************************************
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
* *
* 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 *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#endif
/// Here the FreeCAD includes sorted by Base,App,Gui......
#include <Base/Parameter.h>
#include "ViewProviderEllipseParametric.h"
//#include "Tree.h"
using namespace PartGui;
using namespace std;
//**************************************************************************
// Construction/Destruction
PROPERTY_SOURCE(PartGui::ViewProviderEllipseParametric, PartGui::ViewProviderPart)
ViewProviderEllipseParametric::ViewProviderEllipseParametric()
{
sPixmap = "Part_Ellipse_Parametric.svg";
}
ViewProviderEllipseParametric::~ViewProviderEllipseParametric()
{
}
// **********************************************************************************
std::vector<std::string> ViewProviderEllipseParametric::getDisplayModes(void) const
{
// get the modes of the father
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
return StrList;
}

View File

@ -0,0 +1,64 @@
/***************************************************************************
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
* *
* 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_VIEWPROVIDERELLIPSEPARAMETRIC_H
#define PARTGUI_VIEWPROVIDERELLIPSEPARAMETRIC_H
#include "ViewProvider.h"
class TopoDS_Shape;
class TopoDS_Face;
class SoSeparator;
class SbVec3f;
class SoTransform;
namespace Gui {
class View3DInventorViewer;
class SoFCSelection;
}
namespace PartGui {
class PartGuiExport ViewProviderEllipseParametric:public ViewProviderPart
{
PROPERTY_HEADER(PartGui::ViewProviderEllipseParametric);
public:
/// constructor
ViewProviderEllipseParametric();
/// destructor
virtual ~ViewProviderEllipseParametric();
std::vector<std::string> getDisplayModes(void) const;
protected:
};
} // namespace PartGui
#endif // PARTGUI_VIEWPROVIDERELLIPSEPARAMETRIC_H

View File

@ -0,0 +1,75 @@
/***************************************************************************
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
* *
* 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 *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#endif
/// Here the FreeCAD includes sorted by Base,App,Gui......
#include <Base/Parameter.h>
#include "ViewProviderHelixParametric.h"
//#include "Tree.h"
using namespace PartGui;
using namespace std;
//**************************************************************************
// Construction/Destruction
PROPERTY_SOURCE(PartGui::ViewProviderHelixParametric, PartGui::ViewProviderPart)
ViewProviderHelixParametric::ViewProviderHelixParametric()
{
sPixmap = "Part_Helix_Parametric.svg";
}
ViewProviderHelixParametric::~ViewProviderHelixParametric()
{
}
// **********************************************************************************
std::vector<std::string> ViewProviderHelixParametric::getDisplayModes(void) const
{
// get the modes of the father
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
return StrList;
}

View File

@ -0,0 +1,64 @@
/***************************************************************************
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
* *
* 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_VIEWPROVIDERHELIXPARAMETRIC_H
#define PARTGUI_VIEWPROVIDERHELIXPARAMETRIC_H
#include "ViewProvider.h"
class TopoDS_Shape;
class TopoDS_Face;
class SoSeparator;
class SbVec3f;
class SoTransform;
namespace Gui {
class View3DInventorViewer;
class SoFCSelection;
}
namespace PartGui {
class PartGuiExport ViewProviderHelixParametric:public ViewProviderPart
{
PROPERTY_HEADER(PartGui::ViewProviderHelixParametric);
public:
/// constructor
ViewProviderHelixParametric();
/// destructor
virtual ~ViewProviderHelixParametric();
std::vector<std::string> getDisplayModes(void) const;
protected:
};
} // namespace PartGui
#endif // PARTGUI_VIEWPROVIDERHELIXPARAMETRIC_H

View File

@ -0,0 +1,75 @@
/***************************************************************************
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
* *
* 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 *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#endif
/// Here the FreeCAD includes sorted by Base,App,Gui......
#include <Base/Parameter.h>
#include "ViewProviderPointParametric.h"
//#include "Tree.h"
using namespace PartGui;
using namespace std;
//**************************************************************************
// Construction/Destruction
PROPERTY_SOURCE(PartGui::ViewProviderPointParametric, PartGui::ViewProviderPart)
ViewProviderPointParametric::ViewProviderPointParametric()
{
sPixmap = "Part_Point_Parametric.svg";
}
ViewProviderPointParametric::~ViewProviderPointParametric()
{
}
// **********************************************************************************
std::vector<std::string> ViewProviderPointParametric::getDisplayModes(void) const
{
// get the modes of the father
std::vector<std::string> StrList;
// add your own modes
StrList.push_back("Flat Lines");
StrList.push_back("Shaded");
StrList.push_back("Wireframe");
StrList.push_back("Points");
return StrList;
}

View File

@ -0,0 +1,64 @@
/***************************************************************************
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
* *
* 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_VIEWPROVIDERPOINTPARAMETRIC_H
#define PARTGUI_VIEWPROVIDERPOINTPARAMETRIC_H
#include "ViewProvider.h"
class TopoDS_Shape;
class TopoDS_Face;
class SoSeparator;
class SbVec3f;
class SoTransform;
namespace Gui {
class View3DInventorViewer;
class SoFCSelection;
}
namespace PartGui {
class PartGuiExport ViewProviderPointParametric:public ViewProviderPart
{
PROPERTY_HEADER(PartGui::ViewProviderPointParametric);
public:
/// constructor
ViewProviderPointParametric();
/// destructor
virtual ~ViewProviderPointParametric();
std::vector<std::string> getDisplayModes(void) const;
protected:
};
} // namespace PartGui
#endif // PARTGUI_VIEWPROVIDERPOINTPARAMETRIC_H