- GroupC1->LineEdit2->setText("");
- GroupC1->LineEdit3->setText("");
- GroupC1->LineEdit4->setText("");
-
- if(S.IsNull())
- return;
-
- Standard_Real result;
- GProp_GProps LProps, SProps;
- QString resString;
-
- try {
- BRepGProp::LinearProperties(S,LProps);
- result = LProps.Mass();
- if(!IsEqual(result, 0.0)) {
- resString = tr("%1").arg(result, 12, 'f', 6);
- GroupC1->LineEdit2->setText(resString);
- }
-
- BRepGProp::SurfaceProperties(S, SProps);
- result = SProps.Mass();
- if(!IsEqual(result, 0.0)) {
- resString = tr("%1").arg(result, 12, 'f', 6);
- GroupC1->LineEdit3->setText(resString);
- }
-
- result = 0.0;
- if(S.ShapeType() < TopAbs_SHELL) {
- for(TopExp_Explorer Exp(S,TopAbs_SOLID); Exp.More(); Exp.Next()) {
- GProp_GProps VProps;
- BRepGProp::VolumeProperties(Exp.Current(), VProps);
- result += VProps.Mass();
- }
- }
- if (!IsEqual(result, 0.0)) {
- resString = tr("%1").arg(result, 12, 'f', 6);
- GroupC1->LineEdit4->setText(resString);
- }
- }
- catch(Standard_Failure) {
- MESSAGE("Catch intercepted in CalculateAndDisplayProperties()");
- }
- return;
+ TopoDS_Shape aShape, aResult;
+
+ if ( myObj->_is_nil() ||
+ !GEOMBase::GetShape( myObj, aShape ) ||
+ aShape.IsNull() ||
+ aShape.ShapeType() != TopAbs_EDGE ||
+ !GEOMBase::CreateArrowForLinearEdge( aShape, aResult ) ||
+ aResult.IsNull() )
+ return 0;
+
+ return getDisplayer()->BuildPrs( aResult );
+