1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0023787: Eliminate trivial type conversion warnings in MSVC

Explicit type cast added in conversions from double to float in PrsMgr, Select3D, StdPrs, Visual3d, and Voxel.
Minor corrections in ShapeProcess and TCollection.
In Visual3d_ViewManager::ConvertCoord...(), output is initialized by zeros instead of RealLast() in case of failure.
In XmlMXCAFDoc, material density is correctly converted to string when writing to Xml.
This commit is contained in:
abv
2013-02-21 22:04:18 +04:00
parent 5788f5438f
commit 7f4c47564c
11 changed files with 33 additions and 30 deletions

View File

@@ -321,7 +321,7 @@ void Visual3d_Layer::TextSize (const Standard_CString AText, const Standard_Rea
Visual3d_LayerDefinitionError::Raise
("One primitive is already open !");
MyGraphicDriver->TextSize (AText, AHeight, aWidth, anAscent, aDescent);
MyGraphicDriver->TextSize (AText, (Standard_ShortReal)AHeight, aWidth, anAscent, aDescent);
AWidth = aWidth;
AnAscent = anAscent;
ADescent = aDescent;

View File

@@ -359,7 +359,8 @@ Standard_Real Sx, Sy, Sz;
MyCView.Orientation.IsCustomMatrix = 1;
for ( i = 0; i < 4; i++)
for ( j = 0; j < 4; j++)
MyCView.Orientation.ModelViewMatrix[i][j] = MyViewOrientation.MyModelViewMatrix->Value(i,j);
MyCView.Orientation.ModelViewMatrix[i][j] =
(Standard_ShortReal)MyViewOrientation.MyModelViewMatrix->Value(i,j);
}
else {
MyCView.Orientation.IsCustomMatrix = 0;
@@ -395,7 +396,8 @@ Standard_Real um, vm, uM, vM;
MyCView.Mapping.IsCustomMatrix = 1;
for ( i = 0; i < 4; i++)
for ( j = 0; j < 4; j++)
MyCView.Mapping.ProjectionMatrix[i][j] = MyViewMapping.MyProjectionMatrix->Value(i,j);
MyCView.Mapping.ProjectionMatrix[i][j] =
(Standard_ShortReal)MyViewMapping.MyProjectionMatrix->Value(i,j);
}
else {
MyCView.Mapping.IsCustomMatrix = 0;
@@ -1340,7 +1342,7 @@ Standard_Real um, vm, uM, vM;
for (i = 0; i < 4; i++)
for (j = 0; j < 4; j++)
MyCView.Mapping.ProjectionMatrix[i][j] =
MyViewMapping.MyProjectionMatrix->Value(i,j);
(Standard_ShortReal)MyViewMapping.MyProjectionMatrix->Value(i,j);
}
MyMatOfMapIsEvaluated = Standard_False;
@@ -1408,7 +1410,7 @@ Standard_Real um, vm, uM, vM;
for (i = 0; i < 4; i++)
for (j = 0; j < 4; j++)
MyCView.Mapping.ProjectionMatrix[i][j] =
MyViewMapping.MyProjectionMatrix->Value(i,j);
(Standard_ShortReal)MyViewMapping.MyProjectionMatrix->Value(i,j);
}
MyMatOfMapIsEvaluated = Standard_False;

View File

@@ -634,9 +634,8 @@ Graphic3d_Vertex Visual3d_ViewManager::ConvertCoord (const Handle(Aspect_Window)
Graphic3d_CView TheCView;
Graphic3d_Vertex Point;
if (! ViewExists (AWindow, TheCView))
Point.SetCoord (RealLast (), RealLast (), RealLast ());
else {
if (ViewExists (AWindow, TheCView))
{
Standard_Integer Width, Height;
Standard_ShortReal x, y, z;
Standard_Boolean Result;
@@ -753,8 +752,6 @@ Standard_Boolean BResult;
if (WCT != 0.)
Point.SetCoord (WCX/WCT, WCY/WCT, WCZ/WCT);
else
Point.SetCoord (RealLast (), RealLast (), RealLast ());
}
}
@@ -768,7 +765,7 @@ void Visual3d_ViewManager::ConvertCoordWithProj (const Handle(Aspect_Window)& AW
Graphic3d_CView TheCView;
if (! ViewExists (AWindow, TheCView)) {
Point.SetCoord (RealLast (), RealLast (), RealLast ());
Point.SetCoord (0., 0., 0.);
Proj.SetCoord (0., 0., 0.);
}
else {
@@ -893,7 +890,7 @@ Standard_Boolean BResult;
if (WCT != 0.)
Point.SetCoord (WCX/WCT, WCY/WCT, WCZ/WCT);
else
Point.SetCoord (RealLast (), RealLast (), RealLast ());
Point.SetCoord (0., 0., 0.);
// Define projection ray
NPCZ = 10.0;