-
- QString resString;
- GProp_GProps System;
-
- try {
- if(S.ShapeType() == TopAbs_VERTEX || S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE)
- BRepGProp::LinearProperties(S, System);
- else if(S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL)
- BRepGProp::SurfaceProperties(S, System);
- else
- BRepGProp::VolumeProperties(S, System);
-
- gp_Mat I = System.MatrixOfInertia() ;
- GProp_PrincipalProps Pr = System.PrincipalProperties();
- Standard_Real Ix,Iy,Iz;
- Pr.Moments(Ix,Iy,Iz);
-
- /* matrix 3x3 */
- resString = tr("%1").arg(I(1,1), 12, 'f', 6);
- GroupC1->LineEdit11->setText(resString);
- resString = tr("%1").arg(I(1,2), 12, 'f', 6);
- GroupC1->LineEdit12->setText(resString);
- resString = tr("%1").arg(I(1,3), 12, 'f', 6);
- GroupC1->LineEdit13->setText(resString);
-
- resString = tr("%1").arg(I(2,1), 12, 'f', 6);
- GroupC1->LineEdit21->setText(resString);
- resString = tr("%1").arg(I(2,2), 12, 'f', 6);
- GroupC1->LineEdit22->setText(resString);
- resString = tr("%1").arg(I(2,3), 12, 'f', 6);
- GroupC1->LineEdit23->setText(resString);
-
- resString = tr("%1").arg(I(3,1), 12, 'f', 6);
- GroupC1->LineEdit31->setText(resString);
- resString = tr("%1").arg(I(3,2), 12, 'f', 6);
- GroupC1->LineEdit32->setText(resString);
- resString = tr("%1").arg(I(3,3), 12, 'f', 6);
- GroupC1->LineEdit33->setText(resString);
-
- /* moments */
- resString = tr("%1").arg(Ix, 12, 'f', 6);
- GroupC1->LineEdit41->setText(resString);
- resString = tr("%1").arg(Ix, 12, 'f', 6);
- GroupC1->LineEdit42->setText(resString);
- resString = tr("%1").arg(Iz, 12, 'f', 6);
- GroupC1->LineEdit43->setText(resString);