FEM: code formating, replace tabulator with spaces

This commit is contained in:
Bernd Hahnebach 2016-08-15 18:19:38 +01:00 committed by wmayer
parent 55873e71bf
commit fe47ef78ab
13 changed files with 100 additions and 101 deletions

View File

@ -61,7 +61,7 @@ App::DocumentObjectExecReturn *ConstraintContact::execute(void)
const char* ConstraintContact::getViewProviderName(void) const
{
return "FemGui::ViewProviderFemConstraintContact";
return "FemGui::ViewProviderFemConstraintContact";
}
void ConstraintContact::onChanged(const App::Property* prop)

View File

@ -62,7 +62,7 @@ App::DocumentObjectExecReturn *ConstraintHeatflux::execute(void)
const char* ConstraintHeatflux::getViewProviderName(void) const
{
return "FemGui::ViewProviderFemConstraintHeatflux";
return "FemGui::ViewProviderFemConstraintHeatflux";
}
void ConstraintHeatflux::onChanged(const App::Property* prop)

View File

@ -61,7 +61,7 @@ App::DocumentObjectExecReturn *ConstraintInitialTemperature::execute(void)
const char* ConstraintInitialTemperature::getViewProviderName(void) const
{
return "FemGui::ViewProviderFemConstraintInitialTemperature";
return "FemGui::ViewProviderFemConstraintInitialTemperature";
}
void ConstraintInitialTemperature::onChanged(const App::Property* prop)

View File

@ -57,7 +57,7 @@ App::DocumentObjectExecReturn *ConstraintPlaneRotation::execute(void)
const char* ConstraintPlaneRotation::getViewProviderName(void) const
{
return "FemGui::ViewProviderFemConstraintPlaneRotation";
return "FemGui::ViewProviderFemConstraintPlaneRotation";
}
void ConstraintPlaneRotation::onChanged(const App::Property* prop)

View File

@ -61,7 +61,7 @@ App::DocumentObjectExecReturn *ConstraintTemperature::execute(void)
const char* ConstraintTemperature::getViewProviderName(void) const
{
return "FemGui::ViewProviderFemConstraintTemperature";
return "FemGui::ViewProviderFemConstraintTemperature";
}
void ConstraintTemperature::onChanged(const App::Property* prop)

View File

