From: abn Date: Wed, 20 Jan 2016 13:36:14 +0000 (+0100) Subject: MC API change: stage #1 of renaming X-Git-Tag: V8_0_0b1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?p=samples%2Fcalculator.git;a=commitdiff_plain;h=7813c889abf5389fc924b9a199cf12bcea8a114a MC API change: stage #1 of renaming --- diff --git a/src/CALCULATOR/CALCULATOR.cxx b/src/CALCULATOR/CALCULATOR.cxx index 905a1aa..8f51e73 100644 --- a/src/CALCULATOR/CALCULATOR.cxx +++ b/src/CALCULATOR/CALCULATOR.cxx @@ -29,7 +29,7 @@ #include "MEDCouplingMeshServant.hxx" #include "MEDCouplingFieldDoubleServant.hxx" -#include "MEDCouplingAutoRefCountObjectPtr.hxx" +#include "MCAuto.hxx" #include "MEDCouplingMemArray.hxx" #include @@ -74,8 +74,8 @@ CORBA::Double CALCULATOR::norm2(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface CORBA::Double norme = 0.0; // Create a local field from corba field, apply method normMax on it. // When exiting the function, f1 is deleted, and with it the remote corba field. - MEDCoupling::MEDCouplingAutoRefCountObjectPtr f1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field1); - /*MEDCoupling::MEDCouplingAutoRefCountObjectPtr d=MEDCoupling::DataArrayDouble::Multiply(f1->getArray(),f1->getArray()); + MEDCoupling::MCAuto f1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field1); + /*MEDCoupling::MCAuto d=MEDCoupling::DataArrayDouble::Multiply(f1->getArray(),f1->getArray()); d->rearrange(1); try { norme = d->accumulate(0); @@ -110,7 +110,7 @@ CORBA::Double CALCULATOR::normL2(SALOME_MED::MEDCouplingFieldDoubleCorbaInterfac } //Check that the Field is not on the Nodes (a limitation of normL2) - MEDCoupling::MEDCouplingAutoRefCountObjectPtr f1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field1); + MEDCoupling::MCAuto f1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field1); if(f1->getTypeOfField()==MEDCoupling::ON_NODES) { @@ -149,7 +149,7 @@ CORBA::Double CALCULATOR::normMax(SALOME_MED::MEDCouplingFieldDoubleCorbaInterfa } CORBA::Double norme = 0.0; - MEDCoupling::MEDCouplingAutoRefCountObjectPtr f1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field1); + MEDCoupling::MCAuto f1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field1); try { norme = f1->normMax(); @@ -175,7 +175,7 @@ CORBA::Double CALCULATOR::normL1(SALOME_MED::MEDCouplingFieldDoubleCorbaInterfac } //Check that the Field is not on the Nodes (a limitation of normL1) - MEDCoupling::MEDCouplingAutoRefCountObjectPtr f1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field1); + MEDCoupling::MCAuto f1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field1); if (f1->getTypeOfField()==MEDCoupling::ON_NODES) { _errorCode = CALCULATOR_ORB::NOT_COMPATIBLE; return 0.0; @@ -205,7 +205,7 @@ SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr CALCULATOR::applyLin(SALOME } // create a local field on the heap, because it has to remain after exiting the function - MEDCoupling::MEDCouplingAutoRefCountObjectPtr f1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field1); + MEDCoupling::MCAuto f1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field1); int nbOfCompo=f1->getArray()->getNumberOfComponents(); f1->getArray()->rearrange(1); MEDCoupling::MEDCouplingFieldDoubleServant *NewField=NULL; @@ -244,11 +244,11 @@ SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr CALCULATOR::add(SALOME_MED: } // Create local fields from corba field - MEDCoupling::MEDCouplingAutoRefCountObjectPtr f1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field1); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr f2=MEDCoupling::MEDCouplingFieldDoubleClient::New(field2); + MEDCoupling::MCAuto f1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field1); + MEDCoupling::MCAuto f2=MEDCoupling::MEDCouplingFieldDoubleClient::New(field2); // catch exception for non compatible fields - MEDCoupling::MEDCouplingAutoRefCountObjectPtr fres; + MEDCoupling::MCAuto fres; try { f2->changeUnderlyingMesh(f1->getMesh(),0,1e-12); @@ -281,16 +281,16 @@ void CALCULATOR::cloneField(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr } // load local field, using MED ressource file pointe.med - MEDCoupling::MEDCouplingAutoRefCountObjectPtr f=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); + MEDCoupling::MCAuto f=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); // create three c++ field on the heap by copying myField_ // All this fields share with f the same SUPPORT and MESH client. // Both SUPPORT and MESH client are connected to a reference count, and will // be deleted after release of all the fields. - MEDCoupling::MEDCouplingAutoRefCountObjectPtr fc1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr fc2=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr fc3=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr fc4=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); + MEDCoupling::MCAuto fc1=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); + MEDCoupling::MCAuto fc2=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); + MEDCoupling::MCAuto fc3=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); + MEDCoupling::MCAuto fc4=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); // Initialize out references : // Create three CORBA clones with cloned c++ fields - give property of c++ fields to servant (true) @@ -320,7 +320,7 @@ void CALCULATOR::printField(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr // Create a local field from corba field. // Use auto_ptr to perform automatic deletion after usage. // The deletion of the FIELDClient will delete the remote Corba object. - MEDCoupling::MEDCouplingAutoRefCountObjectPtr myField=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); + MEDCoupling::MCAuto myField=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); cout << myField->advancedRepr() ; cout << endl; @@ -344,8 +344,8 @@ CORBA::Double CALCULATOR::convergenceCriteria(SALOME_MED::MEDCouplingFieldDouble } double criteria=1; - static MEDCoupling::MEDCouplingAutoRefCountObjectPtr fold(0); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr fnew=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); + static MEDCoupling::MCAuto fold(0); + MEDCoupling::MCAuto fnew=MEDCoupling::MEDCouplingFieldDoubleClient::New(field); try { @@ -355,7 +355,7 @@ CORBA::Double CALCULATOR::convergenceCriteria(SALOME_MED::MEDCouplingFieldDouble { // if size of fields are not equal, return 1 // catch exception for non compatible fields - MEDCoupling::MEDCouplingAutoRefCountObjectPtr fres; + MEDCoupling::MCAuto fres; try { fnew->changeUnderlyingMesh(fold->getMesh(),0,1e-12);