[FEM] backport some changes to resolve merge conflicts
- manually done
This commit is contained in:
@@ -23,8 +23,6 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
# include <Python.h>
|
||||
# include <vtkFieldData.h>
|
||||
# include <vtkPointData.h>
|
||||
#endif
|
||||
|
||||
@@ -32,7 +30,6 @@
|
||||
|
||||
#include "FemPostFilter.h"
|
||||
#include "FemPostPipeline.h"
|
||||
#include <App/DocumentObjectPy.h>
|
||||
|
||||
|
||||
using namespace Fem;
|
||||
@@ -66,7 +63,7 @@ void FemPostFilter::setActiveFilterPipeline(std::string name) {
|
||||
}
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostFilter::execute(void) {
|
||||
DocumentObjectExecReturn* FemPostFilter::execute() {
|
||||
|
||||
if (!m_pipelines.empty() && !m_activePipeline.empty()) {
|
||||
FemPostFilter::FilterPipeline& pipe = m_pipelines[m_activePipeline];
|
||||
@@ -115,7 +112,7 @@ vtkDataObject* FemPostFilter::getInputData() {
|
||||
// clip filter
|
||||
PROPERTY_SOURCE(Fem::FemPostClipFilter, Fem::FemPostFilter)
|
||||
|
||||
FemPostClipFilter::FemPostClipFilter(void) : FemPostFilter() {
|
||||
FemPostClipFilter::FemPostClipFilter() : FemPostFilter() {
|
||||
|
||||
ADD_PROPERTY_TYPE(Function, (nullptr), "Clip", App::Prop_None, "The function object which defines the clip regions");
|
||||
ADD_PROPERTY_TYPE(InsideOut, (false), "Clip", App::Prop_None, "Invert the clip direction");
|
||||
@@ -166,7 +163,7 @@ void FemPostClipFilter::onChanged(const Property* prop) {
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostClipFilter::mustExecute(void) const {
|
||||
short int FemPostClipFilter::mustExecute() const {
|
||||
|
||||
if (Function.isTouched() ||
|
||||
InsideOut.isTouched() ||
|
||||
@@ -177,7 +174,7 @@ short int FemPostClipFilter::mustExecute(void) const {
|
||||
else return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostClipFilter::execute(void) {
|
||||
DocumentObjectExecReturn* FemPostClipFilter::execute() {
|
||||
|
||||
if (!m_extractor->GetImplicitFunction())
|
||||
return StdReturn;
|
||||
@@ -190,7 +187,7 @@ DocumentObjectExecReturn* FemPostClipFilter::execute(void) {
|
||||
// data along a line
|
||||
PROPERTY_SOURCE(Fem::FemPostDataAlongLineFilter, Fem::FemPostFilter)
|
||||
|
||||
FemPostDataAlongLineFilter::FemPostDataAlongLineFilter(void) : FemPostFilter() {
|
||||
FemPostDataAlongLineFilter::FemPostDataAlongLineFilter() : FemPostFilter() {
|
||||
|
||||
ADD_PROPERTY_TYPE(Point1, (Base::Vector3d(0.0, 0.0, 0.0)), "DataAlongLine", App::Prop_None, "The point 1 used to define end point of line");
|
||||
ADD_PROPERTY_TYPE(Point2, (Base::Vector3d(0.0, 0.0, 1.0)), "DataAlongLine", App::Prop_None, "The point 2 used to define end point of line");
|
||||
@@ -235,7 +232,7 @@ FemPostDataAlongLineFilter::~FemPostDataAlongLineFilter() {
|
||||
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostDataAlongLineFilter::execute(void) {
|
||||
DocumentObjectExecReturn* FemPostDataAlongLineFilter::execute() {
|
||||
|
||||
//recalculate the filter
|
||||
return Fem::FemPostFilter::execute();
|
||||
@@ -277,7 +274,7 @@ void FemPostDataAlongLineFilter::onChanged(const Property* prop) {
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostDataAlongLineFilter::mustExecute(void) const {
|
||||
short int FemPostDataAlongLineFilter::mustExecute() const {
|
||||
|
||||
if (Point1.isTouched() ||
|
||||
Point2.isTouched() ||
|
||||
@@ -337,7 +334,7 @@ void FemPostDataAlongLineFilter::GetAxisData() {
|
||||
// data point filter
|
||||
PROPERTY_SOURCE(Fem::FemPostDataAtPointFilter, Fem::FemPostFilter)
|
||||
|
||||
FemPostDataAtPointFilter::FemPostDataAtPointFilter(void) : FemPostFilter() {
|
||||
FemPostDataAtPointFilter::FemPostDataAtPointFilter() : FemPostFilter() {
|
||||
|
||||
ADD_PROPERTY_TYPE(Center, (Base::Vector3d(0.0, 0.0, 0.0)), "DataAtPoint", App::Prop_None, "Center of the point");
|
||||
ADD_PROPERTY_TYPE(Radius, (0), "DataAtPoint", App::Prop_None, "Radius around the point (unused)");
|
||||
@@ -378,7 +375,7 @@ FemPostDataAtPointFilter::~FemPostDataAtPointFilter() {
|
||||
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostDataAtPointFilter::execute(void) {
|
||||
DocumentObjectExecReturn* FemPostDataAtPointFilter::execute() {
|
||||
|
||||
//recalculate the filter
|
||||
return Fem::FemPostFilter::execute();
|
||||
@@ -393,7 +390,7 @@ void FemPostDataAtPointFilter::onChanged(const Property* prop) {
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostDataAtPointFilter::mustExecute(void) const {
|
||||
short int FemPostDataAtPointFilter::mustExecute() const {
|
||||
|
||||
if (Center.isTouched())
|
||||
return 1;
|
||||
@@ -436,7 +433,7 @@ void FemPostDataAtPointFilter::GetPointData() {
|
||||
// scalar clip filter
|
||||
PROPERTY_SOURCE(Fem::FemPostScalarClipFilter, Fem::FemPostFilter)
|
||||
|
||||
FemPostScalarClipFilter::FemPostScalarClipFilter(void) : FemPostFilter() {
|
||||
FemPostScalarClipFilter::FemPostScalarClipFilter() : FemPostFilter() {
|
||||
|
||||
ADD_PROPERTY_TYPE(Value, (0), "Clip", App::Prop_None, "The scalar value used to clip the selected field");
|
||||
ADD_PROPERTY_TYPE(Scalars, (long(0)), "Clip", App::Prop_None, "The field used to clip");
|
||||
@@ -456,7 +453,7 @@ FemPostScalarClipFilter::~FemPostScalarClipFilter() {
|
||||
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostScalarClipFilter::execute(void) {
|
||||
DocumentObjectExecReturn* FemPostScalarClipFilter::execute() {
|
||||
|
||||
std::string val;
|
||||
if (Scalars.getValue() >= 0)
|
||||
@@ -509,7 +506,7 @@ void FemPostScalarClipFilter::onChanged(const Property* prop) {
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostScalarClipFilter::mustExecute(void) const {
|
||||
short int FemPostScalarClipFilter::mustExecute() const {
|
||||
|
||||
if (Value.isTouched() ||
|
||||
InsideOut.isTouched() ||
|
||||
@@ -544,7 +541,7 @@ void FemPostScalarClipFilter::setConstraintForField() {
|
||||
// warp vector filter
|
||||
PROPERTY_SOURCE(Fem::FemPostWarpVectorFilter, Fem::FemPostFilter)
|
||||
|
||||
FemPostWarpVectorFilter::FemPostWarpVectorFilter(void) : FemPostFilter() {
|
||||
FemPostWarpVectorFilter::FemPostWarpVectorFilter() : FemPostFilter() {
|
||||
|
||||
ADD_PROPERTY_TYPE(Factor, (0), "Warp", App::Prop_None, "The factor by which the vector is added to the node positions");
|
||||
ADD_PROPERTY_TYPE(Vector, (long(0)), "Warp", App::Prop_None, "The field added to the node position");
|
||||
@@ -561,7 +558,7 @@ FemPostWarpVectorFilter::~FemPostWarpVectorFilter() {
|
||||
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostWarpVectorFilter::execute(void) {
|
||||
DocumentObjectExecReturn* FemPostWarpVectorFilter::execute() {
|
||||
|
||||
std::string val;
|
||||
if (Vector.getValue() >= 0)
|
||||
@@ -608,7 +605,7 @@ void FemPostWarpVectorFilter::onChanged(const Property* prop) {
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostWarpVectorFilter::mustExecute(void) const {
|
||||
short int FemPostWarpVectorFilter::mustExecute() const {
|
||||
|
||||
if (Factor.isTouched() ||
|
||||
Vector.isTouched())
|
||||
@@ -622,7 +619,7 @@ short int FemPostWarpVectorFilter::mustExecute(void) const {
|
||||
// cut filter
|
||||
PROPERTY_SOURCE(Fem::FemPostCutFilter, Fem::FemPostFilter)
|
||||
|
||||
FemPostCutFilter::FemPostCutFilter(void) : FemPostFilter() {
|
||||
FemPostCutFilter::FemPostCutFilter() : FemPostFilter() {
|
||||
|
||||
ADD_PROPERTY_TYPE(Function, (nullptr), "Cut", App::Prop_None, "The function object which defines the clip cut function");
|
||||
|
||||
@@ -650,7 +647,7 @@ void FemPostCutFilter::onChanged(const Property* prop) {
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostCutFilter::mustExecute(void) const {
|
||||
short int FemPostCutFilter::mustExecute() const {
|
||||
|
||||
if (Function.isTouched()) {
|
||||
|
||||
@@ -659,7 +656,7 @@ short int FemPostCutFilter::mustExecute(void) const {
|
||||
else return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostCutFilter::execute(void) {
|
||||
DocumentObjectExecReturn* FemPostCutFilter::execute() {
|
||||
|
||||
if (!m_cutter->GetCutFunction())
|
||||
return StdReturn;
|
||||
|
||||
@@ -34,7 +34,7 @@ using namespace App;
|
||||
|
||||
PROPERTY_SOURCE(Fem::FemPostFunctionProvider, App::DocumentObject)
|
||||
|
||||
FemPostFunctionProvider::FemPostFunctionProvider(void) : DocumentObject() {
|
||||
FemPostFunctionProvider::FemPostFunctionProvider() : DocumentObject() {
|
||||
|
||||
ADD_PROPERTY(Functions, (nullptr));
|
||||
}
|
||||
@@ -58,7 +58,7 @@ FemPostFunction::~FemPostFunction()
|
||||
{
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostFunction::execute(void) {
|
||||
DocumentObjectExecReturn* FemPostFunction::execute() {
|
||||
|
||||
return DocumentObject::StdReturn;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ DocumentObjectExecReturn* FemPostFunction::execute(void) {
|
||||
// plane function
|
||||
PROPERTY_SOURCE(Fem::FemPostPlaneFunction, Fem::FemPostFunction)
|
||||
|
||||
FemPostPlaneFunction::FemPostPlaneFunction(void) : FemPostFunction() {
|
||||
FemPostPlaneFunction::FemPostPlaneFunction() : FemPostFunction() {
|
||||
|
||||
ADD_PROPERTY(Origin, (Base::Vector3d(0.0, 0.0, 0.0)));
|
||||
ADD_PROPERTY(Normal, (Base::Vector3d(0.0, 0.0, 1.0)));
|
||||
@@ -108,7 +108,7 @@ void FemPostPlaneFunction::onDocumentRestored() {
|
||||
// sphere function
|
||||
PROPERTY_SOURCE(Fem::FemPostSphereFunction, Fem::FemPostFunction)
|
||||
|
||||
FemPostSphereFunction::FemPostSphereFunction(void) : FemPostFunction() {
|
||||
FemPostSphereFunction::FemPostSphereFunction() : FemPostFunction() {
|
||||
|
||||
ADD_PROPERTY(Radius, (5));
|
||||
ADD_PROPERTY(Center, (Base::Vector3d(1.0, 0.0, 0.0)));
|
||||
|
||||
@@ -23,16 +23,10 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
# include <Python.h>
|
||||
# include <vtkPointData.h>
|
||||
# include <vtkCellData.h>
|
||||
# include <vtkDataSet.h>
|
||||
#endif
|
||||
|
||||
#include "FemPostObject.h"
|
||||
#include <Base/Console.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <App/DocumentObjectPy.h>
|
||||
|
||||
|
||||
using namespace Fem;
|
||||
|
||||
@@ -23,20 +23,19 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
# include <Python.h>
|
||||
# include <SMESH_Mesh.hxx>
|
||||
# include <vtkAppendFilter.h>
|
||||
# include <vtkDataSetReader.h>
|
||||
# include <vtkGeometryFilter.h>
|
||||
# include <vtkStructuredGrid.h>
|
||||
# include <vtkUnstructuredGrid.h>
|
||||
# include <vtkImageData.h>
|
||||
# include <vtkRectilinearGrid.h>
|
||||
# include <vtkAppendFilter.h>
|
||||
# include <vtkXMLUnstructuredGridReader.h>
|
||||
# include <vtkXMLPolyDataReader.h>
|
||||
# include <vtkXMLStructuredGridReader.h>
|
||||
# include <vtkXMLRectilinearGridReader.h>
|
||||
# include <vtkStructuredGrid.h>
|
||||
# include <vtkUnstructuredGrid.h>
|
||||
# include <vtkXMLImageDataReader.h>
|
||||
# include <vtkXMLPolyDataReader.h>
|
||||
# include <vtkXMLRectilinearGridReader.h>
|
||||
# include <vtkXMLStructuredGridReader.h>
|
||||
# include <vtkXMLPUnstructuredGridReader.h>
|
||||
# include <vtkXMLUnstructuredGridReader.h>
|
||||
#endif
|
||||
|
||||
#include "FemPostPipeline.h"
|
||||
@@ -44,11 +43,10 @@
|
||||
#include "FemMeshObject.h"
|
||||
#include "FemVTKTools.h"
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <App/Document.h>
|
||||
|
||||
#include <App/DocumentObjectPy.h>
|
||||
#include <Mod/Fem/App/FemPostPipelinePy.h>
|
||||
#include <Base/Console.h>
|
||||
|
||||
#include "FemPostPipelinePy.h"
|
||||
|
||||
|
||||
using namespace Fem;
|
||||
@@ -72,7 +70,7 @@ FemPostPipeline::~FemPostPipeline()
|
||||
{
|
||||
}
|
||||
|
||||
short FemPostPipeline::mustExecute(void) const
|
||||
short FemPostPipeline::mustExecute() const
|
||||
{
|
||||
if (Mode.isTouched())
|
||||
return 1;
|
||||
@@ -80,7 +78,7 @@ short FemPostPipeline::mustExecute(void) const
|
||||
return FemPostFilter::mustExecute();
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostPipeline::execute(void) {
|
||||
DocumentObjectExecReturn* FemPostPipeline::execute() {
|
||||
|
||||
//if we are the toplevel pipeline our data object is not created by filters, we are the main source
|
||||
if (!Input.getValue())
|
||||
@@ -199,7 +197,7 @@ void FemPostPipeline::onChanged(const Property* prop)
|
||||
//if we have no input the filters are responsible of grabbing the pipeline data themself
|
||||
else {
|
||||
//the first filter must always grab the data
|
||||
if (filter->Input.getValue() != nullptr)
|
||||
if (filter->Input.getValue())
|
||||
filter->Input.setValue(nullptr);
|
||||
|
||||
//all the others need to be connected to the previous filter or grab the data, dependent on mode
|
||||
@@ -212,7 +210,7 @@ void FemPostPipeline::onChanged(const Property* prop)
|
||||
nextFilter->Input.setValue(filter);
|
||||
}
|
||||
else { //Parallel mode
|
||||
if (nextFilter->Input.getValue() != nullptr)
|
||||
if (nextFilter->Input.getValue())
|
||||
nextFilter->Input.setValue(nullptr);
|
||||
}
|
||||
|
||||
@@ -273,7 +271,7 @@ void FemPostPipeline::load(FemResultObject* res) {
|
||||
Data.setValue(grid);
|
||||
}
|
||||
|
||||
PyObject* FemPostPipeline::getPyObject(void)
|
||||
PyObject* FemPostPipeline::getPyObject()
|
||||
{
|
||||
if (PythonObject.is(Py::_None())) {
|
||||
// ref counter is set to 1
|
||||
|
||||
@@ -20,16 +20,14 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
#endif
|
||||
|
||||
#include "FemResultObject.h"
|
||||
#include <App/FeaturePythonPyImp.h>
|
||||
#include <App/DocumentObjectPy.h>
|
||||
|
||||
#include "FemResultObject.h"
|
||||
|
||||
|
||||
using namespace Fem;
|
||||
using namespace App;
|
||||
|
||||
@@ -38,10 +36,10 @@ PROPERTY_SOURCE(Fem::FemResultObject, App::DocumentObject)
|
||||
|
||||
FemResultObject::FemResultObject()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Mesh,(nullptr), "General",Prop_None,"Link to the corresponding mesh");
|
||||
ADD_PROPERTY_TYPE(NodeNumbers,(0), "NodeData",Prop_None,"Numbers of the result nodes");
|
||||
ADD_PROPERTY_TYPE(Stats,(0), "Data",Prop_None,"Statistics of the results");
|
||||
ADD_PROPERTY_TYPE(Time,(0), "Data",Prop_None,"Time of analysis increment");
|
||||
ADD_PROPERTY_TYPE(Mesh, (nullptr), "General", Prop_None, "Link to the corresponding mesh");
|
||||
ADD_PROPERTY_TYPE(NodeNumbers, (0), "NodeData", Prop_None, "Numbers of the result nodes");
|
||||
ADD_PROPERTY_TYPE(Stats, (0), "Data", Prop_None, "Statistics of the results");
|
||||
ADD_PROPERTY_TYPE(Time, (0), "Data", Prop_None, "Time of analysis increment");
|
||||
|
||||
// make read-only for property editor
|
||||
NodeNumbers.setStatus(App::Property::ReadOnly, true);
|
||||
@@ -53,7 +51,7 @@ FemResultObject::~FemResultObject()
|
||||
{
|
||||
}
|
||||
|
||||
short FemResultObject::mustExecute(void) const
|
||||
short FemResultObject::mustExecute() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -72,12 +70,12 @@ PyObject *FemResultObject::getPyObject()
|
||||
namespace App {
|
||||
/// @cond DOXERR
|
||||
PROPERTY_SOURCE_TEMPLATE(Fem::FemResultObjectPython, Fem::FemResultObject)
|
||||
template<> const char* Fem::FemResultObjectPython::getViewProviderName(void) const {
|
||||
template<> const char* Fem::FemResultObjectPython::getViewProviderName() const {
|
||||
return "FemGui::ViewProviderResultPython";
|
||||
}
|
||||
/// @endcond
|
||||
|
||||
template<> PyObject* Fem::FemResultObjectPython::getPyObject(void) {
|
||||
template<> PyObject* Fem::FemResultObjectPython::getPyObject() {
|
||||
if (PythonObject.is(Py::_None())) {
|
||||
// ref counter is set to 1
|
||||
PythonObject = Py::Object(new App::FeaturePythonPyT<App::DocumentObjectPy>(this),true);
|
||||
|
||||
Reference in New Issue
Block a user