FEM: remove trailing whitespaces
This commit is contained in:
@@ -48,10 +48,10 @@ set(FemGui_MOC_HDRS
|
||||
TaskDlgCreateNodeSet.h
|
||||
TaskFemConstraint.h
|
||||
TaskFemConstraintBearing.h
|
||||
TaskFemConstraintFixed.h
|
||||
TaskFemConstraintForce.h
|
||||
TaskFemConstraintFixed.h
|
||||
TaskFemConstraintForce.h
|
||||
TaskFemConstraintPressure.h
|
||||
TaskFemConstraintGear.h
|
||||
TaskFemConstraintGear.h
|
||||
TaskFemConstraintPulley.h
|
||||
TaskFemConstraintDisplacement.h
|
||||
TaskTetParameter.h
|
||||
@@ -217,7 +217,7 @@ add_library(FemGui SHARED ${FemGui_SRCS})
|
||||
target_link_libraries(FemGui ${FemGui_LIBS})
|
||||
|
||||
|
||||
fc_target_copy_resource(FemGui
|
||||
fc_target_copy_resource(FemGui
|
||||
${CMAKE_SOURCE_DIR}/src/Mod/Fem
|
||||
${CMAKE_BINARY_DIR}/Mod/Fem
|
||||
InitGui.py
|
||||
|
||||
@@ -115,7 +115,7 @@ void CmdFemCreateAnalysis::activated(int iMsg)
|
||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
|
||||
QObject::tr("Your FreeCAD is build without NETGEN support. Meshing will not work...."));
|
||||
return;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
|
||||
|
||||
@@ -177,7 +177,7 @@ void CmdFemAddPart::activated(int iMsg)
|
||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
|
||||
QObject::tr("Your FreeCAD is build without NETGEN support. Meshing will not work...."));
|
||||
return;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
|
||||
|
||||
@@ -240,7 +240,7 @@ void CmdFemCreateSolver::activated(int iMsg)
|
||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
|
||||
QObject::tr("Your FreeCAD is build without NETGEN support. Meshing will not work...."));
|
||||
return;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Fem::FemAnalysis *Analysis;
|
||||
|
||||
@@ -615,7 +615,7 @@ void DefineNodesCallback(void * ud, SoEventCallback * n)
|
||||
const SMDS_MeshNode* aNode = aNodeIter->next();
|
||||
Base::Vector3f vec(aNode->X(),aNode->Y(),aNode->Z());
|
||||
pt2d = proj(vec);
|
||||
if (polygon.Contains(Base::Vector2D(pt2d.x, pt2d.y)) == true)
|
||||
if (polygon.Contains(Base::Vector2D(pt2d.x, pt2d.y)) == true)
|
||||
IntSet.insert(aNode->GetID());
|
||||
}
|
||||
|
||||
@@ -629,7 +629,7 @@ void DefineNodesCallback(void * ud, SoEventCallback * n)
|
||||
set << "," << *it ;
|
||||
set << "]";
|
||||
|
||||
|
||||
|
||||
Gui::Command::openCommand("Place robot");
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.addObject('Fem::FemSetNodesObject','NodeSet')");
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.ActiveObject.Nodes = %s",set.str().c_str());
|
||||
|
||||
@@ -30,15 +30,15 @@ namespace FemGui {
|
||||
class FemSelectionGate : public Gui::SelectionFilterGate
|
||||
{
|
||||
public:
|
||||
enum ElemType {
|
||||
enum ElemType {
|
||||
Nothing ,
|
||||
Node ,
|
||||
Element ,
|
||||
NodeElement
|
||||
NodeElement
|
||||
};
|
||||
|
||||
FemSelectionGate(ElemType type)
|
||||
: Gui::SelectionFilterGate((Gui::SelectionFilter*)0),Type(type)
|
||||
: Gui::SelectionFilterGate((Gui::SelectionFilter*)0),Type(type)
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#include "PreCompiled.h"
|
||||
|
||||
@@ -43,7 +43,7 @@ using namespace Gui;
|
||||
TaskAnalysisInfo::TaskAnalysisInfo(Fem::FemAnalysis *pcObject,QWidget *parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"),
|
||||
tr("Nodes set"),
|
||||
true,
|
||||
true,
|
||||
parent),
|
||||
pcObject(pcObject)
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Fem{
|
||||
class FemAnalysis;
|
||||
}
|
||||
|
||||
namespace FemGui {
|
||||
namespace FemGui {
|
||||
|
||||
class ViewProviderFemMesh;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ using namespace Gui;
|
||||
TaskCreateNodeSet::TaskCreateNodeSet(Fem::FemSetNodesObject *pcObject,QWidget *parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"),
|
||||
tr("Nodes set"),
|
||||
true,
|
||||
true,
|
||||
parent),
|
||||
pcObject(pcObject)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ TaskCreateNodeSet::TaskCreateNodeSet(Fem::FemSetNodesObject *pcObject,QWidget *p
|
||||
QObject::connect(ui->toolButton_Pick,SIGNAL(clicked()),this,SLOT(Pick()));
|
||||
QObject::connect(ui->comboBox,SIGNAL(activated (int)),this,SLOT(SwitchMethod(int)));
|
||||
|
||||
// check if the Link to the FemMesh is defined
|
||||
// check if the Link to the FemMesh is defined
|
||||
assert(pcObject->FemMesh.getValue<Fem::FemMeshObject*>());
|
||||
MeshViewProvider = dynamic_cast<ViewProviderFemMesh*>(Gui::Application::Instance->getViewProvider( pcObject->FemMesh.getValue<Fem::FemMeshObject*>()));
|
||||
assert(MeshViewProvider);
|
||||
@@ -172,7 +172,7 @@ void TaskCreateNodeSet::DefineNodes(const Base::Polygon2D &polygon,const Gui::Vi
|
||||
const SMDS_MeshNode* aNode = aNodeIter->next();
|
||||
Base::Vector3f vec(aNode->X(),aNode->Y(),aNode->Z());
|
||||
pt2d = proj(vec);
|
||||
if (polygon.Contains(Base::Vector2D(pt2d.x, pt2d.y)) == inner)
|
||||
if (polygon.Contains(Base::Vector2D(pt2d.x, pt2d.y)) == inner)
|
||||
tempSet.insert(aNode->GetID());
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class ViewProvider;
|
||||
class ViewVolumeProjection;
|
||||
}
|
||||
|
||||
namespace FemGui {
|
||||
namespace FemGui {
|
||||
|
||||
class ViewProviderFemMesh;
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ bool TaskDlgAnalysis::accept()
|
||||
// FemSetNodesObject->Nodes.setValues(param->tempSet);
|
||||
// FemSetNodesObject->recompute();
|
||||
// //Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
// //if(doc)
|
||||
// //if(doc)
|
||||
// // doc->resetEdit();
|
||||
// param->MeshViewProvider->resetHighlightNodes();
|
||||
// FemSetNodesObject->Label.setValue(name->name);
|
||||
@@ -100,7 +100,7 @@ bool TaskDlgAnalysis::reject()
|
||||
{
|
||||
//FemSetNodesObject->execute();
|
||||
// //Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
// //if(doc)
|
||||
// //if(doc)
|
||||
// // doc->resetEdit();
|
||||
//param->MeshViewProvider->resetHighlightNodes();
|
||||
//Gui::Command::abortCommand();
|
||||
|
||||
@@ -51,16 +51,16 @@ public:
|
||||
virtual bool accept();
|
||||
/// is called by the framework if the dialog is rejected (Cancel)
|
||||
virtual bool reject();
|
||||
/// is called by the framework if the user press the help button
|
||||
/// is called by the framework if the user press the help button
|
||||
virtual void helpRequested();
|
||||
|
||||
/// returns for Close and Help button
|
||||
/// returns for Close and Help button
|
||||
virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
|
||||
{ return QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply; }
|
||||
|
||||
protected:
|
||||
TaskAnalysisInfo *info;
|
||||
TaskDriver *driver;
|
||||
TaskAnalysisInfo *info;
|
||||
TaskDriver *driver;
|
||||
|
||||
Fem::FemAnalysis *FemAnalysis;
|
||||
};
|
||||
|
||||
@@ -77,7 +77,7 @@ bool TaskDlgCreateNodeSet::accept()
|
||||
FemSetNodesObject->Nodes.setValues(param->tempSet);
|
||||
FemSetNodesObject->recompute();
|
||||
//Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
//if(doc)
|
||||
//if(doc)
|
||||
// doc->resetEdit();
|
||||
param->MeshViewProvider->resetHighlightNodes();
|
||||
FemSetNodesObject->Label.setValue(name->name);
|
||||
@@ -96,7 +96,7 @@ bool TaskDlgCreateNodeSet::reject()
|
||||
{
|
||||
FemSetNodesObject->execute();
|
||||
//Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
//if(doc)
|
||||
//if(doc)
|
||||
// doc->resetEdit();
|
||||
param->MeshViewProvider->resetHighlightNodes();
|
||||
Gui::Command::abortCommand();
|
||||
|
||||
@@ -53,16 +53,16 @@ public:
|
||||
virtual bool accept();
|
||||
/// is called by the framework if the dialog is rejected (Cancel)
|
||||
virtual bool reject();
|
||||
/// is called by the framework if the user press the help button
|
||||
/// is called by the framework if the user press the help button
|
||||
virtual void helpRequested();
|
||||
|
||||
/// returns for Close and Help button
|
||||
/// returns for Close and Help button
|
||||
virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
|
||||
{ return QDialogButtonBox::Ok|QDialogButtonBox::Cancel; }
|
||||
|
||||
protected:
|
||||
TaskCreateNodeSet *param;
|
||||
TaskObjectName *name;
|
||||
TaskCreateNodeSet *param;
|
||||
TaskObjectName *name;
|
||||
|
||||
Fem::FemSetNodesObject *FemSetNodesObject;
|
||||
};
|
||||
|
||||
@@ -132,7 +132,7 @@ bool TaskDlgMeshShapeNetgen::reject()
|
||||
{
|
||||
//FemSetNodesObject->execute();
|
||||
// //Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
// //if(doc)
|
||||
// //if(doc)
|
||||
// // doc->resetEdit();
|
||||
//param->MeshViewProvider->resetHighlightNodes();
|
||||
Gui::Command::abortCommand();
|
||||
|
||||
@@ -54,15 +54,15 @@ public:
|
||||
virtual bool accept();
|
||||
/// is called by the framework if the dialog is rejected (Cancel)
|
||||
virtual bool reject();
|
||||
/// is called by the framework if the user press the help button
|
||||
/// is called by the framework if the user press the help button
|
||||
virtual void helpRequested();
|
||||
|
||||
/// returns for Close and Help button
|
||||
/// returns for Close and Help button
|
||||
virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
|
||||
{ return QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply; }
|
||||
|
||||
protected:
|
||||
TaskTetParameter *param;
|
||||
TaskTetParameter *param;
|
||||
|
||||
Fem::FemMeshShapeNetgenObject *FemMeshShapeNetgenObject;
|
||||
FemGui::ViewProviderFemMeshShapeNetgen *ViewProviderFemMeshShapeNetgen;
|
||||
|
||||
@@ -49,7 +49,7 @@ using namespace Gui;
|
||||
TaskDriver::TaskDriver(Fem::FemAnalysis *pcObject,QWidget *parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"),
|
||||
tr("Nodes set"),
|
||||
true,
|
||||
true,
|
||||
parent),
|
||||
pcObject(pcObject)
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Fem{
|
||||
|
||||
|
||||
|
||||
namespace FemGui {
|
||||
namespace FemGui {
|
||||
|
||||
|
||||
class TaskDriver : public Gui::TaskView::TaskBox
|
||||
|
||||
@@ -116,7 +116,7 @@ const std::string TaskFemConstraint::getReferences(const std::vector<std::string
|
||||
}
|
||||
|
||||
const std::string TaskFemConstraint::getScale() const //OvG: Return pre-calculated scale for constraint display
|
||||
{
|
||||
{
|
||||
std::string result;
|
||||
Fem::Constraint* pcConstraint = static_cast<Fem::Constraint*>(ConstraintView->getObject());
|
||||
result = boost::lexical_cast<std::string>(pcConstraint->Scale.getValue());
|
||||
|
||||
@@ -77,7 +77,7 @@ class TaskDlgFemConstraint : public Gui::TaskView::TaskDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
|
||||
/// is called the TaskView when the dialog is opened
|
||||
void open();
|
||||
/*
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
private Q_SLOTS:
|
||||
void onReferenceDeleted(void);
|
||||
void x_changed(double);
|
||||
void y_changed(double);
|
||||
void y_changed(double);
|
||||
void z_changed(double);
|
||||
void x_rot(double);
|
||||
void y_rot(double);
|
||||
@@ -90,7 +90,7 @@ private Q_SLOTS:
|
||||
void rotfreey(int);
|
||||
void rotfixz(int);
|
||||
void rotfreez(int);
|
||||
|
||||
|
||||
void addToSelection();
|
||||
void removeFromSelection();
|
||||
void setSelection(QListWidgetItem* item);
|
||||
@@ -102,7 +102,7 @@ private:
|
||||
//void onSelectionChanged(const Gui::SelectionChanges& msg);
|
||||
void updateUI();
|
||||
Ui_TaskFemConstraintDisplacement* ui;
|
||||
|
||||
|
||||
};
|
||||
|
||||
class TaskDlgFemConstraintDisplacement : public TaskDlgFemConstraint
|
||||
|
||||
@@ -357,7 +357,7 @@ bool TaskDlgFemConstraintForce::accept()
|
||||
|
||||
if (parameterForce->getForce()<=0)
|
||||
{
|
||||
QMessageBox::warning(parameter, tr("Input error"), tr("Please specify a force greater than 0"));
|
||||
QMessageBox::warning(parameter, tr("Input error"), tr("Please specify a force greater than 0"));
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -378,7 +378,7 @@ bool TaskDlgFemConstraintForce::accept()
|
||||
}
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %s", name.c_str(), parameterForce->getReverse() ? "True" : "False");
|
||||
|
||||
|
||||
scale = parameterForce->getScale(); //OvG: determine modified scale
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Scale = %s", name.c_str(), scale.c_str()); //OvG: implement modified scale
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ TaskFemConstraintGear::TaskFemConstraintGear(ViewProviderFemConstraint *Constrai
|
||||
ui->checkReversed->blockSignals(true);
|
||||
|
||||
// Get the feature data
|
||||
Fem::ConstraintGear* pcConstraint = static_cast<Fem::ConstraintGear*>(ConstraintView->getObject());
|
||||
Fem::ConstraintGear* pcConstraint = static_cast<Fem::ConstraintGear*>(ConstraintView->getObject());
|
||||
double dia = pcConstraint->Diameter.getValue();
|
||||
double force = pcConstraint->Force.getValue();
|
||||
double angle = pcConstraint->ForceAngle.getValue();
|
||||
|
||||
@@ -256,13 +256,13 @@ bool TaskDlgFemConstraintPressure::accept()
|
||||
try {
|
||||
if (parameterPressure->getPressure()<=0)
|
||||
{
|
||||
QMessageBox::warning(parameter, tr("Input error"), tr("Please specify a pressure greater than 0"));
|
||||
QMessageBox::warning(parameter, tr("Input error"), tr("Please specify a pressure greater than 0"));
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Pressure = %f",
|
||||
name.c_str(), parameterPressure->getPressure());
|
||||
name.c_str(), parameterPressure->getPressure());
|
||||
}
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %s",
|
||||
name.c_str(), parameterPressure->getReverse() ? "True" : "False");
|
||||
|
||||
@@ -46,7 +46,7 @@ using namespace Gui;
|
||||
TaskObjectName::TaskObjectName(App::DocumentObject *pcObject,QWidget *parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("fem-fem-mesh-create-node-by-poly"),
|
||||
tr("TaskObjectName"),
|
||||
true,
|
||||
true,
|
||||
parent),
|
||||
pcObject(pcObject)
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Gui {
|
||||
class ViewProvider;
|
||||
}
|
||||
|
||||
namespace FemGui {
|
||||
namespace FemGui {
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
private Q_SLOTS:
|
||||
void TextChanged ( const QString &);
|
||||
|
||||
|
||||
protected:
|
||||
App::DocumentObject *pcObject;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Fem{
|
||||
class FemMeshShapeNetgenObject;
|
||||
}
|
||||
|
||||
namespace FemGui {
|
||||
namespace FemGui {
|
||||
|
||||
class ViewProviderFemMeshShapeNetgen;
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
ViewProviderFemMeshShapeNetgen * MeshViewProvider;
|
||||
void setInfo(void);
|
||||
|
||||
bool touched;
|
||||
bool touched;
|
||||
|
||||
private Q_SLOTS:
|
||||
void SwitchMethod(int Value);
|
||||
|
||||
@@ -112,7 +112,7 @@ bool ViewProviderFemAnalysis::setEdit(int ModNum)
|
||||
// if (padDlg)
|
||||
// Gui::Control().showDialog(padDlg);
|
||||
// else
|
||||
|
||||
|
||||
//Fem::FemAnalysis* pcAna = static_cast<Fem::FemAnalysis*>(this->getObject());
|
||||
//Gui::Control().showDialog(new TaskDlgAnalysis(pcAna));
|
||||
//return true;
|
||||
@@ -137,11 +137,11 @@ void ViewProviderFemAnalysis::unsetEdit(int ModNum)
|
||||
bool ViewProviderFemAnalysis::onDelete(const std::vector<std::string> &)
|
||||
{
|
||||
//// get the support and Sketch
|
||||
//PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(getObject());
|
||||
//PartDesign::Pad* pcPad = static_cast<PartDesign::Pad*>(getObject());
|
||||
//Sketcher::SketchObject *pcSketch = 0;
|
||||
//App::DocumentObject *pcSupport = 0;
|
||||
//if (pcPad->Sketch.getValue()){
|
||||
// pcSketch = static_cast<Sketcher::SketchObject*>(pcPad->Sketch.getValue());
|
||||
// pcSketch = static_cast<Sketcher::SketchObject*>(pcPad->Sketch.getValue());
|
||||
// pcSupport = pcSketch->Support.getValue();
|
||||
//}
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ std::string ViewProviderFemConstraint::gethideMeshShowPartStr()
|
||||
|
||||
bool ViewProviderFemConstraint::setEdit(int ModNum)
|
||||
{
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"%s",ViewProviderFemConstraint::gethideMeshShowPartStr().c_str());
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"%s",ViewProviderFemConstraint::gethideMeshShowPartStr().c_str());
|
||||
return Gui::ViewProviderGeometryObject::setEdit(ModNum);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
|
||||
std::vector<App::DocumentObject*> claimChildren(void)const;
|
||||
void setupContextMenu(QMenu*, QObject*, const char*);
|
||||
|
||||
|
||||
static std::string gethideMeshShowPartStr();
|
||||
static std::string gethideMeshShowPartStr(const std::string showConstr);
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ void ViewProviderFemConstraintBearing::updateData(const App::Property* prop)
|
||||
pShapeSep->removeAllChildren();
|
||||
|
||||
// This should always point outside of the cylinder
|
||||
Base::Vector3d normal = pcConstraint->NormalDirection.getValue();
|
||||
Base::Vector3d normal = pcConstraint->NormalDirection.getValue();
|
||||
Base::Vector3d base = pcConstraint->BasePoint.getValue();
|
||||
double radius = pcConstraint->Radius.getValue();
|
||||
base = base + radius * normal;
|
||||
|
||||
@@ -120,22 +120,22 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
|
||||
// Set up the nodes
|
||||
cpx->matrix.setNum(0);
|
||||
cpx->addChild((SoNode*)createDisplacement(scaledheight, scaledwidth)); //OvG: Scaling
|
||||
|
||||
|
||||
cpy->matrix.setNum(0);
|
||||
cpy->addChild((SoNode*)createDisplacement(scaledheight, scaledwidth)); //OvG: Scaling
|
||||
|
||||
|
||||
cpz->matrix.setNum(0);
|
||||
cpz->addChild((SoNode*)createDisplacement(scaledheight, scaledwidth)); //OvG: Scaling
|
||||
|
||||
|
||||
cprotx->matrix.setNum(0);
|
||||
cprotx->addChild((SoNode*)createRotation(scaledheight, scaledwidth)); //OvG: Scaling
|
||||
|
||||
|
||||
cproty->matrix.setNum(0);
|
||||
cproty->addChild((SoNode*)createRotation(scaledheight, scaledwidth)); //OvG: Scaling
|
||||
|
||||
|
||||
cprotz->matrix.setNum(0);
|
||||
cprotz->addChild((SoNode*)createRotation(scaledheight, scaledwidth)); //OvG: Scaling
|
||||
|
||||
|
||||
pShapeSep->addChild(cpx);
|
||||
pShapeSep->addChild(cpy);
|
||||
pShapeSep->addChild(cpz);
|
||||
@@ -156,27 +156,27 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
|
||||
cpx = static_cast<SoMultipleCopy*>(pShapeSep->getChild(0));
|
||||
cpx->matrix.setNum(points.size());
|
||||
SbMatrix* matricesx = cpx->matrix.startEditing();
|
||||
|
||||
|
||||
cpy = static_cast<SoMultipleCopy*>(pShapeSep->getChild(1));
|
||||
cpy->matrix.setNum(points.size());
|
||||
SbMatrix* matricesy = cpy->matrix.startEditing();
|
||||
|
||||
|
||||
cpz = static_cast<SoMultipleCopy*>(pShapeSep->getChild(2));
|
||||
cpz->matrix.setNum(points.size());
|
||||
SbMatrix* matricesz = cpz->matrix.startEditing();
|
||||
|
||||
|
||||
cprotx = static_cast<SoMultipleCopy*>(pShapeSep->getChild(3));
|
||||
cprotx->matrix.setNum(points.size());
|
||||
SbMatrix* matricesrotx = cprotx->matrix.startEditing();
|
||||
|
||||
|
||||
cproty = static_cast<SoMultipleCopy*>(pShapeSep->getChild(4));
|
||||
cproty->matrix.setNum(points.size());
|
||||
SbMatrix* matricesroty = cproty->matrix.startEditing();
|
||||
|
||||
|
||||
cprotz = static_cast<SoMultipleCopy*>(pShapeSep->getChild(5));
|
||||
cprotz->matrix.setNum(points.size());
|
||||
SbMatrix* matricesrotz = cprotz->matrix.startEditing();
|
||||
|
||||
|
||||
int idx = 0;
|
||||
int idy = 0;
|
||||
int idz = 0;
|
||||
@@ -222,7 +222,7 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
|
||||
matricesz[idz] = mz;
|
||||
idz++;
|
||||
}
|
||||
|
||||
|
||||
//OvG: Rotation indication
|
||||
if(!rotxFree)
|
||||
{
|
||||
@@ -268,7 +268,7 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
|
||||
createDisplacement(sepz, scaledheight, scaledwidth); //OvG: Scaling
|
||||
pShapeSep->addChild(sepz);
|
||||
}
|
||||
|
||||
|
||||
//OvG: Rotation indication
|
||||
if(!rotxFree)
|
||||
{
|
||||
@@ -303,7 +303,7 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
|
||||
cprotz->matrix.finishEditing();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// Gets called whenever a property of the attached object changes
|
||||
ViewProviderFemConstraint::updateData(prop);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ bool ViewProviderFemConstraintPressure::setEdit(int ModNum)
|
||||
}
|
||||
|
||||
#define ARROWLENGTH (4)
|
||||
#define ARROWHEADRADIUS (ARROWLENGTH/3)
|
||||
#define ARROWHEADRADIUS (ARROWLENGTH/3)
|
||||
//#define USE_MULTIPLE_COPY //OvG: MULTICOPY fails to update scaled arrows on initial drawing - so disable
|
||||
|
||||
void ViewProviderFemConstraintPressure::updateData(const App::Property* prop)
|
||||
@@ -119,7 +119,7 @@ void ViewProviderFemConstraintPressure::updateData(const App::Property* prop)
|
||||
}
|
||||
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
|
||||
|
||||
#ifdef USE_MULTIPLE_COPY
|
||||
#ifdef USE_MULTIPLE_COPY
|
||||
cp = static_cast<SoMultipleCopy*>(pShapeSep->getChild(0)); //OvG: Use top cp
|
||||
cp->matrix.setNum(points.size());
|
||||
SbMatrix* matrices = cp->matrix.startEditing();
|
||||
|
||||
@@ -73,7 +73,7 @@ using namespace FemGui;
|
||||
struct FemFace
|
||||
{
|
||||
const SMDS_MeshNode *Nodes[8];
|
||||
unsigned long ElementNumber;
|
||||
unsigned long ElementNumber;
|
||||
const SMDS_MeshElement* Element;
|
||||
unsigned short Size;
|
||||
unsigned short FaceNo;
|
||||
@@ -103,7 +103,7 @@ Base::Vector3d FemFace::set(short size,const SMDS_MeshElement* element,unsigned
|
||||
Nodes[7] = n8;
|
||||
|
||||
Element = element;
|
||||
ElementNumber = id;
|
||||
ElementNumber = id;
|
||||
Size = size;
|
||||
FaceNo = faceNo;
|
||||
hide = false;
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
//FemFaceGridItem(void){reserve(200);}
|
||||
};
|
||||
|
||||
bool FemFace::isSameFace (FemFace &face)
|
||||
bool FemFace::isSameFace (FemFace &face)
|
||||
{
|
||||
// the same element can not have the same face
|
||||
if(face.ElementNumber == ElementNumber)
|
||||
@@ -266,7 +266,7 @@ void ViewProviderFemMesh::attach(App::DocumentObject *pcObj)
|
||||
SoMaterial *pcAnoMaterial = new SoMaterial;
|
||||
pcAnoMaterial->diffuseColor.setValue(0,1,0);
|
||||
pcAnoMaterial->emissiveColor.setValue(0,1,0);
|
||||
pcAnotRoot->addChild(pcAnoMaterial);
|
||||
pcAnotRoot->addChild(pcAnoMaterial);
|
||||
pcAnotRoot->addChild(pcAnoStyle);
|
||||
pcAnotRoot->addChild(pcAnoCoords);
|
||||
SoPointSet *pointset = new SoPointSet;
|
||||
@@ -299,7 +299,7 @@ void ViewProviderFemMesh::attach(App::DocumentObject *pcObj)
|
||||
|
||||
// Points
|
||||
SoGroup* pcPointsRoot = new SoSeparator();
|
||||
pcPointsRoot->addChild(pcPointMaterial);
|
||||
pcPointsRoot->addChild(pcPointMaterial);
|
||||
pcPointsRoot->addChild(pcPointStyle);
|
||||
pcPointsRoot->addChild(pcCoords);
|
||||
pointset = new SoPointSet;
|
||||
@@ -501,7 +501,7 @@ PyObject * ViewProviderFemMesh::getPyObject()
|
||||
// ref counter is set to 1
|
||||
PythonObject = Py::Object(new ViewProviderFemMeshPy(this),true);
|
||||
}
|
||||
return Py::new_reference_to(PythonObject);
|
||||
return Py::new_reference_to(PythonObject);
|
||||
}
|
||||
|
||||
void ViewProviderFemMesh::setColorByNodeId(const std::map<long,App::Color> &NodeColorMap)
|
||||
@@ -519,7 +519,7 @@ void ViewProviderFemMesh::setColorByNodeId(const std::map<long,App::Color> &Node
|
||||
void ViewProviderFemMesh::setColorByNodeId(const std::vector<long> &NodeIds,const std::vector<App::Color> &NodeColors)
|
||||
{
|
||||
|
||||
long startId = *(std::min_element(NodeIds.begin(), NodeIds.end()));
|
||||
long startId = *(std::min_element(NodeIds.begin(), NodeIds.end()));
|
||||
long endId = *(std::max_element(NodeIds.begin(), NodeIds.end()));
|
||||
|
||||
std::vector<App::Color> colorVec(endId-startId+2,App::Color(0,1,0));
|
||||
@@ -574,7 +574,7 @@ void ViewProviderFemMesh::setDisplacementByNodeId(const std::map<long,Base::Vect
|
||||
|
||||
void ViewProviderFemMesh::setDisplacementByNodeId(const std::vector<long> &NodeIds,const std::vector<Base::Vector3d> &NodeDisps)
|
||||
{
|
||||
long startId = *(std::min_element(NodeIds.begin(), NodeIds.end()));
|
||||
long startId = *(std::min_element(NodeIds.begin(), NodeIds.end()));
|
||||
long endId = *(std::max_element(NodeIds.begin(), NodeIds.end()));
|
||||
|
||||
std::vector<Base::Vector3d> vecVec(endId-startId+2,Base::Vector3d());
|
||||
@@ -709,12 +709,12 @@ inline unsigned long ElemFold(unsigned long Element,unsigned long FaceNbr)
|
||||
return t2;
|
||||
}
|
||||
|
||||
void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||
SoCoordinate3* coords,
|
||||
void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||
SoCoordinate3* coords,
|
||||
SoIndexedFaceSet* faces,
|
||||
SoIndexedLineSet* lines,
|
||||
std::vector<unsigned long> &vFaceElementIdx,
|
||||
std::vector<unsigned long> &vNodeElementIdx,
|
||||
SoIndexedLineSet* lines,
|
||||
std::vector<unsigned long> &vFaceElementIdx,
|
||||
std::vector<unsigned long> &vNodeElementIdx,
|
||||
bool &onlyEdges,
|
||||
bool ShowInner) const
|
||||
{
|
||||
@@ -726,7 +726,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||
int numFaces = data->NbFaces();
|
||||
int numNodes = data->NbNodes();
|
||||
int numEdges = data->NbEdges();
|
||||
|
||||
|
||||
if(numFaces+numNodes+numEdges == 0) return;
|
||||
Base::TimeInfo Start;
|
||||
Base::Console().Log("Start: ViewProviderFEMMeshBuilder::createMesh() =================================\n");
|
||||
@@ -734,7 +734,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||
const SMDS_MeshInfo& info = data->GetMeshInfo();
|
||||
int numTria = info.NbTriangles();
|
||||
int numQuad = info.NbQuadrangles();
|
||||
|
||||
|
||||
int numVolu = info.NbVolumes();
|
||||
int numTetr = info.NbTetras();
|
||||
int numHexa = info.NbHexas();
|
||||
@@ -757,7 +757,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||
if (numFaces <= 0 && numVolu <= 0 && numEdges > 0){
|
||||
onlyEdges = true;
|
||||
}
|
||||
|
||||
|
||||
std::vector<FemFace> facesHelper(numTries);
|
||||
|
||||
Base::Console().Log(" %f: Start build up %i face helper\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()),facesHelper.size());
|
||||
@@ -841,7 +841,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||
BndBox.Add(facesHelper[i++].set(4, aVol, aVol->GetID(), 4, aVol->GetNode(1), aVol->GetNode(4), aVol->GetNode(5), aVol->GetNode(2)));
|
||||
BndBox.Add(facesHelper[i++].set(4, aVol, aVol->GetID(), 5, aVol->GetNode(2), aVol->GetNode(5), aVol->GetNode(3), aVol->GetNode(0)));
|
||||
break;
|
||||
//hexa8 volume
|
||||
//hexa8 volume
|
||||
case 8:
|
||||
// face 1 = N1, N2, N3, N4
|
||||
// face 2 = N5, N8, N7, N6
|
||||
@@ -919,7 +919,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||
|
||||
if( FaceSize < 5000){
|
||||
Base::Console().Log(" %f: Start eliminate internal faces SIMPLE\n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
|
||||
|
||||
|
||||
// search for double (inside) faces and hide them
|
||||
if(!ShowInner){
|
||||
for(int l=0; l< FaceSize;l++){
|
||||
@@ -972,7 +972,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||
|
||||
if(iX >= NbrX || iY >= NbrY || iZ >= NbrZ)
|
||||
Base::Console().Log(" Outof range!\n");
|
||||
|
||||
|
||||
Grid[iX + iY*NbrX + iZ*NbrX*NbrY].push_back(&facesHelper[l]);
|
||||
}
|
||||
|
||||
@@ -991,7 +991,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||
avg += it->size();
|
||||
}
|
||||
avg = avg/Grid.size();
|
||||
|
||||
|
||||
Base::Console().Log(" VoxelSize: Max:%i ,Average:%i\n",max,avg);
|
||||
|
||||
} //if( FaceSize < 1000)
|
||||
@@ -1058,7 +1058,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
|
||||
}
|
||||
}
|
||||
Base::Console().Log(" NumTriangles:%i\n",triangleCount);
|
||||
// edge map collect and sort edges of the faces to be shown.
|
||||
// edge map collect and sort edges of the faces to be shown.
|
||||
std::map<int,std::set<int> > EdgeMap;
|
||||
|
||||
// handling the corner case beams only, means no faces/triangles only nodes and edges
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
#include <CXX/Objects.hxx>
|
||||
|
||||
class SoCoordinate3;
|
||||
class SoDrawStyle;
|
||||
class SoIndexedFaceSet;
|
||||
class SoIndexedLineSet;
|
||||
class SoDrawStyle;
|
||||
class SoIndexedFaceSet;
|
||||
class SoIndexedLineSet;
|
||||
class SoShapeHints;
|
||||
class SoMaterialBinding;
|
||||
|
||||
@@ -45,8 +45,8 @@ public:
|
||||
ViewProviderFEMMeshBuilder(){}
|
||||
virtual ~ViewProviderFEMMeshBuilder(){}
|
||||
virtual void buildNodes(const App::Property*, std::vector<SoNode*>&) const;
|
||||
void createMesh(const App::Property*,
|
||||
SoCoordinate3*,
|
||||
void createMesh(const App::Property*,
|
||||
SoCoordinate3*,
|
||||
SoIndexedFaceSet*,
|
||||
SoIndexedLineSet*,
|
||||
std::vector<unsigned long>&,
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
/** @name Selection handling
|
||||
* This group of methodes do the selection handling.
|
||||
* Here you can define how the selection for your ViewProvider
|
||||
* works.
|
||||
* works.
|
||||
*/
|
||||
//@{
|
||||
/// indicates if the ViewProvider use the new Selection model
|
||||
@@ -94,10 +94,10 @@ public:
|
||||
virtual std::vector<Base::Vector3d> getSelectionShape(const char* Element) const;
|
||||
//@}
|
||||
|
||||
// interface methodes
|
||||
// interface methodes
|
||||
void setHighlightNodes(const std::set<long>&);
|
||||
void resetHighlightNodes(void);
|
||||
|
||||
|
||||
/** @name Postprocessing
|
||||
* this interfaces apply post processing stuff to the View-
|
||||
* Provider. They can override the positioning and the color
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
|
||||
<PythonExport
|
||||
Father="ViewProviderPy"
|
||||
Name="ViewProviderFemMeshPy"
|
||||
Twin="ViewProviderFemMesh"
|
||||
TwinPointer="ViewProviderFemMesh"
|
||||
Include="Mod/Fem/Gui/ViewProviderFemMesh.h"
|
||||
Namespace="FemGui"
|
||||
FatherInclude="Gui/ViewProviderPy.h"
|
||||
<PythonExport
|
||||
Father="ViewProviderPy"
|
||||
Name="ViewProviderFemMeshPy"
|
||||
Twin="ViewProviderFemMesh"
|
||||
TwinPointer="ViewProviderFemMesh"
|
||||
Include="Mod/Fem/Gui/ViewProviderFemMesh.h"
|
||||
Namespace="FemGui"
|
||||
FatherInclude="Gui/ViewProviderPy.h"
|
||||
FatherNamespace="Gui"
|
||||
Constructor="false"
|
||||
Delete="false">
|
||||
|
||||
@@ -44,8 +44,8 @@ App::Color calcColor(double value,double min, double max)
|
||||
if (max < 0) max = 0;
|
||||
if (min > 0) min = 0;
|
||||
|
||||
if (value < min)
|
||||
return App::Color (0.0,0.0,1.0);
|
||||
if (value < min)
|
||||
return App::Color (0.0,0.0,1.0);
|
||||
if (value > max)
|
||||
return App::Color (1.0,0.0,0.0);
|
||||
if (value == 0.0)
|
||||
@@ -281,7 +281,7 @@ PyObject *ViewProviderFemMeshPy::getCustomAttributes(const char* /*attr*/) const
|
||||
|
||||
int ViewProviderFemMeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,5 +43,5 @@ ViewProviderFemMeshShape::ViewProviderFemMeshShape()
|
||||
|
||||
ViewProviderFemMeshShape::~ViewProviderFemMeshShape()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
#include <Gui/ViewProviderPythonFeature.h>
|
||||
|
||||
class SoCoordinate3;
|
||||
class SoDrawStyle;
|
||||
class SoIndexedFaceSet;
|
||||
class SoIndexedLineSet;
|
||||
class SoDrawStyle;
|
||||
class SoIndexedFaceSet;
|
||||
class SoIndexedLineSet;
|
||||
class SoShapeHints;
|
||||
class SoMaterialBinding;
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
||||
<< "Fem_ConstraintForce"
|
||||
<< "Fem_ConstraintPressure"
|
||||
<< "Fem_ConstraintBearing"
|
||||
<< "Fem_ConstraintGear"
|
||||
<< "Fem_ConstraintGear"
|
||||
<< "Fem_ConstraintPulley"
|
||||
<< "Separator"
|
||||
<< "Fem_SolverJobControl"
|
||||
@@ -102,7 +102,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
|
||||
<< "Fem_ConstraintForce"
|
||||
<< "Fem_ConstraintPressure"
|
||||
<< "Fem_ConstraintBearing"
|
||||
<< "Fem_ConstraintGear"
|
||||
<< "Fem_ConstraintGear"
|
||||
<< "Fem_ConstraintPulley"
|
||||
<< "Separator"
|
||||
<< "Fem_SolverJobControl"
|
||||
|
||||
@@ -47,4 +47,4 @@ protected:
|
||||
} // namespace FemGui
|
||||
|
||||
|
||||
#endif // IMAGE_WORKBENCH_H
|
||||
#endif // IMAGE_WORKBENCH_H
|
||||
|
||||
Reference in New Issue
Block a user