GEOM_Superv_i::~GEOM_Superv_i()
{
MESSAGE("GEOM_Superv_i::~GEOM_Superv_i");
+ if (!CORBA::is_nil(myBasicOp))
+ myBasicOp->Destroy();
+ if (!CORBA::is_nil(myBoolOp))
+ myBoolOp->Destroy();
+ if (!CORBA::is_nil(my3DPrimOp))
+ my3DPrimOp->Destroy();
delete name_service;
}
//============================================================================
void GEOM_Superv_i::register_name(char * name)
{
- GEOM::GEOM_Superv_ptr g = GEOM::GEOM_Superv::_narrow(POA_GEOM::GEOM_Superv::_this());
- name_service->Register(g, strdup(name));
+ GEOM::GEOM_Superv_var g = _this();
+ name_service->Register(g, name);
}
//=============================================================================
//=============================================================================
void GEOM_Superv_i::setGeomEngine()
{
+ if ( !CORBA::is_nil(myGeomEngine) )
+ return;
+
// get GEOM_Gen engine
+ Engines::Container_var cont=GetContainerRef();
+ 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( "FactoryServer", "GEOM" );
+ Engines::Component_var comp = lcc->FindOrLoad_Component( shortName.c_str(), "GEOM" );
+ delete lcc;
myGeomEngine = GEOM::GEOM_Gen::_narrow(comp);
}
return anObj;
}
+//=============================================================================
+// MakeFaceHW:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceHW (CORBA::Double theH,
+ CORBA::Double theW)
+{
+ beginService( " GEOM_Superv_i::MakeFaceHW" );
+ MESSAGE("GEOM_Superv_i::MakeFaceHW");
+ get3DPrimOp();
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFaceHW(theH, theW);
+ endService( " GEOM_Superv_i::MakeFaceHW" );
+ return anObj;
+}
+
+//=============================================================================
+// MakeFaceTwoPlaneHW:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFacePlaneHW (GEOM::GEOM_Object_ptr theFace,
+ CORBA::Double theH,
+ CORBA::Double theW)
+{
+ beginService( " GEOM_Superv_i::MakeFacePlaneHW" );
+ MESSAGE("GEOM_Superv_i::MakeFacePlaneHW");
+ get3DPrimOp();
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFacePlaneHW(theFace, theH, theW);
+ endService( " GEOM_Superv_i::MakeFacePlaneHW" );
+ 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;
+}
+
//=============================================================================
// MakeCylinderPntVecRH:
//=============================================================================
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:
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilling (GEOM::GEOM_Object_ptr theShape,
CORBA::Long theMinDeg, CORBA::Long theMaxDeg,
CORBA::Double theTol2D, CORBA::Double theTol3D,
- CORBA::Long theNbIter)
+ CORBA::Long theNbIter, CORBA::Boolean theApprox)
{
beginService( " GEOM_Superv_i::MakeFilling" );
MESSAGE("GEOM_Superv_i::MakeFilling");
get3DPrimOp();
- GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFilling(theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter);
+ GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakeFilling(theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, theApprox);
endService( " GEOM_Superv_i::MakeFilling" );
return anObj;
}
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:
//=============================================================================
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:
//=============================================================================
return aRes;
}
+
//=============================================================================
// ChangeOrientation:
//=============================================================================
}
+//=============================================================================
+// 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<GEOM::ListOfGO>* aListPtr = new GEOM_List_i<GEOM::ListOfGO>(*(aList));
+ MESSAGE(" List of "<<aListPtr->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:
const char * interfaceName)
{
GEOM_Superv_i * myGEOM_Superv_i = new GEOM_Superv_i(orb, poa, contId, instanceName, interfaceName);
- myGEOM_Superv_i->register_name("/myGEOM_Superv");
+ //Don't understand the reason why this component is registered ???
+// myGEOM_Superv_i->register_name("/myGEOM_Superv");
return myGEOM_Superv_i->getId() ;
}
}