-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
return TopoDS_Shape();
}
-static std::string getShapeNameByID (const char* theID)
-{
- if ( theID && strlen( theID ) > 0 ) {
- SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
- if ( !aStudy->_is_nil() ) {
- SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID(theID);
- if ( !aSObj->_is_nil() ) {
- CORBA::String_var name = aSObj->GetName();
- return name.in();
- }
- }
- }
- return "";
-}
+// static std::string getShapeNameByID (const char* theID)
+// {
+// if ( theID && strlen( theID ) > 0 ) {
+// SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
+// SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
+// if ( !aStudy->_is_nil() ) {
+// SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID(theID);
+// if ( !aSObj->_is_nil() ) {
+// CORBA::String_var name = aSObj->GetName();
+// return name.in();
+// }
+// }
+// }
+// return "";
+// }
/*
FUNCTORS
SMESH::Length2D::Values* Length2D_i::GetValues()
{
- INFOS("Length2D_i::GetValues");
SMESH::Controls::Length2D::TValues aValues;
(dynamic_cast<SMESH::Controls::Length2D*>(myFunctorPtr.get()))->GetValues( aValues );
aValue.myPnt2 = aVal.myPntId[ 1 ];
}
- INFOS("Length2D_i::GetValuess~");
return aResult._retn();
}
SMESH::MultiConnection2D::Values* MultiConnection2D_i::GetValues()
{
- INFOS("MultiConnection2D_i::GetValues");
SMESH::Controls::MultiConnection2D::MValues aValues;
(dynamic_cast<SMESH::Controls::MultiConnection2D*>(myFunctorPtr.get()))->GetValues( aValues );
aValue.myNbConnects = (*anIter).second;
}
- INFOS("Multiconnection2D_i::GetValuess~");
return aResult._retn();
}
CORBA::Object_var obj = SMESH_Gen_i::GetORB()->string_to_object( myID.c_str() );
SetGroup( SMESH::SMESH_GroupBase::_narrow( obj ));
}
- else if ( strncmp( ":0", myID.c_str(), 2 ) == 0 ) // transient mode + GUI
+ else if ( strncmp( "0:", myID.c_str(), 2 ) == 0 ) // transient mode + GUI
{
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
BelongToGeom_i::~BelongToGeom_i()
{
- delete myShapeName;
- delete myShapeID;
+ CORBA::string_free( myShapeName );
+ CORBA::string_free( myShapeID );
}
void BelongToGeom_i::SetGeom( GEOM::GEOM_Object_ptr theGeom )
void BelongToGeom_i::SetShapeName( const char* theName )
{
- delete myShapeName;
- myShapeName = strdup( theName );
+ CORBA::string_free( myShapeName );
+ myShapeName = CORBA::string_dup( theName );
myBelongToGeomPtr->SetGeom( getShapeByName( myShapeName ) );
TPythonDump()<<this<<".SetShapeName('"<<theName<<"')";
}
void BelongToGeom_i::SetShape( const char* theID, const char* theName )
{
- delete myShapeName;
- delete myShapeID;
- myShapeName = strdup( theName );
- myShapeID = strdup( theID );
+ CORBA::string_free( myShapeName );
+ CORBA::string_free( myShapeID );
+ myShapeName = CORBA::string_dup( theName );
+ myShapeID = CORBA::string_dup( theID );
bool hasName = ( theName && theName[0] );
bool hasID = ( theID && theID[0] );
BelongToSurface_i::~BelongToSurface_i()
{
- delete myShapeName;
- delete myShapeID;
+ CORBA::string_free( myShapeName );
+ CORBA::string_free( myShapeID );
}
void BelongToSurface_i::SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType )
void BelongToSurface_i::SetShapeName( const char* theName, ElementType theType )
{
- delete myShapeName;
- myShapeName = strdup( theName );
+ CORBA::string_free( myShapeName );
+ myShapeName = CORBA::string_dup( theName );
myElementsOnSurfacePtr->SetSurface( getShapeByName( myShapeName ), (SMDSAbs_ElementType)theType );
TPythonDump()<<this<<".SetShapeName('"<<theName<<"',"<<theType<<")";
}
void BelongToSurface_i::SetShape( const char* theID, const char* theName, ElementType theType )
{
- delete myShapeName;
- delete myShapeID;
- myShapeName = strdup( theName );
- myShapeID = strdup( theID );
+ CORBA::string_free( myShapeName );
+ CORBA::string_free( myShapeID );
+ myShapeName = CORBA::string_dup( theName );
+ myShapeID = CORBA::string_dup( theID );
bool hasName = ( theName && theName[0] );
bool hasID = ( theID && theID[0] );
LyingOnGeom_i::~LyingOnGeom_i()
{
- delete myShapeName;
- delete myShapeID;
+ CORBA::string_free( myShapeName );
+ CORBA::string_free( myShapeID );
}
void LyingOnGeom_i::SetGeom( GEOM::GEOM_Object_ptr theGeom )
void LyingOnGeom_i::SetShapeName( const char* theName )
{
- delete myShapeName;
- myShapeName = strdup( theName );
+ CORBA::string_free( myShapeName );
+ myShapeName = CORBA::string_dup( theName );
myLyingOnGeomPtr->SetGeom( getShapeByName( myShapeName ) );
TPythonDump()<<this<<".SetShapeName('"<<theName<<"')";
}
void LyingOnGeom_i::SetShape( const char* theID, const char* theName )
{
- delete myShapeName;
- delete myShapeID;
- myShapeName = strdup( theName );
- myShapeID = strdup( theID );
+ CORBA::string_free( myShapeName );
+ CORBA::string_free( myShapeID );
+ myShapeName = CORBA::string_dup( theName );
+ myShapeID = CORBA::string_dup( theID );
bool hasName = ( theName && theName[0] );
- bool hasID = ( theID && theID[0] );
+ bool hasID = ( theID && theID[0] );
TopoDS_Shape S;
if ( hasName && hasID )
SMESH::FreeEdges::Borders* FreeEdges_i::GetBorders()
{
- INFOS("FreeEdges_i::GetBorders");
SMESH::Controls::FreeEdges::TBorders aBorders;
myFreeEdgesPtr->GetBoreders( aBorders );
aBorder.myPnt1 = aBord.myPntId[ 0 ];
aBorder.myPnt2 = aBord.myPntId[ 1 ];
}
-
- INFOS("FreeEdges_i::GetBorders~");
return aResult._retn();
}
{
case SMESH::ConnectedElements::POINT: // read 3 node coordinates ///////////////////
{
- vector< double > xyz;
+ std::vector< double > xyz;
char* endptr;
do
{
Class : LogicalNOT_i
Description : Logical NOT predicate
*/
-LogicalNOT_i::LogicalNOT_i()
-: myPredicate( NULL ),
- myLogicalNOTPtr( new Controls::LogicalNOT() )
+LogicalNOT_i::LogicalNOT_i():
+ myLogicalNOTPtr( new Controls::LogicalNOT() ),
+ myPredicate( NULL )
{
myFunctorPtr = myPredicatePtr = myLogicalNOTPtr;
}
//=======================================================================
FilterLibrary_i::FilterLibrary_i( const char* theFileName )
{
- myFileName = strdup( theFileName );
+ myFileName = CORBA::string_dup( theFileName );
SMESH::FilterManager_i* aFilterMgr = new SMESH::FilterManager_i();
myFilterMgr = aFilterMgr->_this();
FilterLibrary_i::~FilterLibrary_i()
{
- delete myFileName;
+ CORBA::string_free( myFileName );
//TPythonDump()<<this<<".UnRegister()";
}
{
char a[ 255 ];
sprintf( a, "%d", val );
- aCriterion.ThresholdStr = strdup( a );
+ aCriterion.ThresholdStr = CORBA::string_dup( a );
}
else
aCriterion.ThresholdStr = str.GetString();
//=======================================================================
void FilterLibrary_i::SetFileName( const char* theFileName )
{
- delete myFileName;
- myFileName = strdup( theFileName );
+ CORBA::string_free( myFileName );
+ myFileName = CORBA::string_dup( theFileName );
TPythonDump()<<this<<".SetFileName('"<<theFileName<<"')";
}
#ifdef _DEBUG_
// check if functName is complete, compilation failure means that enum FunctorType changed
const int nbFunctors = sizeof(functName) / sizeof(const char*);
- int _assert[( nbFunctors == SMESH::FT_Undefined + 1 ) ? 1 : -1 ];
+ int _assert[( nbFunctors == SMESH::FT_Undefined + 1 ) ? 1 : -1 ]; _assert[0]=1;
#endif
return functName;