[FEM] fix a variable casting
- reported by MSVC not to cast a float to a double but as double directly - also remove some superfluous Boolean comparisons
This commit is contained in:
@@ -1085,7 +1085,7 @@ std::set<int> FemMesh::getEdgesOnly(void) const
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (edgeBelongsToAFace == false)
|
||||
if (!edgeBelongsToAFace)
|
||||
resultIDs.insert(aEdge->GetID());
|
||||
}
|
||||
|
||||
@@ -1144,7 +1144,7 @@ std::set<int> FemMesh::getFacesOnly(void) const
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (faceBelongsToAVolume == false)
|
||||
if (!faceBelongsToAVolume)
|
||||
resultIDs.insert(aFace->GetID());
|
||||
}
|
||||
|
||||
@@ -2172,7 +2172,7 @@ void FemMesh::writeABAQUS(const std::string &Filename, int elemParam, bool group
|
||||
anABAQUS_Output << ", " << *kt;
|
||||
}
|
||||
else {
|
||||
if (first_line == true) {
|
||||
if (first_line) {
|
||||
anABAQUS_Output << "," << std::endl;
|
||||
first_line = false;
|
||||
}
|
||||
@@ -2232,7 +2232,7 @@ void FemMesh::writeABAQUS(const std::string &Filename, int elemParam, bool group
|
||||
anABAQUS_Output << elsetname << std::endl;
|
||||
|
||||
// groups
|
||||
if (groupParam == false) {
|
||||
if (!groupParam) {
|
||||
anABAQUS_Output.close();
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -985,7 +985,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)))
|
||||
IntSet.insert(aNode->GetID());
|
||||
}
|
||||
|
||||
|
||||
@@ -449,8 +449,8 @@ void ViewProviderFemPostObject::setRangeOfColorBar(double min, double max)
|
||||
{
|
||||
try {
|
||||
if (min >= max) {
|
||||
min = max - 10 * std::numeric_limits<float>::epsilon();
|
||||
max = max + 10 * std::numeric_limits<float>::epsilon();
|
||||
min = max - 10 * std::numeric_limits<double>::epsilon();
|
||||
max = max + 10 * std::numeric_limits<double>::epsilon();
|
||||
}
|
||||
m_colorBar->setRange(min, max);
|
||||
}
|
||||
@@ -465,7 +465,6 @@ void ViewProviderFemPostObject::WriteColorData(bool ResetColorBarRange) {
|
||||
return;
|
||||
|
||||
if (Field.getEnumVector().empty() || Field.getValue() == 0) {
|
||||
|
||||
m_material->diffuseColor.setValue(SbColor(0.8, 0.8, 0.8));
|
||||
m_material->transparency.setValue(0.);
|
||||
m_materialBinding->value = SoMaterialBinding::OVERALL;
|
||||
@@ -473,7 +472,6 @@ void ViewProviderFemPostObject::WriteColorData(bool ResetColorBarRange) {
|
||||
return;
|
||||
};
|
||||
|
||||
|
||||
int array = Field.getValue() - 1; //0 is none
|
||||
vtkPolyData* pd = m_currentAlgorithm->GetOutput();
|
||||
vtkDataArray* data = pd->GetPointData()->GetArray(array);
|
||||
@@ -483,7 +481,7 @@ void ViewProviderFemPostObject::WriteColorData(bool ResetColorBarRange) {
|
||||
component = 0;
|
||||
|
||||
//build the lookuptable
|
||||
if (ResetColorBarRange == true) {
|
||||
if (ResetColorBarRange) {
|
||||
double range[2];
|
||||
data->GetRange(range, component);
|
||||
setRangeOfColorBar(range[0], range[1]);
|
||||
@@ -591,7 +589,7 @@ bool ViewProviderFemPostObject::doubleClicked(void) {
|
||||
// check if backlight is enabled
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
|
||||
bool isBackLightEnabled = hGrp->GetBool("EnableBacklight", false);
|
||||
if (isBackLightEnabled == false)
|
||||
if (!isBackLightEnabled)
|
||||
Base::Console().Error("Backlight is not enabled. Due to a VTK implementation problem you really should consider to enable backlight in FreeCAD display preferences if you work with VTK post processing.\n");
|
||||
// set edit
|
||||
Gui::Application::Instance->activeDocument()->setEdit(this, (int)ViewProvider::Default);
|
||||
|
||||
Reference in New Issue
Block a user