Merge branch 'refs/heads/jriegel/develop-fem'

This commit is contained in:
jriegel
2013-06-27 16:47:40 +02:00
90 changed files with 20127 additions and 822 deletions

View File

@@ -93,6 +93,7 @@
#include "MeasureDistance.h"
#include "Placement.h"
#include "Plane.h"
#include "MaterialObject.h"
// If you stumble here, run the target "BuildExtractRevision" on Windows systems
// or the Python script "SubWCRev.py" on Linux based systems which builds
@@ -1047,6 +1048,8 @@ void Application::initTypes(void)
App ::Annotation ::init();
App ::AnnotationLabel ::init();
App ::MeasureDistance ::init();
App ::MaterialObject ::init();
App ::MaterialObjectPython ::init();
App ::Placement ::init();
App ::Plane ::init();
}

View File

@@ -77,6 +77,7 @@ SET(Document_CPP_SRCS
Plane.cpp
Transactions.cpp
VRMLObject.cpp
MaterialObject.cpp
)
SET(Document_HPP_SRCS
@@ -98,6 +99,7 @@ SET(Document_HPP_SRCS
Plane.h
Transactions.h
VRMLObject.h
MaterialObject.h
)
SET(Document_SRCS
${Document_CPP_SRCS}

View File

@@ -0,0 +1,66 @@
/***************************************************************************
* Copyright (c) 2013 Jürgen 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 *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#endif
#include "MaterialObject.h"
#include "DocumentObjectPy.h"
using namespace App;
PROPERTY_SOURCE(App::MaterialObject, App::DocumentObject)
MaterialObject::MaterialObject()
{
ADD_PROPERTY_TYPE(Material,(),"Material",Prop_None,"Material key/valu map");
}
MaterialObject::~MaterialObject()
{
}
// Python feature ---------------------------------------------------------
namespace App {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(App::MaterialObjectPython, App::MaterialObject)
template<> const char* App::MaterialObjectPython::getViewProviderName(void) const {
return "Gui::ViewProviderMaterialObjectPython";
}
template<> PyObject* App::MaterialObjectPython::getPyObject(void) {
if (PythonObject.is(Py::_None())) {
// ref counter is set to 1
PythonObject = Py::Object(new App::DocumentObjectPy(this),true);
}
return Py::new_reference_to(PythonObject);
}
/// @endcond
// explicit template instantiation
template class AppExport FeaturePythonT<App::MaterialObject>;
}

60
src/App/MaterialObject.h Normal file
View File

@@ -0,0 +1,60 @@
/***************************************************************************
* Copyright (c) 2013 Jürgen 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 APP_MaterialObject_H
#define APP_MaterialObject_H
#include "DocumentObject.h"
#include "PropertyStandard.h"
#include "FeaturePython.h"
namespace App
{
class AppExport MaterialObject : public DocumentObject
{
PROPERTY_HEADER(App::MaterialObject);
public:
/// Constructor
MaterialObject(void);
virtual ~MaterialObject();
App::PropertyMap Material;
/// returns the type name of the ViewProvider
const char* getViewProviderName(void) const {
return "Gui::ViewProviderMaterialObject";
}
};
typedef App::FeaturePythonT<MaterialObject> MaterialObjectPython;
} //namespace App
#endif // APP_MaterialObject_H