{
QString msg;
if (isValid(msg)) {
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
try {
- theAngle = GEOM::GEOM_IMeasureOperations::_narrow(getOperation())->GetAngle(myObj, myObj2);
+ theAngle = anOper->GetAngle(myObj, myObj2);
}
catch(const SALOME::SALOME_Exception& e) {
SalomeApp_Tools::QtCatchCorbaException(e);
return false;
}
- bool isDone = getOperation()->IsDone();
+ bool isDone = anOper->IsDone();
if (!isDone) {
- CORBA::String_var aMsg = getOperation()->GetErrorCode();
+ CORBA::String_var aMsg = anOper->GetErrorCode();
SUIT_MessageBox::warning(this,
QObject::tr("WRN_WARNING"),
QObject::tr(aMsg.in()));
if ( myObj->_is_nil() )
return false;
else {
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
try {
Handle(Poly_Triangulation) Trtn = 0;
}
}
- GEOM::GEOM_IMeasureOperations::_narrow( getOperation() )->GetBoundingBox(
- myObj, theXmin, theXmax, theYmin, theYmax, theZmin, theZmax );
+ anOper->GetBoundingBox( myObj, theXmin, theXmax, theYmin, theYmax, theZmin, theZmax );
if (!Trtn.IsNull())
{
return false;
}
- return getOperation()->IsDone();
+ return anOper->IsDone();
}
}
return false;
else {
try {
- GEOM::GEOM_Object_var anObj;
- anObj = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() )->GetCentreOfMass( myObj );
- if ( !getOperation()->IsDone() )
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
+ GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj );
+ if ( !anOper->IsDone() )
return false;
TopoDS_Shape aShape;
//=================================================================================
bool MeasureGUI_CenterMassDlg::execute( ObjectList& objects )
{
- GEOM::GEOM_Object_var anObj;
-
- anObj = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() )->GetCentreOfMass( myObj );
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
+ GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
if ( myObj->_is_nil() )
return false;
else {
+ GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() );
try {
GEOM::GEOM_IBlocksOperations::BCErrors_var aErrs;
- theIsCompoundOfBlocks =
- GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->CheckCompoundOfBlocks( myObj, aErrs );
+ theIsCompoundOfBlocks = anOper->CheckCompoundOfBlocks( myObj, aErrs );
theErrors = aErrs;
}
catch ( const SALOME::SALOME_Exception& e ) {
return false;
}
- return getOperation()->IsDone();
+ return anOper->IsDone();
}
}
//=================================================================================
bool MeasureGUI_CheckCompoundOfBlocksDlg::execute( ObjectList& objects )
{
- GEOM::GEOM_Object_var anObj;
-
- anObj = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() )->CheckAndImprove( myObj );
+ GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() );
+ GEOM::GEOM_Object_var anObj = anOper->CheckAndImprove( myObj );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
if ( myObj->_is_nil() )
return false;
else {
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
try {
char* aMsg;
bool isCheckGeometry = myGrp->CheckBox1->isChecked();
- GEOM::GEOM_IMeasureOperations_ptr aMeasureOp =
- GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
if ( isCheckGeometry )
- theIsValid = aMeasureOp->CheckShapeWithGeometry( myObj, aMsg );
+ theIsValid = anOper->CheckShapeWithGeometry( myObj, aMsg );
else
- theIsValid = aMeasureOp->CheckShape( myObj, aMsg );
+ theIsValid = anOper->CheckShape( myObj, aMsg );
theMsg = aMsg;
}
catch( const SALOME::SALOME_Exception& e ) {
return false;
}
- return getOperation()->IsDone();
+ return anOper->IsDone();
}
}
{
QString msg;
if (isValid(msg)) {
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
+
try {
double x1, y1, z1, x2, y2, z2;
- theDistance = GEOM::GEOM_IMeasureOperations::_narrow(getOperation())->
- GetMinDistance(myObj, myObj2, x1, y1, z1, x2, y2, z2);
+ theDistance = anOper->GetMinDistance(myObj, myObj2, x1, y1, z1, x2, y2, z2);
thePnt1.SetCoord(x1, y1, z1);
thePnt2.SetCoord(x2, y2, z2);
return false;
}
- return getOperation()->IsDone();
+ return anOper->IsDone();
}
return false;
if ( myObj->_is_nil() )
return false;
else {
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
try {
double x, y, z;
- GEOM::GEOM_IMeasureOperations::_narrow( getOperation() )->GetInertia( myObj,
- I( 1, 1 ), I( 1, 2 ), I( 1, 3 ),
- I( 2, 1 ), I( 2, 2 ), I( 2, 3 ),
- I( 3, 1 ), I( 3, 2 ), I( 3, 3 ),
- x, y, z );
+ anOper->GetInertia( myObj,
+ I( 1, 1 ), I( 1, 2 ), I( 1, 3 ),
+ I( 2, 1 ), I( 2, 2 ), I( 2, 3 ),
+ I( 3, 1 ), I( 3, 2 ), I( 3, 3 ),
+ x, y, z );
theIXYZ.SetCoord( x, y, z );
}
return false;
}
- return getOperation()->IsDone();
+ return anOper->IsDone();
}
}
if ( myObj->_is_nil() )
return false;
else {
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
try {
- GEOM::GEOM_IMeasureOperations::_narrow( getOperation() )->GetTolerance( myObj,
- theMinFaceToler, theMaxFaceToler, theMinEdgeToler,
- theMaxEdgeToler, theMinVertexToler, theMaxVertexToler );
+ anOper->GetTolerance( myObj,
+ theMinFaceToler, theMaxFaceToler, theMinEdgeToler,
+ theMaxEdgeToler, theMinVertexToler, theMaxVertexToler );
}
catch( const SALOME::SALOME_Exception& e ) {
SalomeApp_Tools::QtCatchCorbaException( e );
return false;
}
- return getOperation()->IsDone();
+ return anOper->IsDone();
}
}
//=================================================================================
bool MeasureGUI_NormaleDlg::execute (ObjectList& objects)
{
- GEOM::GEOM_Object_var anObj =
- GEOM::GEOM_IMeasureOperations::_narrow(getOperation())->GetNormal(myFace, myPoint);
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
+ GEOM::GEOM_Object_var anObj = anOper->GetNormal(myFace, myPoint);
if (!anObj->_is_nil())
objects.push_back(anObj._retn());
if ( myObj->_is_nil() )
return false;
else {
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
try {
- GEOM::GEOM_IMeasureOperations::_narrow( getOperation() )->GetBasicProperties(
- myObj, theLength, theArea, theVolume );
+ anOper->GetBasicProperties( myObj, theLength, theArea, theVolume );
}
catch( const SALOME::SALOME_Exception& e ) {
SalomeApp_Tools::QtCatchCorbaException( e );
return false;
}
- return getOperation()->IsDone();
+ return anOper->IsDone();
}
}
if ( myObj->_is_nil() )
return false;
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
try
{
- theText = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() )->WhatIs( myObj );
+ theText = anOper->WhatIs( myObj );
}
catch( const SALOME::SALOME_Exception& e )
{
return false;
}
- return getOperation()->IsDone();
+ return anOper->IsDone();
}
//=================================================================================
GEOM::ListOfLong_var anInts;
GEOM::ListOfDouble_var aDbls;
- GEOM::GEOM_IMeasureOperations_var anOp = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
+ GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
try
{
- aKind = anOp->KindOfShape( myObj, anInts, aDbls );
+ aKind = anOper->KindOfShape( myObj, anInts, aDbls );
}
catch( const SALOME::SALOME_Exception& e ) {
SalomeApp_Tools::QtCatchCorbaException( e );
return aKindStr;
}
- if ( !anOp->IsDone() )
+ if ( !anOper->IsDone() )
return aKindStr;
#define PRINT_DOUBLE(val) QString(" %1").arg( DlgRef::PrintDoubleValue( val ) )