@ -110,7 +110,7 @@ FemMesh::~FemMesh()
FemMesh &FemMesh::operator=(const FemMesh& mesh)
{
if (this != &mesh) {
myMesh = getGenerator()->CreateMesh(0,true);
myMesh = getGenerator()->CreateMesh(0,true);
copyMeshData(mesh);
}
return *this;
@ -892,7 +892,7 @@ void FemMesh::read(const char *FileName)
}
else if (File.hasExtension("dat") ) {
// read brep-file
// vejmarie disable
// vejmarie disable
myMesh->DATToMesh(File.filePath().c_str());
}
else if (File.hasExtension("bdf") ) {

View File

@ -105,13 +105,13 @@ TaskFemConstraintContact::TaskFemConstraintContact(ViewProviderFemConstraintCont
ui->lw_referencesMaster->clear();
ui->lw_referencesSlave->clear();
if (Objects.size() > 0){
for (std::size_t i = 1; i < Objects.size(); i++) {
for (std::size_t i = 1; i < Objects.size(); i++) {
ui->lw_referencesMaster->addItem(makeRefText(Objects[i], SubElements[i]));
}
}
for (std::size_t i = 0; i < (Objects.size()-1); i++) {
for (std::size_t i = 0; i < (Objects.size()-1); i++) {
ui->lw_referencesSlave->addItem(makeRefText(Objects[i], SubElements[i]));
}
}
}
//Selection buttons
@ -149,7 +149,7 @@ void TaskFemConstraintContact::addToSelectionSlave()
std::vector<Gui::SelectionObject> selection = Gui::Selection().getSelectionEx();//gets vector of selected objects of active document
if (rows==1){
QMessageBox::warning(this, tr("Selection error"), tr("Only one master face and one slave face for a contact constraint!"));
Gui::Selection().clearSelection();
Gui::Selection().clearSelection();
return;
}
@ -160,7 +160,7 @@ void TaskFemConstraintContact::addToSelectionSlave()
if ((rows==0) && (selection.size()>=2)){
QMessageBox::warning(this, tr("Selection error"), tr("Only one slave face for a contact constraint!"));
Gui::Selection().clearSelection();
Gui::Selection().clearSelection();
return;
}
@ -176,17 +176,17 @@ void TaskFemConstraintContact::addToSelectionSlave()
std::vector<std::string> subNames=it->getSubNames();
App::DocumentObject* obj = ConstraintView->getObject()->getDocument()->getObject(it->getFeatName());
if (subNames.size()!=1){
QMessageBox::warning(this, tr("Selection error"), tr("Only one slave face for a contact constraint!"));
Gui::Selection().clearSelection();
return;
}
if (subNames.size()!=1){
QMessageBox::warning(this, tr("Selection error"), tr("Only one slave face for a contact constraint!"));
Gui::Selection().clearSelection();
return;
}
for (unsigned int subIt=0;subIt<(subNames.size());++subIt){// for every selected sub element
bool addMe=true;
if (subNames[subIt].substr(0,4) != "Face") {
QMessageBox::warning(this, tr("Selection error"), tr("Only faces can be picked"));
return;
}
if (subNames[subIt].substr(0,4) != "Face") {
QMessageBox::warning(this, tr("Selection error"), tr("Only faces can be picked"));
return;
}
for (std::vector<std::string>::iterator itr=std::find(SubElements.begin(),SubElements.end(),subNames[subIt]);
itr!= SubElements.end();
itr = std::find(++itr,SubElements.end(),subNames[subIt]))
@ -268,7 +268,7 @@ void TaskFemConstraintContact::addToSelectionMaster()
std::vector<Gui::SelectionObject> selection = Gui::Selection().getSelectionEx();//gets vector of selected objects of active document
if (rows==1){
QMessageBox::warning(this, tr("Selection error"), tr("Only one master face and one slave face for a contact constraint!"));
Gui::Selection().clearSelection();
Gui::Selection().clearSelection();
return;
}
@ -279,7 +279,7 @@ void TaskFemConstraintContact::addToSelectionMaster()
if ((rows==0) && (selection.size()>=2)){
QMessageBox::warning(this, tr("Selection error"), tr("Only one master for a contact constraint!"));
Gui::Selection().clearSelection();
Gui::Selection().clearSelection();
return;
}
@ -295,17 +295,17 @@ void TaskFemConstraintContact::addToSelectionMaster()
std::vector<std::string> subNames=it->getSubNames();
App::DocumentObject* obj = ConstraintView->getObject()->getDocument()->getObject(it->getFeatName());
if (subNames.size()!=1){
QMessageBox::warning(this, tr("Selection error"), tr("Only one master face for a contact constraint!"));
Gui::Selection().clearSelection();
return;
}
if (subNames.size()!=1){
QMessageBox::warning(this, tr("Selection error"), tr("Only one master face for a contact constraint!"));
Gui::Selection().clearSelection();
return;
}
for (unsigned int subIt=0;subIt<(subNames.size());++subIt){// for every selected sub element
bool addMe=true;
if (subNames[subIt].substr(0,4) != "Face") {
QMessageBox::warning(this, tr("Selection error"), tr("Only faces can be picked"));
return;
}
if (subNames[subIt].substr(0,4) != "Face") {
QMessageBox::warning(this, tr("Selection error"), tr("Only faces can be picked"));
return;
}
for (std::vector<std::string>::iterator itr=std::find(SubElements.begin(),SubElements.end(),subNames[subIt]);
itr!= SubElements.end();
itr = std::find(++itr,SubElements.end(),subNames[subIt]))

View File

@ -113,7 +113,7 @@ void TaskFemConstraintFixed::updateUI()
void TaskFemConstraintFixed::addToSelection()
{
std::vector<Gui::SelectionObject> selection = Gui::Selection().getSelectionEx(); //gets vector of selected objects of active document
std::vector<Gui::SelectionObject> selection = Gui::Selection().getSelectionEx(); //gets vector of selected objects of active document
if (selection.size()==0){
QMessageBox::warning(this, tr("Selection error"), tr("Nothing selected!"));
return;

View File

@ -126,22 +126,22 @@ void TaskFemConstraintPlaneRotation::addToSelection()
int rows = ui->lw_references->model()->rowCount();
if (rows==1){
QMessageBox::warning(this, tr("Selection error"), tr("Only one face can be selected for a plane rotation constraint!"));
Gui::Selection().clearSelection();
Gui::Selection().clearSelection();
return;
}
else {
std::vector<Gui::SelectionObject> selection = Gui::Selection().getSelectionEx(); //gets vector of selected objects of active document
if (selection.size()==0){
QMessageBox::warning(this, tr("Selection error"), tr("Nothing selected!"));
return;
}
Fem::ConstraintPlaneRotation* pcConstraint = static_cast<Fem::ConstraintPlaneRotation*>(ConstraintView->getObject());
std::vector<App::DocumentObject*> Objects = pcConstraint->References.getValues();
std::vector<std::string> SubElements = pcConstraint->References.getSubValues();
std::vector<Gui::SelectionObject> selection = Gui::Selection().getSelectionEx(); //gets vector of selected objects of active document
if (selection.size()==0){
QMessageBox::warning(this, tr("Selection error"), tr("Nothing selected!"));
return;
}
Fem::ConstraintPlaneRotation* pcConstraint = static_cast<Fem::ConstraintPlaneRotation*>(ConstraintView->getObject());
std::vector<App::DocumentObject*> Objects = pcConstraint->References.getValues();
std::vector<std::string> SubElements = pcConstraint->References.getSubValues();
for (std::vector<Gui::SelectionObject>::iterator it = selection.begin(); it != selection.end(); ++it){//for every selected object
if (static_cast<std::string>(it->getTypeName()).substr(0,4).compare(std::string("Part"))!=0){
for (std::vector<Gui::SelectionObject>::iterator it = selection.begin(); it != selection.end(); ++it){//for every selected object
if (static_cast<std::string>(it->getTypeName()).substr(0,4).compare(std::string("Part"))!=0){
QMessageBox::warning(this, tr("Selection error"),tr("Selected object is not a part!"));
return;
}
@ -149,49 +149,48 @@ void TaskFemConstraintPlaneRotation::addToSelection()
std::vector<std::string> subNames=it->getSubNames();
App::DocumentObject* obj = ConstraintView->getObject()->getDocument()->getObject(it->getFeatName());
if (subNames.size()==1){
for (unsigned int subIt=0;subIt<(subNames.size());++subIt){// for every selected sub element
bool addMe=true;
if ((subNames[subIt].substr(0,4) != "Face")) {
QMessageBox::warning(this, tr("Selection error"), tr("Only faces can be picked"));
return;
}
Part::Feature* feat = static_cast<Part::Feature*>(obj);
TopoDS_Shape ref = feat->Shape.getShape().getSubShape(subNames[subIt].c_str());
if ((subNames[subIt].substr(0,4) == "Face")) {
if (!Fem::Tools::isPlanar(TopoDS::Face(ref))) {
QMessageBox::warning(this, tr("Selection error"), tr("Only planar faces can be picked"));
return;
}
}
for (std::vector<std::string>::iterator itr=std::find(SubElements.begin(),SubElements.end(),subNames[subIt]);
itr!= SubElements.end();
itr = std::find(++itr,SubElements.end(),subNames[subIt]))
{// for every sub element in selection that matches one in old list
if (obj==Objects[std::distance(SubElements.begin(),itr)]){//if selected sub element's object equals the one in old list then it was added before so don't add
addMe=false;
}
}
if (addMe){
disconnect(ui->lw_references, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
this, SLOT(setSelection(QListWidgetItem*)));
Objects.push_back(obj);
SubElements.push_back(subNames[subIt]);
ui->lw_references->addItem(makeRefText(obj, subNames[subIt]));
connect(ui->lw_references, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
this, SLOT(setSelection(QListWidgetItem*)));
}
}
}
else {
QMessageBox::warning(this, tr("Selection error"), tr("Only one face can be selected for a plane rotation constraint!"));
Gui::Selection().clearSelection();
return;
}
//Update UI
pcConstraint->References.setValues(Objects,SubElements);
updateUI();
}
if (subNames.size()==1){
for (unsigned int subIt=0;subIt<(subNames.size());++subIt){// for every selected sub element
bool addMe=true;
if ((subNames[subIt].substr(0,4) != "Face")) {
QMessageBox::warning(this, tr("Selection error"), tr("Only faces can be picked"));
return;
}
Part::Feature* feat = static_cast<Part::Feature*>(obj);
TopoDS_Shape ref = feat->Shape.getShape().getSubShape(subNames[subIt].c_str());
if ((subNames[subIt].substr(0,4) == "Face")) {
if (!Fem::Tools::isPlanar(TopoDS::Face(ref))) {
QMessageBox::warning(this, tr("Selection error"), tr("Only planar faces can be picked"));
return;
}
}
for (std::vector<std::string>::iterator itr=std::find(SubElements.begin(),SubElements.end(),subNames[subIt]);
itr!= SubElements.end();
itr = std::find(++itr,SubElements.end(),subNames[subIt])){// for every sub element in selection that matches one in old list
if (obj==Objects[std::distance(SubElements.begin(),itr)]){//if selected sub element's object equals the one in old list then it was added before so don't add
addMe=false;
}
}
if (addMe){
disconnect(ui->lw_references, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
this, SLOT(setSelection(QListWidgetItem*)));
Objects.push_back(obj);
SubElements.push_back(subNames[subIt]);
ui->lw_references->addItem(makeRefText(obj, subNames[subIt]));
connect(ui->lw_references, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
this, SLOT(setSelection(QListWidgetItem*)));
}
}
}
else {
QMessageBox::warning(this, tr("Selection error"), tr("Only one face can be selected for a plane rotation constraint!"));
Gui::Selection().clearSelection();
return;
}
//Update UI
pcConstraint->References.setValues(Objects,SubElements);
updateUI();
}
}
}

View File

@ -143,10 +143,10 @@ void TaskFemConstraintPressure::addToSelection()
for (unsigned int subIt=0;subIt<(subNames.size());++subIt){// for every selected sub element
bool addMe=true;
if (subNames[subIt].substr(0,4) != "Face") {
QMessageBox::warning(this, tr("Selection error"), tr("Only faces can be picked"));
return;
}
if (subNames[subIt].substr(0,4) != "Face") {
QMessageBox::warning(this, tr("Selection error"), tr("Only faces can be picked"));
return;
}
for (std::vector<std::string>::iterator itr=std::find(SubElements.begin(),SubElements.end(),subNames[subIt]);
itr!= SubElements.end();
itr = std::find(++itr,SubElements.end(),subNames[subIt]))
@ -267,7 +267,7 @@ double TaskFemConstraintPressure::get_Pressure() const
bool TaskFemConstraintPressure::get_Reverse() const
{
return ui->checkBoxReverse->isChecked();
return ui->checkBoxReverse->isChecked();
}
/* */

View File

@ -109,7 +109,7 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
bool rotzFree = pcConstraint->rotzFree.getValue();
#ifdef USE_MULTIPLE_COPY
//OvG: always need access to cp for scaling
//OvG: always need access to cp for scaling
SoMultipleCopy* cpx = new SoMultipleCopy();
SoMultipleCopy* cpy = new SoMultipleCopy();
SoMultipleCopy* cpz = new SoMultipleCopy();

View File

@ -723,15 +723,15 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop,
SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(mesh->getValue().getSMesh())->GetMeshDS();
int numFaces = data->NbFaces();
int numNodes = data->NbNodes();
int numEdges = data->NbEdges();
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");
const SMDS_MeshInfo& info = data->GetMeshInfo();
const SMDS_MeshInfo& info = data->GetMeshInfo();
int numTria = info.NbTriangles();
int numQuad = info.NbQuadrangles();

View File

@ -164,7 +164,7 @@ void ViewProviderFemMeshPy::setNodeColor(Py::Dict arg)
//this->getViewProviderFemMeshPtr()->setColorByNodeId(NodeColorMap);
this->getViewProviderFemMeshPtr()->setColorByNodeId(NodeIds,NodeColors);
Base::Console().Log(" %f: Finish ViewProviderFemMeshPy::setNodeColor() call \n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
}
}
}
Py::Dict ViewProviderFemMeshPy::getElementColor(void) const
@ -186,7 +186,7 @@ void ViewProviderFemMeshPy::setElementColor(Py::Dict arg)
NodeColorMap[id] = App::Color(Py::Float(color[0]),Py::Float(color[1]),Py::Float(color[2]),0);
}
this->getViewProviderFemMeshPtr()->setColorByElementId(NodeColorMap);
}
}
}
Py::Dict ViewProviderFemMeshPy::getNodeDisplacement(void) const
@ -212,7 +212,7 @@ void ViewProviderFemMeshPy::setNodeDisplacement(Py::Dict arg)
}
}
this->getViewProviderFemMeshPtr()->setDisplacementByNodeId(NodeDispMap);
}
}
}
Py::List ViewProviderFemMeshPy::getHighlightedNodes(void) const