Base/App: fix warnings from code analysers:

* convert old-style-casts to explicit C++ casts where possible
* make some implicit conversions explicit
This commit is contained in:
wmayer
2022-03-06 23:49:30 +01:00
parent 26ece78df4
commit 4a343ab31e
30 changed files with 211 additions and 155 deletions

View File

@@ -68,7 +68,7 @@ public:
};
/// Constructor
ComplexGeoData(void);
ComplexGeoData();
/// Destructor
virtual ~ComplexGeoData();
@@ -78,7 +78,7 @@ public:
* List of different subelement types
* its NOT a list of the subelements itself
*/
virtual std::vector<const char*> getElementTypes(void) const=0;
virtual std::vector<const char*> getElementTypes() const=0;
virtual unsigned long countSubElements(const char* Type) const=0;
/// get the subelement by type and number
virtual Segment* getSubElement(const char* Type, unsigned long) const=0;
@@ -122,7 +122,7 @@ public:
* This method has to be handled by the child classes.
* the actual placement and matrix is not part of this class.
*/
virtual Base::Matrix4D getTransform(void) const = 0;
virtual Base::Matrix4D getTransform() const = 0;
//@}
/** @name Modification */
@@ -134,7 +134,7 @@ public:
/** @name Getting basic geometric entities */
//@{
/// Get the bound box
virtual Base::BoundBox3d getBoundBox(void)const=0;
virtual Base::BoundBox3d getBoundBox()const=0;
/** Get point from line object intersection */
virtual Base::Vector3d getPointFromLineIntersection(
const Base::Vector3f& base,
@@ -196,7 +196,9 @@ protected:
/// from local to outside
inline Base::Vector3d transformToOutside(const Base::Vector3f& vec) const
{
return getTransform() * Base::Vector3d(vec.x,vec.y,vec.z);
return getTransform() * Base::Vector3d(static_cast<double>(vec.x),
static_cast<double>(vec.y),
static_cast<double>(vec.z));
}
/// from local to inside
inline Base::Vector3f transformToInside(const Base::Vector3d& vec) const
@@ -204,7 +206,9 @@ protected:
Base::Matrix4D tmpM(getTransform());
tmpM.inverse();
Base::Vector3d tmp = tmpM * vec;
return Base::Vector3f((float)tmp.x,(float)tmp.y,(float)tmp.z);
return Base::Vector3f(static_cast<float>(tmp.x),
static_cast<float>(tmp.y),
static_cast<float>(tmp.z));
}
public:
mutable long Tag;