[FEM] sort code of result filters
- sort the functions alphabetically to know where to scroll to - eases the reading at least a bit - some automatic reformatting according to our current clang file - split too long lines
This commit is contained in:
@@ -46,27 +46,27 @@ FemPostFilter::FemPostFilter()
|
||||
}
|
||||
|
||||
FemPostFilter::~FemPostFilter()
|
||||
{}
|
||||
|
||||
void FemPostFilter::addFilterPipeline(const FemPostFilter::FilterPipeline& p, std::string name)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FemPostFilter::addFilterPipeline(const FemPostFilter::FilterPipeline& p, std::string name) {
|
||||
m_pipelines[name] = p;
|
||||
}
|
||||
|
||||
FemPostFilter::FilterPipeline& FemPostFilter::getFilterPipeline(std::string name) {
|
||||
FemPostFilter::FilterPipeline& FemPostFilter::getFilterPipeline(std::string name)
|
||||
{
|
||||
return m_pipelines[name];
|
||||
}
|
||||
|
||||
void FemPostFilter::setActiveFilterPipeline(std::string name) {
|
||||
|
||||
void FemPostFilter::setActiveFilterPipeline(std::string name)
|
||||
{
|
||||
if (m_activePipeline != name && isValid()) {
|
||||
m_activePipeline = name;
|
||||
}
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostFilter::execute() {
|
||||
|
||||
DocumentObjectExecReturn* FemPostFilter::execute()
|
||||
{
|
||||
if (!m_pipelines.empty() && !m_activePipeline.empty()) {
|
||||
FemPostFilter::FilterPipeline& pipe = m_pipelines[m_activePipeline];
|
||||
vtkSmartPointer<vtkDataObject> data = getInputData();
|
||||
@@ -88,8 +88,8 @@ DocumentObjectExecReturn* FemPostFilter::execute() {
|
||||
return StdReturn;
|
||||
}
|
||||
|
||||
vtkDataObject* FemPostFilter::getInputData() {
|
||||
|
||||
vtkDataObject* FemPostFilter::getInputData()
|
||||
{
|
||||
if (Input.getValue()) {
|
||||
if (Input.getValue()->getTypeId().isDerivedFrom(Base::Type::fromName("Fem::FemPostObject")))
|
||||
return Input.getValue<FemPostObject*>()->Data.getValue();
|
||||
@@ -111,101 +111,18 @@ vtkDataObject* FemPostFilter::getInputData() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// clip filter
|
||||
PROPERTY_SOURCE(Fem::FemPostClipFilter, Fem::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");
|
||||
ADD_PROPERTY_TYPE(
|
||||
CutCells,
|
||||
(false),
|
||||
"Clip",
|
||||
App::Prop_None,
|
||||
"Decides if cells are cut and interpolated or if the cells are kept as a whole");
|
||||
|
||||
FilterPipeline clip;
|
||||
m_clipper = vtkSmartPointer<vtkTableBasedClipDataSet>::New();
|
||||
clip.source = m_clipper;
|
||||
clip.target = m_clipper;
|
||||
addFilterPipeline(clip, "clip");
|
||||
|
||||
FilterPipeline extr;
|
||||
m_extractor = vtkSmartPointer<vtkExtractGeometry>::New();
|
||||
extr.source = m_extractor;
|
||||
extr.target = m_extractor;
|
||||
addFilterPipeline(extr, "extract");
|
||||
|
||||
m_extractor->SetExtractInside(0);
|
||||
setActiveFilterPipeline("extract");
|
||||
}
|
||||
|
||||
FemPostClipFilter::~FemPostClipFilter() {
|
||||
|
||||
}
|
||||
|
||||
void FemPostClipFilter::onChanged(const Property* prop) {
|
||||
|
||||
if (prop == &Function) {
|
||||
|
||||
if (Function.getValue()
|
||||
&& Function.getValue()->isDerivedFrom(FemPostFunction::getClassTypeId())) {
|
||||
m_clipper->SetClipFunction(
|
||||
static_cast<FemPostFunction*>(Function.getValue())->getImplicitFunction());
|
||||
m_extractor->SetImplicitFunction(
|
||||
static_cast<FemPostFunction*>(Function.getValue())->getImplicitFunction());
|
||||
}
|
||||
}
|
||||
else if (prop == &InsideOut) {
|
||||
|
||||
m_clipper->SetInsideOut(InsideOut.getValue());
|
||||
m_extractor->SetExtractInside((InsideOut.getValue()) ? 1 : 0);
|
||||
}
|
||||
else if (prop == &CutCells) {
|
||||
|
||||
if (!CutCells.getValue())
|
||||
setActiveFilterPipeline("extract");
|
||||
else
|
||||
setActiveFilterPipeline("clip");
|
||||
};
|
||||
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostClipFilter::mustExecute() const {
|
||||
|
||||
if (Function.isTouched() ||
|
||||
InsideOut.isTouched() ||
|
||||
CutCells.isTouched()) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostClipFilter::execute() {
|
||||
|
||||
if (!m_extractor->GetImplicitFunction())
|
||||
return StdReturn;
|
||||
|
||||
return Fem::FemPostFilter::execute();
|
||||
}
|
||||
// in the following, the different filters sorted alphabetically
|
||||
// ***************************************************************************
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// data along a line
|
||||
// data along line filter
|
||||
PROPERTY_SOURCE(Fem::FemPostDataAlongLineFilter, Fem::FemPostFilter)
|
||||
|
||||
FemPostDataAlongLineFilter::FemPostDataAlongLineFilter() : FemPostFilter() {
|
||||
|
||||
FemPostDataAlongLineFilter::FemPostDataAlongLineFilter()
|
||||
: FemPostFilter()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Point1,
|
||||
(Base::Vector3d(0.0, 0.0, 0.0)),
|
||||
"DataAlongLine",
|
||||
@@ -259,12 +176,11 @@ FemPostDataAlongLineFilter::FemPostDataAlongLineFilter() : FemPostFilter() {
|
||||
setActiveFilterPipeline("DataAlongLine");
|
||||
}
|
||||
|
||||
FemPostDataAlongLineFilter::~FemPostDataAlongLineFilter() {
|
||||
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostDataAlongLineFilter::execute() {
|
||||
FemPostDataAlongLineFilter::~FemPostDataAlongLineFilter()
|
||||
{}
|
||||
|
||||
DocumentObjectExecReturn* FemPostDataAlongLineFilter::execute()
|
||||
{
|
||||
//recalculate the filter
|
||||
return Fem::FemPostFilter::execute();
|
||||
}
|
||||
@@ -289,7 +205,8 @@ void FemPostDataAlongLineFilter::handleChangedPropertyType(Base::XMLReader& read
|
||||
}
|
||||
}
|
||||
|
||||
void FemPostDataAlongLineFilter::onChanged(const Property* prop) {
|
||||
void FemPostDataAlongLineFilter::onChanged(const Property* prop)
|
||||
{
|
||||
if (prop == &Point1) {
|
||||
const Base::Vector3d& vec1 = Point1.getValue();
|
||||
m_line->SetPoint1(vec1.x, vec1.y, vec1.z);
|
||||
@@ -307,19 +224,16 @@ void FemPostDataAlongLineFilter::onChanged(const Property* prop) {
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostDataAlongLineFilter::mustExecute() const {
|
||||
|
||||
if (Point1.isTouched() ||
|
||||
Point2.isTouched() ||
|
||||
Resolution.isTouched()) {
|
||||
|
||||
short int FemPostDataAlongLineFilter::mustExecute() const
|
||||
{
|
||||
if (Point1.isTouched() || Point2.isTouched() || Resolution.isTouched())
|
||||
return 1;
|
||||
}
|
||||
else return App::DocumentObject::mustExecute();
|
||||
else
|
||||
return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
void FemPostDataAlongLineFilter::GetAxisData() {
|
||||
|
||||
void FemPostDataAlongLineFilter::GetAxisData()
|
||||
{
|
||||
std::vector<double> coords;
|
||||
std::vector<double> values;
|
||||
|
||||
@@ -364,11 +278,12 @@ void FemPostDataAlongLineFilter::GetAxisData() {
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// data point filter
|
||||
// data at point filter
|
||||
PROPERTY_SOURCE(Fem::FemPostDataAtPointFilter, Fem::FemPostFilter)
|
||||
|
||||
FemPostDataAtPointFilter::FemPostDataAtPointFilter() : FemPostFilter() {
|
||||
|
||||
FemPostDataAtPointFilter::FemPostDataAtPointFilter()
|
||||
: FemPostFilter()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Center,
|
||||
(Base::Vector3d(0.0, 0.0, 0.0)),
|
||||
"DataAtPoint",
|
||||
@@ -409,17 +324,17 @@ FemPostDataAtPointFilter::FemPostDataAtPointFilter() : FemPostFilter() {
|
||||
setActiveFilterPipeline("DataAtPoint");
|
||||
}
|
||||
|
||||
FemPostDataAtPointFilter::~FemPostDataAtPointFilter() {
|
||||
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostDataAtPointFilter::execute() {
|
||||
FemPostDataAtPointFilter::~FemPostDataAtPointFilter()
|
||||
{}
|
||||
|
||||
DocumentObjectExecReturn* FemPostDataAtPointFilter::execute()
|
||||
{
|
||||
//recalculate the filter
|
||||
return Fem::FemPostFilter::execute();
|
||||
}
|
||||
|
||||
void FemPostDataAtPointFilter::onChanged(const Property* prop) {
|
||||
void FemPostDataAtPointFilter::onChanged(const Property* prop)
|
||||
{
|
||||
if (prop == &Center) {
|
||||
const Base::Vector3d& vec = Center.getValue();
|
||||
m_point->SetCenter(vec.x, vec.y, vec.z);
|
||||
@@ -428,16 +343,16 @@ void FemPostDataAtPointFilter::onChanged(const Property* prop) {
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostDataAtPointFilter::mustExecute() const {
|
||||
|
||||
short int FemPostDataAtPointFilter::mustExecute() const
|
||||
{
|
||||
if (Center.isTouched())
|
||||
return 1;
|
||||
else
|
||||
return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
void FemPostDataAtPointFilter::GetPointData() {
|
||||
|
||||
void FemPostDataAtPointFilter::GetPointData()
|
||||
{
|
||||
std::vector<double> values;
|
||||
|
||||
vtkSmartPointer<vtkDataObject> data = m_probe->GetOutputDataObject(0);
|
||||
@@ -468,246 +383,84 @@ void FemPostDataAtPointFilter::GetPointData() {
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// scalar clip filter
|
||||
PROPERTY_SOURCE(Fem::FemPostScalarClipFilter, Fem::FemPostFilter)
|
||||
// clip filter
|
||||
PROPERTY_SOURCE(Fem::FemPostClipFilter, Fem::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");
|
||||
ADD_PROPERTY_TYPE(InsideOut, (false), "Clip", App::Prop_None, "Invert the clip direction");
|
||||
|
||||
Value.setConstraints(&m_constraints);
|
||||
|
||||
FilterPipeline clip;
|
||||
m_clipper = vtkSmartPointer<vtkTableBasedClipDataSet>::New();
|
||||
clip.source = m_clipper;
|
||||
clip.target = m_clipper;
|
||||
addFilterPipeline(clip, "clip");
|
||||
setActiveFilterPipeline("clip");
|
||||
}
|
||||
|
||||
FemPostScalarClipFilter::~FemPostScalarClipFilter() {
|
||||
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostScalarClipFilter::execute() {
|
||||
|
||||
std::string val;
|
||||
if (Scalars.getValue() >= 0)
|
||||
val = Scalars.getValueAsString();
|
||||
|
||||
std::vector<std::string> ScalarsArray;
|
||||
|
||||
vtkSmartPointer<vtkDataObject> data = getInputData();
|
||||
if (!data || !data->IsA("vtkDataSet"))
|
||||
return StdReturn;
|
||||
|
||||
vtkDataSet* dset = vtkDataSet::SafeDownCast(data);
|
||||
vtkPointData* pd = dset->GetPointData();
|
||||
|
||||
// get all scalar fields
|
||||
for (int i = 0; i < pd->GetNumberOfArrays(); ++i) {
|
||||
if (pd->GetArray(i)->GetNumberOfComponents() == 1)
|
||||
ScalarsArray.emplace_back(pd->GetArrayName(i));
|
||||
}
|
||||
|
||||
App::Enumeration empty;
|
||||
Scalars.setValue(empty);
|
||||
m_scalarFields.setEnums(ScalarsArray);
|
||||
Scalars.setValue(m_scalarFields);
|
||||
|
||||
// search if the current field is in the available ones and set it
|
||||
std::vector<std::string>::iterator it =
|
||||
std::find(ScalarsArray.begin(), ScalarsArray.end(), val);
|
||||
if (!val.empty() && it != ScalarsArray.end())
|
||||
Scalars.setValue(val.c_str());
|
||||
|
||||
//recalculate the filter
|
||||
return Fem::FemPostFilter::execute();
|
||||
}
|
||||
|
||||
void FemPostScalarClipFilter::onChanged(const Property* prop) {
|
||||
|
||||
if (prop == &Value) {
|
||||
m_clipper->SetValue(Value.getValue());
|
||||
}
|
||||
else if (prop == &InsideOut) {
|
||||
m_clipper->SetInsideOut(InsideOut.getValue());
|
||||
}
|
||||
else if (prop == &Scalars && (Scalars.getValue() >= 0)) {
|
||||
m_clipper->SetInputArrayToProcess(0, 0, 0,
|
||||
vtkDataObject::FIELD_ASSOCIATION_POINTS, Scalars.getValueAsString());
|
||||
setConstraintForField();
|
||||
}
|
||||
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostScalarClipFilter::mustExecute() const {
|
||||
|
||||
if (Value.isTouched() ||
|
||||
InsideOut.isTouched() ||
|
||||
Scalars.isTouched())
|
||||
return 1;
|
||||
else
|
||||
return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
void FemPostScalarClipFilter::setConstraintForField() {
|
||||
|
||||
vtkSmartPointer<vtkDataObject> data = getInputData();
|
||||
if (!data || !data->IsA("vtkDataSet"))
|
||||
return;
|
||||
|
||||
vtkDataSet* dset = vtkDataSet::SafeDownCast(data);
|
||||
|
||||
vtkDataArray* pdata = dset->GetPointData()->GetArray(Scalars.getValueAsString());
|
||||
// VTK cannot deliver data when the filer relies e.g. on a cut clip filter
|
||||
// whose value is set so that all data are cut
|
||||
if (!pdata)
|
||||
return;
|
||||
double p[2];
|
||||
pdata->GetRange(p);
|
||||
m_constraints.LowerBound = p[0];
|
||||
m_constraints.UpperBound = p[1];
|
||||
m_constraints.StepSize = (p[1] - p[0]) / 100.;
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// warp vector filter
|
||||
PROPERTY_SOURCE(Fem::FemPostWarpVectorFilter, Fem::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");
|
||||
|
||||
FilterPipeline warp;
|
||||
m_warp = vtkSmartPointer<vtkWarpVector>::New();
|
||||
warp.source = m_warp;
|
||||
warp.target = m_warp;
|
||||
addFilterPipeline(warp, "warp");
|
||||
setActiveFilterPipeline("warp");
|
||||
}
|
||||
|
||||
FemPostWarpVectorFilter::~FemPostWarpVectorFilter() {
|
||||
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostWarpVectorFilter::execute() {
|
||||
|
||||
std::string val;
|
||||
if (Vector.getValue() >= 0)
|
||||
val = Vector.getValueAsString();
|
||||
|
||||
std::vector<std::string> VectorArray;
|
||||
|
||||
vtkSmartPointer<vtkDataObject> data = getInputData();
|
||||
if (!data || !data->IsA("vtkDataSet"))
|
||||
return StdReturn;
|
||||
|
||||
vtkDataSet* dset = vtkDataSet::SafeDownCast(data);
|
||||
vtkPointData* pd = dset->GetPointData();
|
||||
|
||||
// get all vector fields
|
||||
for (int i = 0; i < pd->GetNumberOfArrays(); ++i) {
|
||||
if (pd->GetArray(i)->GetNumberOfComponents() == 3)
|
||||
VectorArray.emplace_back(pd->GetArrayName(i));
|
||||
}
|
||||
|
||||
App::Enumeration empty;
|
||||
Vector.setValue(empty);
|
||||
m_vectorFields.setEnums(VectorArray);
|
||||
Vector.setValue(m_vectorFields);
|
||||
|
||||
// search if the current field is in the available ones and set it
|
||||
std::vector<std::string>::iterator it =
|
||||
std::find(VectorArray.begin(), VectorArray.end(), val);
|
||||
if (!val.empty() && it != VectorArray.end())
|
||||
Vector.setValue(val.c_str());
|
||||
|
||||
//recalculate the filter
|
||||
return Fem::FemPostFilter::execute();
|
||||
}
|
||||
|
||||
void FemPostWarpVectorFilter::onChanged(const Property* prop) {
|
||||
|
||||
if (prop == &Factor)
|
||||
// since our mesh is in mm, we must scale the factor
|
||||
m_warp->SetScaleFactor(1000 * Factor.getValue());
|
||||
else if (prop == &Vector && (Vector.getValue() >= 0))
|
||||
m_warp->SetInputArrayToProcess(0, 0, 0,
|
||||
vtkDataObject::FIELD_ASSOCIATION_POINTS, Vector.getValueAsString());
|
||||
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostWarpVectorFilter::mustExecute() const {
|
||||
|
||||
if (Factor.isTouched() ||
|
||||
Vector.isTouched())
|
||||
return 1;
|
||||
else
|
||||
return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// cut filter
|
||||
PROPERTY_SOURCE(Fem::FemPostCutFilter, Fem::FemPostFilter)
|
||||
|
||||
FemPostCutFilter::FemPostCutFilter()
|
||||
FemPostClipFilter::FemPostClipFilter()
|
||||
: FemPostFilter()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Function,
|
||||
(nullptr),
|
||||
"Cut",
|
||||
"Clip",
|
||||
App::Prop_None,
|
||||
"The function object which defines the cut function");
|
||||
"The function object which defines the clip regions");
|
||||
ADD_PROPERTY_TYPE(InsideOut, (false), "Clip", App::Prop_None, "Invert the clip direction");
|
||||
ADD_PROPERTY_TYPE(
|
||||
CutCells,
|
||||
(false),
|
||||
"Clip",
|
||||
App::Prop_None,
|
||||
"Decides if cells are cut and interpolated or if the cells are kept as a whole");
|
||||
|
||||
FilterPipeline cut;
|
||||
m_cutter = vtkSmartPointer<vtkCutter>::New();
|
||||
cut.source = m_cutter;
|
||||
cut.target = m_cutter;
|
||||
addFilterPipeline(cut, "cut");
|
||||
setActiveFilterPipeline("cut");
|
||||
FilterPipeline clip;
|
||||
m_clipper = vtkSmartPointer<vtkTableBasedClipDataSet>::New();
|
||||
clip.source = m_clipper;
|
||||
clip.target = m_clipper;
|
||||
addFilterPipeline(clip, "clip");
|
||||
|
||||
FilterPipeline extr;
|
||||
m_extractor = vtkSmartPointer<vtkExtractGeometry>::New();
|
||||
extr.source = m_extractor;
|
||||
extr.target = m_extractor;
|
||||
addFilterPipeline(extr, "extract");
|
||||
|
||||
m_extractor->SetExtractInside(0);
|
||||
setActiveFilterPipeline("extract");
|
||||
}
|
||||
|
||||
FemPostCutFilter::~FemPostCutFilter()
|
||||
FemPostClipFilter::~FemPostClipFilter()
|
||||
{}
|
||||
|
||||
void FemPostCutFilter::onChanged(const Property* prop)
|
||||
void FemPostClipFilter::onChanged(const Property* prop)
|
||||
{
|
||||
if (prop == &Function) {
|
||||
|
||||
if (Function.getValue()
|
||||
&& Function.getValue()->isDerivedFrom(FemPostFunction::getClassTypeId())) {
|
||||
m_cutter->SetCutFunction(
|
||||
m_clipper->SetClipFunction(
|
||||
static_cast<FemPostFunction*>(Function.getValue())->getImplicitFunction());
|
||||
m_extractor->SetImplicitFunction(
|
||||
static_cast<FemPostFunction*>(Function.getValue())->getImplicitFunction());
|
||||
}
|
||||
}
|
||||
else if (prop == &InsideOut) {
|
||||
|
||||
m_clipper->SetInsideOut(InsideOut.getValue());
|
||||
m_extractor->SetExtractInside((InsideOut.getValue()) ? 1 : 0);
|
||||
}
|
||||
else if (prop == &CutCells) {
|
||||
|
||||
if (!CutCells.getValue())
|
||||
setActiveFilterPipeline("extract");
|
||||
else
|
||||
setActiveFilterPipeline("clip");
|
||||
};
|
||||
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostCutFilter::mustExecute() const
|
||||
short int FemPostClipFilter::mustExecute() const
|
||||
{
|
||||
if (Function.isTouched())
|
||||
if (Function.isTouched() || InsideOut.isTouched() || CutCells.isTouched())
|
||||
|
||||
return 1;
|
||||
else
|
||||
return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostCutFilter::execute()
|
||||
DocumentObjectExecReturn* FemPostClipFilter::execute()
|
||||
{
|
||||
if (!m_cutter->GetCutFunction())
|
||||
if (!m_extractor->GetImplicitFunction())
|
||||
return StdReturn;
|
||||
|
||||
return Fem::FemPostFilter::execute();
|
||||
@@ -720,14 +473,11 @@ PROPERTY_SOURCE(Fem::FemPostContoursFilter, Fem::FemPostFilter)
|
||||
FemPostContoursFilter::FemPostContoursFilter()
|
||||
: FemPostFilter()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(NumberOfContours, (10), "Contours",
|
||||
App::Prop_None, "The number of contours");
|
||||
ADD_PROPERTY_TYPE(Field, (long(0)), "Clip",
|
||||
App::Prop_None, "The field used to clip");
|
||||
ADD_PROPERTY_TYPE(VectorMode, ((long)0), "Contours",
|
||||
App::Prop_None, "Select what vector field");
|
||||
ADD_PROPERTY_TYPE(NoColor, (false), "Contours",
|
||||
App::Prop_None, "Don't color the contours");
|
||||
ADD_PROPERTY_TYPE(NumberOfContours, (10), "Contours", App::Prop_None, "The number of contours");
|
||||
ADD_PROPERTY_TYPE(Field, (long(0)), "Clip", App::Prop_None, "The field used to clip");
|
||||
ADD_PROPERTY_TYPE(
|
||||
VectorMode, ((long)0), "Contours", App::Prop_None, "Select what vector field");
|
||||
ADD_PROPERTY_TYPE(NoColor, (false), "Contours", App::Prop_None, "Don't color the contours");
|
||||
|
||||
m_contourConstraints.LowerBound = 1;
|
||||
m_contourConstraints.UpperBound = 1000;
|
||||
@@ -744,8 +494,7 @@ FemPostContoursFilter::FemPostContoursFilter()
|
||||
}
|
||||
|
||||
FemPostContoursFilter::~FemPostContoursFilter()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
DocumentObjectExecReturn* FemPostContoursFilter::execute()
|
||||
{
|
||||
@@ -827,24 +576,23 @@ void FemPostContoursFilter::onChanged(const Property* prop)
|
||||
}
|
||||
else {
|
||||
for (vtkIdType tupleIdx = 0; tupleIdx < numTuples; ++tupleIdx) {
|
||||
componentArray->SetComponent(tupleIdx, 0,
|
||||
std::sqrt(pdata->GetComponent(tupleIdx, 0) *
|
||||
pdata->GetComponent(tupleIdx, 0) +
|
||||
pdata->GetComponent(tupleIdx, 1) *
|
||||
pdata->GetComponent(tupleIdx, 1) +
|
||||
pdata->GetComponent(tupleIdx, 2) *
|
||||
pdata->GetComponent(tupleIdx, 2) ) );
|
||||
componentArray->SetComponent(
|
||||
tupleIdx,
|
||||
0,
|
||||
std::sqrt(
|
||||
pdata->GetComponent(tupleIdx, 0) * pdata->GetComponent(tupleIdx, 0)
|
||||
+ pdata->GetComponent(tupleIdx, 1) * pdata->GetComponent(tupleIdx, 1)
|
||||
+ pdata->GetComponent(tupleIdx, 2) * pdata->GetComponent(tupleIdx, 2)));
|
||||
}
|
||||
}
|
||||
// name the array
|
||||
contourFieldName =
|
||||
std::string(Field.getValueAsString()) + "_contour";
|
||||
contourFieldName = std::string(Field.getValueAsString()) + "_contour";
|
||||
componentArray->SetName(contourFieldName.c_str());
|
||||
|
||||
// add the array as new field and use it for the contour filter
|
||||
dset->GetPointData()->AddArray(componentArray);
|
||||
m_contours->SetInputArrayToProcess(0, 0, 0,
|
||||
vtkDataObject::FIELD_ASSOCIATION_POINTS, contourFieldName.c_str());
|
||||
m_contours->SetInputArrayToProcess(
|
||||
0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, contourFieldName.c_str());
|
||||
componentArray->GetRange(p);
|
||||
recalculateContours(p[0], p[1]);
|
||||
if (prop == &Data) {
|
||||
@@ -966,6 +714,251 @@ void FemPostContoursFilter::refreshVectors()
|
||||
auto it = std::find(vectorArray.begin(), vectorArray.end(), vectorName);
|
||||
if (!vectorName.empty() && it != vectorArray.end())
|
||||
VectorMode.setValue(vectorName.c_str());
|
||||
|
||||
|
||||
m_blockPropertyChanges = false;
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// cut filter
|
||||
PROPERTY_SOURCE(Fem::FemPostCutFilter, Fem::FemPostFilter)
|
||||
|
||||
FemPostCutFilter::FemPostCutFilter()
|
||||
: FemPostFilter()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Function,
|
||||
(nullptr),
|
||||
"Cut",
|
||||
App::Prop_None,
|
||||
"The function object which defines the cut function");
|
||||
|
||||
FilterPipeline cut;
|
||||
m_cutter = vtkSmartPointer<vtkCutter>::New();
|
||||
cut.source = m_cutter;
|
||||
cut.target = m_cutter;
|
||||
addFilterPipeline(cut, "cut");
|
||||
setActiveFilterPipeline("cut");
|
||||
}
|
||||
|
||||
FemPostCutFilter::~FemPostCutFilter()
|
||||
{}
|
||||
|
||||
void FemPostCutFilter::onChanged(const Property* prop)
|
||||
{
|
||||
if (prop == &Function) {
|
||||
if (Function.getValue()
|
||||
&& Function.getValue()->isDerivedFrom(FemPostFunction::getClassTypeId())) {
|
||||
m_cutter->SetCutFunction(
|
||||
static_cast<FemPostFunction*>(Function.getValue())->getImplicitFunction());
|
||||
}
|
||||
}
|
||||
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostCutFilter::mustExecute() const
|
||||
{
|
||||
if (Function.isTouched())
|
||||
return 1;
|
||||
else
|
||||
return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostCutFilter::execute()
|
||||
{
|
||||
if (!m_cutter->GetCutFunction())
|
||||
return StdReturn;
|
||||
|
||||
return Fem::FemPostFilter::execute();
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// scalar clip filter
|
||||
PROPERTY_SOURCE(Fem::FemPostScalarClipFilter, Fem::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");
|
||||
ADD_PROPERTY_TYPE(InsideOut, (false), "Clip", App::Prop_None, "Invert the clip direction");
|
||||
|
||||
Value.setConstraints(&m_constraints);
|
||||
|
||||
FilterPipeline clip;
|
||||
m_clipper = vtkSmartPointer<vtkTableBasedClipDataSet>::New();
|
||||
clip.source = m_clipper;
|
||||
clip.target = m_clipper;
|
||||
addFilterPipeline(clip, "clip");
|
||||
setActiveFilterPipeline("clip");
|
||||
}
|
||||
|
||||
FemPostScalarClipFilter::~FemPostScalarClipFilter() {
|
||||
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostScalarClipFilter::execute()
|
||||
{
|
||||
std::string val;
|
||||
if (Scalars.getValue() >= 0)
|
||||
val = Scalars.getValueAsString();
|
||||
|
||||
std::vector<std::string> ScalarsArray;
|
||||
|
||||
vtkSmartPointer<vtkDataObject> data = getInputData();
|
||||
if (!data || !data->IsA("vtkDataSet"))
|
||||
return StdReturn;
|
||||
|
||||
vtkDataSet* dset = vtkDataSet::SafeDownCast(data);
|
||||
vtkPointData* pd = dset->GetPointData();
|
||||
|
||||
// get all scalar fields
|
||||
for (int i = 0; i < pd->GetNumberOfArrays(); ++i) {
|
||||
if (pd->GetArray(i)->GetNumberOfComponents() == 1)
|
||||
ScalarsArray.emplace_back(pd->GetArrayName(i));
|
||||
}
|
||||
|
||||
App::Enumeration empty;
|
||||
Scalars.setValue(empty);
|
||||
m_scalarFields.setEnums(ScalarsArray);
|
||||
Scalars.setValue(m_scalarFields);
|
||||
|
||||
// search if the current field is in the available ones and set it
|
||||
std::vector<std::string>::iterator it =
|
||||
std::find(ScalarsArray.begin(), ScalarsArray.end(), val);
|
||||
if (!val.empty() && it != ScalarsArray.end())
|
||||
Scalars.setValue(val.c_str());
|
||||
|
||||
//recalculate the filter
|
||||
return Fem::FemPostFilter::execute();
|
||||
}
|
||||
|
||||
void FemPostScalarClipFilter::onChanged(const Property* prop)
|
||||
{
|
||||
if (prop == &Value) {
|
||||
m_clipper->SetValue(Value.getValue());
|
||||
}
|
||||
else if (prop == &InsideOut) {
|
||||
m_clipper->SetInsideOut(InsideOut.getValue());
|
||||
}
|
||||
else if (prop == &Scalars && (Scalars.getValue() >= 0)) {
|
||||
m_clipper->SetInputArrayToProcess(0, 0, 0,
|
||||
vtkDataObject::FIELD_ASSOCIATION_POINTS, Scalars.getValueAsString());
|
||||
setConstraintForField();
|
||||
}
|
||||
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostScalarClipFilter::mustExecute() const
|
||||
{
|
||||
if (Value.isTouched() ||
|
||||
InsideOut.isTouched() ||
|
||||
Scalars.isTouched())
|
||||
return 1;
|
||||
else
|
||||
return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
void FemPostScalarClipFilter::setConstraintForField()
|
||||
{
|
||||
vtkSmartPointer<vtkDataObject> data = getInputData();
|
||||
if (!data || !data->IsA("vtkDataSet"))
|
||||
return;
|
||||
|
||||
vtkDataSet* dset = vtkDataSet::SafeDownCast(data);
|
||||
|
||||
vtkDataArray* pdata = dset->GetPointData()->GetArray(Scalars.getValueAsString());
|
||||
// VTK cannot deliver data when the filer relies e.g. on a cut clip filter
|
||||
// whose value is set so that all data are cut
|
||||
if (!pdata)
|
||||
return;
|
||||
double p[2];
|
||||
pdata->GetRange(p);
|
||||
m_constraints.LowerBound = p[0];
|
||||
m_constraints.UpperBound = p[1];
|
||||
m_constraints.StepSize = (p[1] - p[0]) / 100.;
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// warp vector filter
|
||||
PROPERTY_SOURCE(Fem::FemPostWarpVectorFilter, Fem::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");
|
||||
|
||||
FilterPipeline warp;
|
||||
m_warp = vtkSmartPointer<vtkWarpVector>::New();
|
||||
warp.source = m_warp;
|
||||
warp.target = m_warp;
|
||||
addFilterPipeline(warp, "warp");
|
||||
setActiveFilterPipeline("warp");
|
||||
}
|
||||
|
||||
FemPostWarpVectorFilter::~FemPostWarpVectorFilter()
|
||||
{}
|
||||
|
||||
DocumentObjectExecReturn* FemPostWarpVectorFilter::execute()
|
||||
{
|
||||
std::string val;
|
||||
if (Vector.getValue() >= 0)
|
||||
val = Vector.getValueAsString();
|
||||
|
||||
std::vector<std::string> VectorArray;
|
||||
|
||||
vtkSmartPointer<vtkDataObject> data = getInputData();
|
||||
if (!data || !data->IsA("vtkDataSet"))
|
||||
return StdReturn;
|
||||
|
||||
vtkDataSet* dset = vtkDataSet::SafeDownCast(data);
|
||||
vtkPointData* pd = dset->GetPointData();
|
||||
|
||||
// get all vector fields
|
||||
for (int i = 0; i < pd->GetNumberOfArrays(); ++i) {
|
||||
if (pd->GetArray(i)->GetNumberOfComponents() == 3)
|
||||
VectorArray.emplace_back(pd->GetArrayName(i));
|
||||
}
|
||||
|
||||
App::Enumeration empty;
|
||||
Vector.setValue(empty);
|
||||
m_vectorFields.setEnums(VectorArray);
|
||||
Vector.setValue(m_vectorFields);
|
||||
|
||||
// search if the current field is in the available ones and set it
|
||||
std::vector<std::string>::iterator it =
|
||||
std::find(VectorArray.begin(), VectorArray.end(), val);
|
||||
if (!val.empty() && it != VectorArray.end())
|
||||
Vector.setValue(val.c_str());
|
||||
|
||||
//recalculate the filter
|
||||
return Fem::FemPostFilter::execute();
|
||||
}
|
||||
|
||||
void FemPostWarpVectorFilter::onChanged(const Property* prop)
|
||||
{
|
||||
if (prop == &Factor)
|
||||
// since our mesh is in mm, we must scale the factor
|
||||
m_warp->SetScaleFactor(1000 * Factor.getValue());
|
||||
else if (prop == &Vector && (Vector.getValue() >= 0))
|
||||
m_warp->SetInputArrayToProcess(0, 0, 0,
|
||||
vtkDataObject::FIELD_ASSOCIATION_POINTS, Vector.getValueAsString());
|
||||
|
||||
Fem::FemPostFilter::onChanged(prop);
|
||||
}
|
||||
|
||||
short int FemPostWarpVectorFilter::mustExecute() const
|
||||
{
|
||||
if (Factor.isTouched() || Vector.isTouched())
|
||||
return 1;
|
||||
else
|
||||
return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
@@ -75,33 +75,15 @@ private:
|
||||
std::string m_activePipeline;
|
||||
};
|
||||
|
||||
class FemExport FemPostClipFilter : public FemPostFilter {
|
||||
// ***************************************************************************
|
||||
// in the following, the different filters sorted alphabetically
|
||||
// ***************************************************************************
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Fem::FemPostClipFilter);
|
||||
|
||||
public:
|
||||
FemPostClipFilter();
|
||||
~FemPostClipFilter() override;
|
||||
|
||||
App::PropertyLink Function;
|
||||
App::PropertyBool InsideOut;
|
||||
App::PropertyBool CutCells;
|
||||
|
||||
const char* getViewProviderName() const override {
|
||||
return "FemGui::ViewProviderFemPostClip";
|
||||
}
|
||||
short int mustExecute() const override;
|
||||
App::DocumentObjectExecReturn* execute() override;
|
||||
|
||||
protected:
|
||||
void onChanged(const App::Property* prop) override;
|
||||
|
||||
private:
|
||||
vtkSmartPointer<vtkTableBasedClipDataSet> m_clipper;
|
||||
vtkSmartPointer<vtkExtractGeometry> m_extractor;
|
||||
};
|
||||
|
||||
class FemExport FemPostDataAlongLineFilter : public FemPostFilter {
|
||||
// ***************************************************************************
|
||||
// data along line filter
|
||||
class FemExport FemPostDataAlongLineFilter: public FemPostFilter
|
||||
{
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Fem::FemPostDataAlongLineFilter);
|
||||
|
||||
@@ -116,8 +98,9 @@ public:
|
||||
App::PropertyFloatList YAxisData;
|
||||
App::PropertyString PlotData;
|
||||
|
||||
const char* getViewProviderName() const override {
|
||||
return "FemGui::ViewProviderFemPostDataAlongLine";
|
||||
const char* getViewProviderName() const override
|
||||
{
|
||||
return "FemGui::ViewProviderFemPostDataAlongLine";
|
||||
}
|
||||
short int mustExecute() const override;
|
||||
void GetAxisData();
|
||||
@@ -129,13 +112,15 @@ protected:
|
||||
App::Property* prop) override;
|
||||
|
||||
private:
|
||||
|
||||
vtkSmartPointer<vtkLineSource> m_line;
|
||||
vtkSmartPointer<vtkProbeFilter> m_probe;
|
||||
|
||||
vtkSmartPointer<vtkLineSource> m_line;
|
||||
vtkSmartPointer<vtkProbeFilter> m_probe;
|
||||
};
|
||||
|
||||
class FemExport FemPostDataAtPointFilter : public FemPostFilter {
|
||||
|
||||
// ***************************************************************************
|
||||
// data at point filter
|
||||
class FemExport FemPostDataAtPointFilter: public FemPostFilter
|
||||
{
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Fem::FemPostDataAtPointFilter);
|
||||
|
||||
@@ -149,8 +134,9 @@ public:
|
||||
App::PropertyFloatList PointData;
|
||||
App::PropertyString Unit;
|
||||
|
||||
const char* getViewProviderName() const override {
|
||||
return "FemGui::ViewProviderFemPostDataAtPoint";
|
||||
const char* getViewProviderName() const override
|
||||
{
|
||||
return "FemGui::ViewProviderFemPostDataAtPoint";
|
||||
}
|
||||
short int mustExecute() const override;
|
||||
|
||||
@@ -160,77 +146,29 @@ protected:
|
||||
void GetPointData();
|
||||
|
||||
private:
|
||||
|
||||
vtkSmartPointer<vtkPointSource> m_point;
|
||||
vtkSmartPointer<vtkProbeFilter> m_probe;
|
||||
|
||||
vtkSmartPointer<vtkPointSource> m_point;
|
||||
vtkSmartPointer<vtkProbeFilter> m_probe;
|
||||
};
|
||||
|
||||
class FemExport FemPostScalarClipFilter : public FemPostFilter {
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Fem::FemPostScalarClipFilter);
|
||||
// ***************************************************************************
|
||||
// clip filter
|
||||
class FemExport FemPostClipFilter: public FemPostFilter
|
||||
{
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Fem::FemPostClipFilter);
|
||||
|
||||
public:
|
||||
FemPostScalarClipFilter();
|
||||
~FemPostScalarClipFilter() override;
|
||||
FemPostClipFilter();
|
||||
~FemPostClipFilter() override;
|
||||
|
||||
App::PropertyBool InsideOut;
|
||||
App::PropertyFloatConstraint Value;
|
||||
App::PropertyEnumeration Scalars;
|
||||
App::PropertyLink Function;
|
||||
App::PropertyBool InsideOut;
|
||||
App::PropertyBool CutCells;
|
||||
|
||||
const char* getViewProviderName() const override {
|
||||
return "FemGui::ViewProviderFemPostScalarClip";
|
||||
}
|
||||
short int mustExecute() const override;
|
||||
|
||||
protected:
|
||||
App::DocumentObjectExecReturn* execute() override;
|
||||
void onChanged(const App::Property* prop) override;
|
||||
void setConstraintForField();
|
||||
|
||||
private:
|
||||
vtkSmartPointer<vtkTableBasedClipDataSet> m_clipper;
|
||||
App::Enumeration m_scalarFields;
|
||||
App::PropertyFloatConstraint::Constraints m_constraints;
|
||||
};
|
||||
|
||||
class FemExport FemPostWarpVectorFilter : public FemPostFilter {
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Fem::FemPostWarpVectorFilter);
|
||||
|
||||
public:
|
||||
FemPostWarpVectorFilter();
|
||||
~FemPostWarpVectorFilter() override;
|
||||
|
||||
App::PropertyFloat Factor;
|
||||
App::PropertyEnumeration Vector;
|
||||
|
||||
const char* getViewProviderName() const override {
|
||||
return "FemGui::ViewProviderFemPostWarpVector";
|
||||
}
|
||||
short int mustExecute() const override;
|
||||
|
||||
protected:
|
||||
App::DocumentObjectExecReturn* execute() override;
|
||||
void onChanged(const App::Property* prop) override;
|
||||
|
||||
private:
|
||||
vtkSmartPointer<vtkWarpVector> m_warp;
|
||||
App::Enumeration m_vectorFields;
|
||||
};
|
||||
|
||||
class FemExport FemPostCutFilter : public FemPostFilter {
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Fem::FemPostCutFilter);
|
||||
|
||||
public:
|
||||
FemPostCutFilter();
|
||||
~FemPostCutFilter() override;
|
||||
|
||||
App::PropertyLink Function;
|
||||
|
||||
const char* getViewProviderName() const override {
|
||||
return "FemGui::ViewProviderFemPostCut";
|
||||
const char* getViewProviderName() const override
|
||||
{
|
||||
return "FemGui::ViewProviderFemPostClip";
|
||||
}
|
||||
short int mustExecute() const override;
|
||||
App::DocumentObjectExecReturn* execute() override;
|
||||
@@ -239,9 +177,13 @@ protected:
|
||||
void onChanged(const App::Property* prop) override;
|
||||
|
||||
private:
|
||||
vtkSmartPointer<vtkCutter> m_cutter;
|
||||
vtkSmartPointer<vtkTableBasedClipDataSet> m_clipper;
|
||||
vtkSmartPointer<vtkExtractGeometry> m_extractor;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// contours filter
|
||||
class FemExport FemPostContoursFilter: public FemPostFilter
|
||||
{
|
||||
|
||||
@@ -280,6 +222,95 @@ private:
|
||||
App::PropertyIntegerConstraint::Constraints m_contourConstraints;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// cut filter
|
||||
class FemExport FemPostCutFilter: public FemPostFilter
|
||||
{
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Fem::FemPostCutFilter);
|
||||
|
||||
public:
|
||||
FemPostCutFilter();
|
||||
~FemPostCutFilter() override;
|
||||
|
||||
App::PropertyLink Function;
|
||||
|
||||
const char* getViewProviderName() const override
|
||||
{
|
||||
return "FemGui::ViewProviderFemPostCut";
|
||||
}
|
||||
short int mustExecute() const override;
|
||||
App::DocumentObjectExecReturn* execute() override;
|
||||
|
||||
protected:
|
||||
void onChanged(const App::Property* prop) override;
|
||||
|
||||
private:
|
||||
vtkSmartPointer<vtkCutter> m_cutter;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// scalar clip filter
|
||||
class FemExport FemPostScalarClipFilter: public FemPostFilter
|
||||
{
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Fem::FemPostScalarClipFilter);
|
||||
|
||||
public:
|
||||
FemPostScalarClipFilter();
|
||||
~FemPostScalarClipFilter() override;
|
||||
|
||||
App::PropertyBool InsideOut;
|
||||
App::PropertyFloatConstraint Value;
|
||||
App::PropertyEnumeration Scalars;
|
||||
|
||||
const char* getViewProviderName() const override
|
||||
{
|
||||
return "FemGui::ViewProviderFemPostScalarClip";
|
||||
}
|
||||
short int mustExecute() const override;
|
||||
|
||||
protected:
|
||||
App::DocumentObjectExecReturn* execute() override;
|
||||
void onChanged(const App::Property* prop) override;
|
||||
void setConstraintForField();
|
||||
|
||||
private:
|
||||
vtkSmartPointer<vtkTableBasedClipDataSet> m_clipper;
|
||||
App::Enumeration m_scalarFields;
|
||||
App::PropertyFloatConstraint::Constraints m_constraints;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// warp vector filter
|
||||
class FemExport FemPostWarpVectorFilter : public FemPostFilter {
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Fem::FemPostWarpVectorFilter);
|
||||
|
||||
public:
|
||||
FemPostWarpVectorFilter();
|
||||
~FemPostWarpVectorFilter() override;
|
||||
|
||||
App::PropertyFloat Factor;
|
||||
App::PropertyEnumeration Vector;
|
||||
|
||||
const char* getViewProviderName() const override {
|
||||
return "FemGui::ViewProviderFemPostWarpVector";
|
||||
}
|
||||
short int mustExecute() const override;
|
||||
|
||||
protected:
|
||||
App::DocumentObjectExecReturn* execute() override;
|
||||
void onChanged(const App::Property* prop) override;
|
||||
|
||||
private:
|
||||
vtkSmartPointer<vtkWarpVector> m_warp;
|
||||
App::Enumeration m_vectorFields;
|
||||
};
|
||||
|
||||
} //namespace Fem
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -51,8 +51,11 @@ class SoEventCallback;
|
||||
class SoMarkerSet;
|
||||
|
||||
|
||||
namespace FemGui {
|
||||
namespace FemGui
|
||||
{
|
||||
|
||||
// ***************************************************************************
|
||||
// point marker
|
||||
class ViewProviderPointMarker;
|
||||
class PointMarker : public QObject
|
||||
{
|
||||
@@ -78,7 +81,6 @@ private:
|
||||
std::string ObjectInvisible();
|
||||
};
|
||||
|
||||
|
||||
class FemGuiExport ViewProviderPointMarker : public Gui::ViewProviderDocumentObject
|
||||
{
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderPointMarker);
|
||||
@@ -93,6 +95,8 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// data marker
|
||||
class ViewProviderDataMarker;
|
||||
class DataMarker : public QObject
|
||||
{
|
||||
@@ -133,8 +137,11 @@ protected:
|
||||
friend class DataMarker;
|
||||
};
|
||||
|
||||
class TaskPostBox : public Gui::TaskView::TaskBox {
|
||||
|
||||
// ***************************************************************************
|
||||
// main task dialog
|
||||
class TaskPostBox : public Gui::TaskView::TaskBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -176,7 +183,8 @@ private:
|
||||
};
|
||||
|
||||
|
||||
/// simulation dialog for the TaskView
|
||||
// ***************************************************************************
|
||||
// simulation dialog for the TaskView
|
||||
class TaskDlgPost : public Gui::TaskView::TaskDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -217,6 +225,8 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// box to set the coloring
|
||||
class TaskPostDisplay : public TaskPostBox
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -241,8 +251,10 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class TaskPostFunction : public TaskPostBox {
|
||||
|
||||
// ***************************************************************************
|
||||
// functions
|
||||
class TaskPostFunction : public TaskPostBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -253,8 +265,76 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class TaskPostClip : public TaskPostBox {
|
||||
// ***************************************************************************
|
||||
// in the following, the different filters sorted alphabetically
|
||||
// ***************************************************************************
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// data along line filter
|
||||
class TaskPostDataAlongLine: public TaskPostBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TaskPostDataAlongLine(Gui::ViewProviderDocumentObject* view,
|
||||
QWidget* parent = nullptr);
|
||||
~TaskPostDataAlongLine() override;
|
||||
|
||||
void applyPythonCode() override;
|
||||
static void pointCallback(void* ud, SoEventCallback* n);
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_SelectPoints_clicked();
|
||||
void on_CreatePlot_clicked();
|
||||
void on_Representation_activated(int i);
|
||||
void on_Field_activated(int i);
|
||||
void on_VectorMode_activated(int i);
|
||||
void point2Changed(double);
|
||||
void point1Changed(double);
|
||||
void resolutionChanged(int val);
|
||||
void onChange(double x1, double y1, double z1, double x2, double y2, double z2);
|
||||
|
||||
private:
|
||||
std::string Plot();
|
||||
std::string ObjectVisible();
|
||||
QWidget* proxy;
|
||||
std::unique_ptr<Ui_TaskPostDataAlongLine> ui;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// data at point filter
|
||||
class TaskPostDataAtPoint: public TaskPostBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TaskPostDataAtPoint(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr);
|
||||
~TaskPostDataAtPoint() override;
|
||||
|
||||
void applyPythonCode() override;
|
||||
static void pointCallback(void* ud, SoEventCallback* n);
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_SelectPoint_clicked();
|
||||
void on_Field_activated(int i);
|
||||
void centerChanged(double);
|
||||
void onChange(double x, double y, double z);
|
||||
|
||||
private:
|
||||
std::string toString(double val) const;
|
||||
void showValue(double value, const char* unit);
|
||||
std::string ObjectVisible();
|
||||
QWidget* proxy;
|
||||
std::unique_ptr<Ui_TaskPostDataAtPoint> ui;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// clip filter
|
||||
class TaskPostClip : public TaskPostBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -283,140 +363,8 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class TaskPostDataAlongLine: public TaskPostBox {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TaskPostDataAlongLine(Gui::ViewProviderDocumentObject* view,
|
||||
QWidget* parent = nullptr);
|
||||
~TaskPostDataAlongLine() override;
|
||||
|
||||
void applyPythonCode() override;
|
||||
static void pointCallback(void * ud, SoEventCallback * n);
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_SelectPoints_clicked();
|
||||
void on_CreatePlot_clicked();
|
||||
void on_Representation_activated(int i);
|
||||
void on_Field_activated(int i);
|
||||
void on_VectorMode_activated(int i);
|
||||
void point2Changed(double);
|
||||
void point1Changed(double);
|
||||
void resolutionChanged(int val);
|
||||
void onChange(double x1, double y1, double z1, double x2, double y2, double z2);
|
||||
|
||||
|
||||
private:
|
||||
std::string Plot();
|
||||
std::string ObjectVisible();
|
||||
QWidget* proxy;
|
||||
std::unique_ptr<Ui_TaskPostDataAlongLine> ui;
|
||||
};
|
||||
|
||||
|
||||
class TaskPostDataAtPoint: public TaskPostBox {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TaskPostDataAtPoint(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr);
|
||||
~TaskPostDataAtPoint() override;
|
||||
|
||||
void applyPythonCode() override;
|
||||
static void pointCallback(void * ud, SoEventCallback * n);
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_SelectPoint_clicked();
|
||||
void on_Field_activated(int i);
|
||||
void centerChanged(double);
|
||||
void onChange(double x, double y, double z);
|
||||
|
||||
private:
|
||||
std::string toString(double val) const;
|
||||
void showValue(double value, const char* unit);
|
||||
|
||||
|
||||
private:
|
||||
std::string ObjectVisible();
|
||||
QWidget* proxy;
|
||||
std::unique_ptr<Ui_TaskPostDataAtPoint> ui;
|
||||
};
|
||||
|
||||
|
||||
class TaskPostScalarClip : public TaskPostBox {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TaskPostScalarClip(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr);
|
||||
~TaskPostScalarClip() override;
|
||||
|
||||
void applyPythonCode() override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_Slider_valueChanged(int v);
|
||||
void on_Value_valueChanged(double v);
|
||||
void on_Scalar_currentIndexChanged(int idx);
|
||||
void on_InsideOut_toggled(bool val);
|
||||
|
||||
private:
|
||||
QWidget* proxy;
|
||||
std::unique_ptr<Ui_TaskPostScalarClip> ui;
|
||||
};
|
||||
|
||||
|
||||
class TaskPostWarpVector : public TaskPostBox {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TaskPostWarpVector(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr);
|
||||
~TaskPostWarpVector() override;
|
||||
|
||||
void applyPythonCode() override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_Slider_valueChanged(int v);
|
||||
void on_Value_valueChanged(double v);
|
||||
void on_Max_valueChanged(double);
|
||||
void on_Min_valueChanged(double);
|
||||
void on_Vector_currentIndexChanged(int idx);
|
||||
|
||||
private:
|
||||
QWidget* proxy;
|
||||
std::unique_ptr<Ui_TaskPostWarpVector> ui;
|
||||
};
|
||||
|
||||
|
||||
class TaskPostCut : public TaskPostBox {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskPostCut(Gui::ViewProviderDocumentObject* view, App::PropertyLink* function,
|
||||
QWidget* parent = nullptr);
|
||||
~TaskPostCut() override;
|
||||
|
||||
void applyPythonCode() override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_CreateButton_triggered(QAction*);
|
||||
void on_FunctionBox_currentIndexChanged(int idx);
|
||||
|
||||
Q_SIGNALS:
|
||||
void emitAddedFunction();
|
||||
|
||||
private:
|
||||
void collectImplicitFunctions();
|
||||
|
||||
//App::PropertyLink* m_functionProperty;
|
||||
QWidget* proxy;
|
||||
std::unique_ptr<Ui_TaskPostCut> ui;
|
||||
FunctionWidget* fwidget;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// contours filter
|
||||
class TaskPostContours: public TaskPostBox
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -440,6 +388,85 @@ private:
|
||||
void updateFields(int idx);
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// cut filter
|
||||
class TaskPostCut: public TaskPostBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskPostCut(Gui::ViewProviderDocumentObject* view, App::PropertyLink* function,
|
||||
QWidget* parent = nullptr);
|
||||
~TaskPostCut() override;
|
||||
|
||||
void applyPythonCode() override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_CreateButton_triggered(QAction*);
|
||||
void on_FunctionBox_currentIndexChanged(int idx);
|
||||
|
||||
Q_SIGNALS:
|
||||
void emitAddedFunction();
|
||||
|
||||
private:
|
||||
void collectImplicitFunctions();
|
||||
|
||||
//App::PropertyLink* m_functionProperty;
|
||||
QWidget* proxy;
|
||||
std::unique_ptr<Ui_TaskPostCut> ui;
|
||||
FunctionWidget* fwidget;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// scalar clip filter
|
||||
class TaskPostScalarClip : public TaskPostBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TaskPostScalarClip(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr);
|
||||
~TaskPostScalarClip() override;
|
||||
|
||||
void applyPythonCode() override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_Slider_valueChanged(int v);
|
||||
void on_Value_valueChanged(double v);
|
||||
void on_Scalar_currentIndexChanged(int idx);
|
||||
void on_InsideOut_toggled(bool val);
|
||||
|
||||
private:
|
||||
QWidget* proxy;
|
||||
std::unique_ptr<Ui_TaskPostScalarClip> ui;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// warp vector filter
|
||||
class TaskPostWarpVector : public TaskPostBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TaskPostWarpVector(Gui::ViewProviderDocumentObject* view, QWidget* parent = nullptr);
|
||||
~TaskPostWarpVector() override;
|
||||
|
||||
void applyPythonCode() override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_Slider_valueChanged(int v);
|
||||
void on_Value_valueChanged(double v);
|
||||
void on_Max_valueChanged(double);
|
||||
void on_Min_valueChanged(double);
|
||||
void on_Vector_currentIndexChanged(int idx);
|
||||
|
||||
private:
|
||||
QWidget* proxy;
|
||||
std::unique_ptr<Ui_TaskPostWarpVector> ui;
|
||||
};
|
||||
|
||||
} //namespace FemGui
|
||||
|
||||
#endif // GUI_TASKVIEW_TaskPostDisplay_H
|
||||
|
||||
@@ -30,6 +30,63 @@
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
// ***************************************************************************
|
||||
// in the following, the different filters sorted alphabetically
|
||||
// ***************************************************************************
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// data along line filter
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostDataAlongLine, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostDataAlongLine::ViewProviderFemPostDataAlongLine()
|
||||
{
|
||||
sPixmap = "FEM_PostFilterDataAlongLine";
|
||||
}
|
||||
|
||||
ViewProviderFemPostDataAlongLine::~ViewProviderFemPostDataAlongLine()
|
||||
{}
|
||||
|
||||
void ViewProviderFemPostDataAlongLine::setupTaskDialog(TaskDlgPost* dlg)
|
||||
{
|
||||
//add the function box
|
||||
dlg->appendBox(new TaskPostDataAlongLine(dlg->getView()));
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// data at point filter
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostDataAtPoint, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostDataAtPoint::ViewProviderFemPostDataAtPoint()
|
||||
{
|
||||
sPixmap = "FEM_PostFilterDataAtPoint";
|
||||
}
|
||||
|
||||
void ViewProviderFemPostDataAtPoint::show()
|
||||
{
|
||||
Gui::ViewProviderDocumentObject::show();
|
||||
}
|
||||
|
||||
void ViewProviderFemPostDataAtPoint::onSelectionChanged(const Gui::SelectionChanges&)
|
||||
{
|
||||
// do not do anything here
|
||||
// For DataAtPoint the color bar must not be refreshed when it is selected
|
||||
// because a single point does not make sense with a color range.
|
||||
}
|
||||
|
||||
ViewProviderFemPostDataAtPoint::~ViewProviderFemPostDataAtPoint()
|
||||
{}
|
||||
|
||||
void ViewProviderFemPostDataAtPoint::setupTaskDialog(TaskDlgPost* dlg)
|
||||
{
|
||||
//add the function box
|
||||
dlg->appendBox(new TaskPostDataAtPoint(dlg->getView()));
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// clip filter
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostClip, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostClip::ViewProviderFemPostClip() {
|
||||
@@ -37,9 +94,8 @@ ViewProviderFemPostClip::ViewProviderFemPostClip() {
|
||||
sPixmap = "FEM_PostFilterClipRegion";
|
||||
}
|
||||
|
||||
ViewProviderFemPostClip::~ViewProviderFemPostClip() {
|
||||
|
||||
}
|
||||
ViewProviderFemPostClip::~ViewProviderFemPostClip()
|
||||
{}
|
||||
|
||||
void ViewProviderFemPostClip::setupTaskDialog(TaskDlgPost* dlg) {
|
||||
|
||||
@@ -51,115 +107,9 @@ void ViewProviderFemPostClip::setupTaskDialog(TaskDlgPost* dlg) {
|
||||
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
|
||||
}
|
||||
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostDataAlongLine, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostDataAlongLine::ViewProviderFemPostDataAlongLine() {
|
||||
|
||||
sPixmap = "FEM_PostFilterDataAlongLine";
|
||||
}
|
||||
|
||||
ViewProviderFemPostDataAlongLine::~ViewProviderFemPostDataAlongLine() {
|
||||
|
||||
}
|
||||
|
||||
void ViewProviderFemPostDataAlongLine::setupTaskDialog(TaskDlgPost* dlg) {
|
||||
|
||||
//add the function box
|
||||
dlg->appendBox(new TaskPostDataAlongLine(dlg->getView()));
|
||||
|
||||
}
|
||||
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostDataAtPoint, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostDataAtPoint::ViewProviderFemPostDataAtPoint() {
|
||||
|
||||
sPixmap = "FEM_PostFilterDataAtPoint";
|
||||
}
|
||||
|
||||
void ViewProviderFemPostDataAtPoint::show()
|
||||
{
|
||||
Gui::ViewProviderDocumentObject::show();
|
||||
}
|
||||
|
||||
void ViewProviderFemPostDataAtPoint::onSelectionChanged(const Gui::SelectionChanges &)
|
||||
{
|
||||
// do not do anything here
|
||||
// For DataAtPoint the color bar must not be refreshed when it is selected
|
||||
// because a single point does not make sense with a color range.
|
||||
}
|
||||
|
||||
ViewProviderFemPostDataAtPoint::~ViewProviderFemPostDataAtPoint() {
|
||||
|
||||
}
|
||||
|
||||
void ViewProviderFemPostDataAtPoint::setupTaskDialog(TaskDlgPost* dlg) {
|
||||
|
||||
//add the function box
|
||||
dlg->appendBox(new TaskPostDataAtPoint(dlg->getView()));
|
||||
|
||||
}
|
||||
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostScalarClip, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostScalarClip::ViewProviderFemPostScalarClip() {
|
||||
|
||||
sPixmap = "FEM_PostFilterClipScalar";
|
||||
}
|
||||
|
||||
ViewProviderFemPostScalarClip::~ViewProviderFemPostScalarClip() {
|
||||
|
||||
}
|
||||
|
||||
void ViewProviderFemPostScalarClip::setupTaskDialog(TaskDlgPost* dlg) {
|
||||
|
||||
//add the function box
|
||||
dlg->appendBox(new TaskPostScalarClip(dlg->getView()));
|
||||
|
||||
//add the display options
|
||||
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
|
||||
}
|
||||
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostWarpVector, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostWarpVector::ViewProviderFemPostWarpVector() {
|
||||
|
||||
sPixmap = "FEM_PostFilterWarp";
|
||||
}
|
||||
|
||||
ViewProviderFemPostWarpVector::~ViewProviderFemPostWarpVector() {
|
||||
|
||||
}
|
||||
|
||||
void ViewProviderFemPostWarpVector::setupTaskDialog(TaskDlgPost* dlg) {
|
||||
|
||||
//add the function box
|
||||
dlg->appendBox(new TaskPostWarpVector(dlg->getView()));
|
||||
|
||||
//add the display options
|
||||
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
|
||||
}
|
||||
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostCut, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostCut::ViewProviderFemPostCut() {
|
||||
|
||||
sPixmap = "FEM_PostFilterCutFunction";
|
||||
}
|
||||
|
||||
ViewProviderFemPostCut::~ViewProviderFemPostCut() {
|
||||
|
||||
}
|
||||
|
||||
void ViewProviderFemPostCut::setupTaskDialog(TaskDlgPost* dlg) {
|
||||
|
||||
//add the function box
|
||||
dlg->appendBox(new TaskPostCut(dlg->getView(),
|
||||
&static_cast<Fem::FemPostCutFilter*>(dlg->getView()->getObject())->Function));
|
||||
|
||||
//add the display options
|
||||
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
// contours filter
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostContours, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostContours::ViewProviderFemPostContours()
|
||||
@@ -175,3 +125,72 @@ void ViewProviderFemPostContours::setupTaskDialog(TaskDlgPost* dlg)
|
||||
// the filter-specific task panel
|
||||
dlg->appendBox(new TaskPostContours(dlg->getView()));
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// cut filter
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostCut, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostCut::ViewProviderFemPostCut()
|
||||
{
|
||||
sPixmap = "FEM_PostFilterCutFunction";
|
||||
}
|
||||
|
||||
ViewProviderFemPostCut::~ViewProviderFemPostCut()
|
||||
{}
|
||||
|
||||
void ViewProviderFemPostCut::setupTaskDialog(TaskDlgPost* dlg)
|
||||
{
|
||||
//add the function box
|
||||
dlg->appendBox(new TaskPostCut(
|
||||
dlg->getView(),
|
||||
&static_cast<Fem::FemPostCutFilter*>(dlg->getView()->getObject())->Function));
|
||||
|
||||
//add the display options
|
||||
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// scalar clip filter
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostScalarClip, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostScalarClip::ViewProviderFemPostScalarClip()
|
||||
{
|
||||
sPixmap = "FEM_PostFilterClipScalar";
|
||||
}
|
||||
|
||||
ViewProviderFemPostScalarClip::~ViewProviderFemPostScalarClip() {
|
||||
|
||||
}
|
||||
|
||||
void ViewProviderFemPostScalarClip::setupTaskDialog(TaskDlgPost* dlg)
|
||||
{
|
||||
//add the function box
|
||||
dlg->appendBox(new TaskPostScalarClip(dlg->getView()));
|
||||
|
||||
//add the display options
|
||||
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// warp vector filter
|
||||
PROPERTY_SOURCE(FemGui::ViewProviderFemPostWarpVector, FemGui::ViewProviderFemPostObject)
|
||||
|
||||
ViewProviderFemPostWarpVector::ViewProviderFemPostWarpVector()
|
||||
{
|
||||
sPixmap = "FEM_PostFilterWarp";
|
||||
}
|
||||
|
||||
ViewProviderFemPostWarpVector::~ViewProviderFemPostWarpVector()
|
||||
{}
|
||||
|
||||
void ViewProviderFemPostWarpVector::setupTaskDialog(TaskDlgPost* dlg)
|
||||
{
|
||||
//add the function box
|
||||
dlg->appendBox(new TaskPostWarpVector(dlg->getView()));
|
||||
|
||||
//add the display options
|
||||
FemGui::ViewProviderFemPostObject::setupTaskDialog(dlg);
|
||||
}
|
||||
|
||||
@@ -20,30 +20,24 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FEM_VIEWPROVIDERFEMPOSTFILTER_H
|
||||
#define FEM_VIEWPROVIDERFEMPOSTFILTER_H
|
||||
|
||||
#include "ViewProviderFemPostObject.h"
|
||||
|
||||
|
||||
namespace FemGui
|
||||
{
|
||||
|
||||
class FemGuiExport ViewProviderFemPostClip : public ViewProviderFemPostObject {
|
||||
// ***************************************************************************
|
||||
// in the following, the different filters sorted alphabetically
|
||||
// ***************************************************************************
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderFemPostClip);
|
||||
|
||||
public:
|
||||
/// constructor.
|
||||
ViewProviderFemPostClip();
|
||||
~ViewProviderFemPostClip() override;
|
||||
|
||||
protected:
|
||||
void setupTaskDialog(TaskDlgPost* dlg) override;
|
||||
};
|
||||
|
||||
class FemGuiExport ViewProviderFemPostDataAlongLine : public ViewProviderFemPostObject {
|
||||
|
||||
// ***************************************************************************
|
||||
// data along line filter
|
||||
class FemGuiExport ViewProviderFemPostDataAlongLine : public ViewProviderFemPostObject
|
||||
{
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderFemPostDataAlongLine);
|
||||
|
||||
public:
|
||||
@@ -55,8 +49,11 @@ protected:
|
||||
void setupTaskDialog(TaskDlgPost* dlg) override;
|
||||
};
|
||||
|
||||
class FemGuiExport ViewProviderFemPostDataAtPoint: public ViewProviderFemPostObject {
|
||||
|
||||
// ***************************************************************************
|
||||
// data at point filter
|
||||
class FemGuiExport ViewProviderFemPostDataAtPoint: public ViewProviderFemPostObject
|
||||
{
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderFemPostDataAtPoint);
|
||||
|
||||
public:
|
||||
@@ -69,48 +66,28 @@ public:
|
||||
protected:
|
||||
void setupTaskDialog(TaskDlgPost* dlg) override;
|
||||
};
|
||||
class FemGuiExport ViewProviderFemPostScalarClip : public ViewProviderFemPostObject {
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderFemPostScalarClip);
|
||||
|
||||
// ***************************************************************************
|
||||
// clip filter
|
||||
class FemGuiExport ViewProviderFemPostClip: public ViewProviderFemPostObject
|
||||
{
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderFemPostClip);
|
||||
|
||||
public:
|
||||
/// constructor.
|
||||
ViewProviderFemPostScalarClip();
|
||||
~ViewProviderFemPostScalarClip() override;
|
||||
ViewProviderFemPostClip();
|
||||
~ViewProviderFemPostClip() override;
|
||||
|
||||
protected:
|
||||
void setupTaskDialog(TaskDlgPost* dlg) override;
|
||||
};
|
||||
|
||||
class FemGuiExport ViewProviderFemPostWarpVector : public ViewProviderFemPostObject {
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderFemPostWarpVector);
|
||||
|
||||
public:
|
||||
/// constructor.
|
||||
ViewProviderFemPostWarpVector();
|
||||
~ViewProviderFemPostWarpVector() override;
|
||||
|
||||
protected:
|
||||
void setupTaskDialog(TaskDlgPost* dlg) override;
|
||||
};
|
||||
|
||||
class FemGuiExport ViewProviderFemPostCut : public ViewProviderFemPostObject {
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderFemPostCut);
|
||||
|
||||
public:
|
||||
/// constructor.
|
||||
ViewProviderFemPostCut();
|
||||
~ViewProviderFemPostCut() override;
|
||||
|
||||
protected:
|
||||
void setupTaskDialog(TaskDlgPost* dlg) override;
|
||||
};
|
||||
|
||||
// ***************************************************************************
|
||||
// contours filter
|
||||
class FemGuiExport ViewProviderFemPostContours: public ViewProviderFemPostObject
|
||||
{
|
||||
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderFemPostContours);
|
||||
|
||||
public:
|
||||
@@ -122,6 +99,54 @@ protected:
|
||||
void setupTaskDialog(TaskDlgPost* dlg) override;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// cut filter
|
||||
class FemGuiExport ViewProviderFemPostCut: public ViewProviderFemPostObject
|
||||
{
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderFemPostCut);
|
||||
|
||||
public:
|
||||
/// constructor.
|
||||
ViewProviderFemPostCut();
|
||||
~ViewProviderFemPostCut() override;
|
||||
|
||||
protected:
|
||||
void setupTaskDialog(TaskDlgPost* dlg) override;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// scalar clip filter
|
||||
class FemGuiExport ViewProviderFemPostScalarClip: public ViewProviderFemPostObject
|
||||
{
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderFemPostScalarClip);
|
||||
|
||||
public:
|
||||
/// constructor.
|
||||
ViewProviderFemPostScalarClip();
|
||||
~ViewProviderFemPostScalarClip() override;
|
||||
|
||||
protected:
|
||||
void setupTaskDialog(TaskDlgPost* dlg) override;
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// warp vector filter
|
||||
class FemGuiExport ViewProviderFemPostWarpVector : public ViewProviderFemPostObject
|
||||
{
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderFemPostWarpVector);
|
||||
|
||||
public:
|
||||
/// constructor.
|
||||
ViewProviderFemPostWarpVector();
|
||||
~ViewProviderFemPostWarpVector() override;
|
||||
|
||||
protected:
|
||||
void setupTaskDialog(TaskDlgPost* dlg) override;
|
||||
};
|
||||
|
||||
} //namespace FemGui
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user