Mesh: Replace C cast
This commit is contained in:
committed by
Chris Hennes
parent
d239f94c3f
commit
9eadb9fbc5
@@ -490,12 +490,12 @@ const MeshObject& PropertyMeshKernel::getValue()const
|
||||
|
||||
const MeshObject* PropertyMeshKernel::getValuePtr()const
|
||||
{
|
||||
return (MeshObject*)_meshObject;
|
||||
return static_cast<MeshObject*>(_meshObject);
|
||||
}
|
||||
|
||||
const Data::ComplexGeoData* PropertyMeshKernel::getComplexData() const
|
||||
{
|
||||
return (MeshObject*)_meshObject;
|
||||
return static_cast<MeshObject*>(_meshObject);
|
||||
}
|
||||
|
||||
Base::BoundBox3d PropertyMeshKernel::getBoundingBox() const
|
||||
@@ -514,7 +514,7 @@ unsigned int PropertyMeshKernel::getMemSize () const
|
||||
MeshObject* PropertyMeshKernel::startEditing()
|
||||
{
|
||||
aboutToSetValue();
|
||||
return (MeshObject*)_meshObject;
|
||||
return static_cast<MeshObject*>(_meshObject);
|
||||
}
|
||||
|
||||
void PropertyMeshKernel::finishEditing()
|
||||
|
||||
@@ -1539,7 +1539,7 @@ void ViewProviderMesh::segmentMesh(const MeshCore::MeshKernel& toolMesh, const B
|
||||
|
||||
void ViewProviderMesh::faceInfoCallback(void * ud, SoEventCallback * n)
|
||||
{
|
||||
const SoMouseButtonEvent * mbe = (SoMouseButtonEvent *)n->getEvent();
|
||||
const SoMouseButtonEvent * mbe = static_cast<const SoMouseButtonEvent *>(n->getEvent());
|
||||
Gui::View3DInventorViewer* view = static_cast<Gui::View3DInventorViewer*>(n->getUserData());
|
||||
|
||||
// Mark all incoming mouse button events as handled, especially, to deactivate the selection node
|
||||
@@ -1621,7 +1621,7 @@ void ViewProviderMesh::faceInfoCallback(void * ud, SoEventCallback * n)
|
||||
|
||||
void ViewProviderMesh::fillHoleCallback(void * ud, SoEventCallback * n)
|
||||
{
|
||||
const SoMouseButtonEvent * mbe = (SoMouseButtonEvent *)n->getEvent();
|
||||
const SoMouseButtonEvent * mbe = static_cast<const SoMouseButtonEvent *>(n->getEvent());
|
||||
Gui::View3DInventorViewer* view = static_cast<Gui::View3DInventorViewer*>(n->getUserData());
|
||||
|
||||
// Mark all incoming mouse button events as handled, especially, to deactivate the selection node
|
||||
|
||||
@@ -541,8 +541,7 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback
|
||||
ViewProviderMeshCurvature* self = static_cast<ViewProviderMeshCurvature*>(vp);
|
||||
const SoDetail* detail = point->getDetail(point->getPath()->getTail());
|
||||
if (detail && detail->getTypeId() == SoFaceDetail::getClassTypeId()) {
|
||||
// safe downward cast, know the type
|
||||
SoFaceDetail * facedetail = (SoFaceDetail *)detail;
|
||||
const SoFaceDetail * facedetail = static_cast<const SoFaceDetail *>(detail);
|
||||
// get the curvature info of the three points of the picked facet
|
||||
int index1 = facedetail->getPoint(0)->getCoordinateIndex();
|
||||
int index2 = facedetail->getPoint(1)->getCoordinateIndex();
|
||||
@@ -576,8 +575,7 @@ void ViewProviderMeshCurvature::curvatureInfoCallback(void * ud, SoEventCallback
|
||||
ViewProviderMeshCurvature* that = static_cast<ViewProviderMeshCurvature*>(vp);
|
||||
const SoDetail* detail = point->getDetail(point->getPath()->getTail());
|
||||
if (detail && detail->getTypeId() == SoFaceDetail::getClassTypeId()) {
|
||||
// safe downward cast, know the type
|
||||
SoFaceDetail * facedetail = (SoFaceDetail *)detail;
|
||||
const SoFaceDetail * facedetail = static_cast<const SoFaceDetail *>(detail);
|
||||
// get the curvature info of the three points of the picked facet
|
||||
int index1 = facedetail->getPoint(0)->getCoordinateIndex();
|
||||
int index2 = facedetail->getPoint(1)->getCoordinateIndex();
|
||||
@@ -594,7 +592,7 @@ std::string ViewProviderMeshCurvature::curvatureInfo(bool detail, int index1, in
|
||||
App::Property* prop = pcObject->getPropertyByName("CurvInfo");
|
||||
std::stringstream str;
|
||||
if (prop && prop->getTypeId() == Mesh::PropertyCurvatureList::getClassTypeId()) {
|
||||
Mesh::PropertyCurvatureList* curv = (Mesh::PropertyCurvatureList*)prop;
|
||||
Mesh::PropertyCurvatureList* curv = static_cast<Mesh::PropertyCurvatureList*>(prop);
|
||||
const Mesh::CurvatureInfo& cVal1 = (*curv)[index1];
|
||||
const Mesh::CurvatureInfo& cVal2 = (*curv)[index2];
|
||||
const Mesh::CurvatureInfo& cVal3 = (*curv)[index3];
|
||||
|
||||
Reference in New Issue
Block a user