X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOM_I_Superv%2FGEOM_Superv_i.cc;h=97d7f17af36133b208b8f981c2dfa4a1f7c0abca;hb=57714d4c358d337d6d11ab08dcac22dd98a7913d;hp=520fbc2fe4bde0ec244836d3f5ab3e89d613d5fc;hpb=ab9aa28a64dc44b3f27355c95f84aee45c82df91;p=modules%2Fgeom.git diff --git a/src/GEOM_I_Superv/GEOM_Superv_i.cc b/src/GEOM_I_Superv/GEOM_Superv_i.cc index 520fbc2fe..97d7f17af 100644 --- a/src/GEOM_I_Superv/GEOM_Superv_i.cc +++ b/src/GEOM_I_Superv/GEOM_Superv_i.cc @@ -96,15 +96,15 @@ void GEOM_Superv_i::setGeomEngine() { if ( !CORBA::is_nil(myGeomEngine) ) return; - // get GEOM_Gen engine - /* - SALOME_LifeCycleCORBA* lcc = new SALOME_LifeCycleCORBA( name_service ); - Engines::Component_var comp = lcc->FindOrLoad_Component( "FactoryServer", "GEOM" ); - */ + // get GEOM_Gen engine Engines::Container_var cont=GetContainerRef(); - cont->load_component_Library("GEOM"); - Engines::Component_var comp=cont->create_component_instance("GEOM",0); + CORBA::String_var container_name=cont->name(); + std::string shortName=container_name.in(); + shortName=shortName.substr(12); // substract "/Containers/" + SALOME_LifeCycleCORBA* lcc = new SALOME_LifeCycleCORBA( name_service ); + Engines::Component_var comp = lcc->FindOrLoad_Component( shortName.c_str(), "GEOM" ); + delete lcc; myGeomEngine = GEOM::GEOM_Gen::_narrow(comp); } @@ -771,6 +771,80 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBoxTwoPnt (GEOM::GEOM_Object_ptr thePnt return anObj; } +//============================================================================= +// MakeFaceHW: +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceHW (CORBA::Double theH, + CORBA::Double theW, + CORBA::Short theOrientation) +{ + beginService( " GEOM_Superv_i::MakeFaceHW" ); + MESSAGE("GEOM_Superv_i::MakeFaceHW"); + get3DPrimOp(); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFaceHW(theH, theW, theOrientation); + endService( " GEOM_Superv_i::MakeFaceHW" ); + return anObj; +} + +//============================================================================= +// MakeFaceObjHW: +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceObjHW (GEOM::GEOM_Object_ptr theObj, + CORBA::Double theH, + CORBA::Double theW) +{ + beginService( " GEOM_Superv_i::MakeFaceObjHW" ); + MESSAGE("GEOM_Superv_i::MakeFaceObjHW"); + get3DPrimOp(); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFaceObjHW(theObj, theH, theW); + endService( " GEOM_Superv_i::MakeFaceObjHW" ); + return anObj; +} + +//============================================================================= +// MakeDiskPntVecR: +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDiskPntVecR (GEOM::GEOM_Object_ptr theCenter, + GEOM::GEOM_Object_ptr theVector, + CORBA::Double theR) +{ + beginService( " GEOM_Superv_i::MakeDiskPntVecR" ); + MESSAGE("GEOM_Superv_i::MakeDiskPntVecR"); + get3DPrimOp(); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeDiskPntVecR(theCenter, theVector, theR); + endService( " GEOM_Superv_i::MakeDiskPntVecR" ); + return anObj; +} + +//============================================================================= +// MakeDiskThreePnt: +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDiskThreePnt (GEOM::GEOM_Object_ptr thePnt1, + GEOM::GEOM_Object_ptr thePnt2, + GEOM::GEOM_Object_ptr thePnt3) +{ + beginService( " GEOM_Superv_i::MakeDiskThreePnt" ); + MESSAGE("GEOM_Superv_i::MakeDiskThreePnt"); + get3DPrimOp(); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeDiskThreePnt(thePnt1, thePnt2, thePnt3); + endService( " GEOM_Superv_i::MakeDiskThreePnt" ); + return anObj; +} + +//============================================================================= +// MakeDiskR: +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDiskR (CORBA::Double theR, + CORBA::Short theOrientation) +{ + beginService( " GEOM_Superv_i::MakeDiskR" ); + MESSAGE("GEOM_Superv_i::MakeDiskR"); + get3DPrimOp(); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeDiskR(theR, theOrientation); + endService( " GEOM_Superv_i::MakeDiskR" ); + return anObj; +} + //============================================================================= // MakeCylinderPntVecRH: //============================================================================= @@ -813,9 +887,7 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSphere (CORBA::Double theX, MESSAGE("GEOM_Superv_i::MakeSphepe"); getBasicOp(); get3DPrimOp(); - GEOM::GEOM_Object_var o = myBasicOp->MakePointXYZ(theX, theY, theZ); - GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeSpherePntR(o, theRadius); - o->Destroy(); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeSpherePntR(myBasicOp->MakePointXYZ(theX, theY, theZ), theRadius); endService( " GEOM_Superv_i::MakeSphepe" ); return anObj; } @@ -969,6 +1041,34 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismTwoPnt2Ways (GEOM::GEOM_Object_ptr return anObj; } +//============================================================================= +// MakePrismDXDYDZ: +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismDXDYDZ (GEOM::GEOM_Object_ptr theBase, + CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ) +{ + beginService( " GEOM_Superv_i::MakePrismDXDYDZ" ); + MESSAGE("GEOM_Superv_i::MakePrismDXDYDZ"); + get3DPrimOp(); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePrismDXDYDZ(theBase, theDX, theDY, theDZ); + endService( " GEOM_Superv_i::MakePrismDXDYDZ" ); + return anObj; +} + +//============================================================================= +// MakePrismDXDYDZ: +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismDXDYDZ2Ways (GEOM::GEOM_Object_ptr theBase, + CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ) +{ + beginService( " GEOM_Superv_i::MakePrismDXDYDZ2Ways" ); + MESSAGE("GEOM_Superv_i::MakePrismDXDYDZ2Ways"); + get3DPrimOp(); + GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ); + endService( " GEOM_Superv_i::MakePrismDXDYDZ2Ways" ); + return anObj; +} + //============================================================================= // MakePipe: //============================================================================= @@ -1347,6 +1447,23 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateVectorCopy (GEOM::GEOM_Object_ptr return anObj; } +//============================================================================= +// TranslateVectorDistance: +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_Superv_i::TranslateVectorDistance (GEOM::GEOM_Object_ptr theObject, + GEOM::GEOM_Object_ptr theVector, + CORBA::Double theDistance, + CORBA::Boolean theCopy) +{ + beginService( " GEOM_Superv_i::TranslateVectorDistance" ); + MESSAGE("GEOM_Superv_i::TranslateVectorDistance"); + getTransfOp(); + GEOM::GEOM_Object_ptr anObj = myTransfOp->TranslateVectorDistance(theObject, + theVector, theDistance, theCopy); + endService( " GEOM_Superv_i::TranslateVectorDistance" ); + return anObj; +} + //============================================================================= // MultiTranslate1D: //============================================================================= @@ -1619,6 +1736,42 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::ScaleShapeCopy (GEOM::GEOM_Object_ptr theOb return anObj; } +//============================================================================= +// ScaleShapeAlongAxes: +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_Superv_i::ScaleShapeAlongAxes (GEOM::GEOM_Object_ptr theObject, + GEOM::GEOM_Object_ptr thePoint, + CORBA::Double theFactorX, + CORBA::Double theFactorY, + CORBA::Double theFactorZ) +{ + beginService( " GEOM_Superv_i::ScaleShapeAlongAxes" ); + MESSAGE("GEOM_Superv_i::ScaleShapeAlongAxes"); + getTransfOp(); + GEOM::GEOM_Object_ptr anObj = myTransfOp->ScaleShapeAlongAxes + (theObject, thePoint, theFactorX, theFactorY, theFactorZ); + endService( " GEOM_Superv_i::ScaleShapeAlongAxes" ); + return anObj; +} + +//============================================================================= +// ScaleShapeAlongAxesCopy: +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_Superv_i::ScaleShapeAlongAxesCopy (GEOM::GEOM_Object_ptr theObject, + GEOM::GEOM_Object_ptr thePoint, + CORBA::Double theFactorX, + CORBA::Double theFactorY, + CORBA::Double theFactorZ) +{ + beginService( " GEOM_Superv_i::ScaleShapeAlongAxesCopy" ); + MESSAGE("GEOM_Superv_i::ScaleShapeAlongAxesCopy"); + getTransfOp(); + GEOM::GEOM_Object_ptr anObj = myTransfOp->ScaleShapeAlongAxesCopy + (theObject, thePoint, theFactorX, theFactorY, theFactorZ); + endService( " GEOM_Superv_i::ScaleShapeAlongAxesCopy" ); + return anObj; +} + //============================================================================= // PositionShape: //============================================================================= @@ -1875,6 +2028,7 @@ CORBA::Long GEOM_Superv_i::NumberOfEdges (GEOM::GEOM_Object_ptr theShape) return aRes; } + //============================================================================= // ChangeOrientation: //============================================================================= @@ -1889,6 +2043,46 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::ChangeOrientation (GEOM::GEOM_Object_ptr th } +//============================================================================= +// GetShapesOnShape: +//============================================================================= +GEOM::GEOM_List_ptr GEOM_Superv_i::GetShapesOnShape + (GEOM::GEOM_Object_ptr theCheckShape, + GEOM::GEOM_Object_ptr theShape, + CORBA::Short theShapeType, + GEOM::shape_state theState) +{ + beginService( " GEOM_Superv_i::GetShapesOnShape" ); + MESSAGE("GEOM_Superv_i::GetShapesOnShape"); + getShapesOp(); + GEOM::ListOfGO* aList = + myShapesOp->GetShapesOnShape(theCheckShape, theShape, theShapeType, theState); + GEOM_List_i* aListPtr = new GEOM_List_i(*(aList)); + MESSAGE(" List of "<GetList().length()<<" element(s)"); + endService( " GEOM_Superv_i::GetShapesOnShape" ); + return aListPtr->_this(); +} + + +//============================================================================= +// GetShapesOnShapeAsCompound: +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_Superv_i::GetShapesOnShapeAsCompound + (GEOM::GEOM_Object_ptr theCheckShape, + GEOM::GEOM_Object_ptr theShape, + CORBA::Short theShapeType, + GEOM::shape_state theState) +{ + beginService( " GEOM_Superv_i::GetShapesOnShapeAsCompound" ); + MESSAGE("GEOM_Superv_i::GetShapesOnShapeAsCompound"); + getShapesOp(); + GEOM::GEOM_Object_ptr anObj = + myShapesOp->GetShapesOnShapeAsCompound(theCheckShape, theShape, theShapeType, theState); + endService( " GEOM_Superv_i::GetShapesOnShapeAsCompound" ); + return anObj; +} + + //=============================== BlocksOperations ============================ //============================================================================= // MakeQuad4Vertices: