class SalomeSession(object):
def __init__(self, script):
import runSalome
- sys.argv = ["runSalome.py"]
+ run_script = "runSalome.py"
+ if sys.platform == 'win32':
+ module_variable = "KERNEL_ROOT_DIR"
+ if os.environ.has_key(module_variable):
+ run_script = os.environ[module_variable] + "\\bin\\salome\\" + run_script
+ sys.argv = [run_script]
sys.argv += ["--terminal"]
sys.argv += ["--modules=GEOM,MED,SMESH"]
sys.argv += ["%s" % script]
+ if sys.platform == 'win32':
+ main_module_path = sys.modules['__main__'].__file__
+ sys.modules['__main__'].__file__ = ''
clt, d = runSalome.main()
+ if sys.platform == 'win32':
+ sys.modules['__main__'].__file__ = main_module_path
return
def __del__(self):
int* n2ind)
{
- int i1, i2;
+ int i1 = 0, i2 = 0;
const SMDS_MeshElement* face = 0;
SMDS_ElemIteratorPtr invElemIt = n1->GetInverseElementIterator(SMDSAbs_Face);
// << "\t SetSize " << allowedSize << " at "
// << pIt1->myP.X() <<", "<< pIt1->myP.Y()<<", "<<pIt1->myP.Z() << endl;
pIt2 = pIt1;
- if ( --pIt2 != eData.myPoints.end() && pIt2->mySegSize > allowedSize )
+ if ( pIt2 != eData.myPoints.begin() && --pIt2 != eData.myPoints.end() && pIt2->mySegSize > allowedSize )
sizeTree.SetSize( eData.myC3d.Value( 0.6*pIt2->myU + 0.4*pIt1->myU ), allowedSize );
pIt2 = pIt1;
if ( ++pIt2 != eData.myPoints.end() && pIt2->mySegSize > allowedSize )
pIt1->mySegSize = allowedSize;
}
++pIt1;
- if ( & (*pIt1) == & eData.Last() )
+ if ( pIt1 != eData.myPoints.end() && ( & (*pIt1) == & eData.Last() ) )
avoidPnt = & eData.Last().myP;
else
avoidPnt = NULL;
}
//
// 2. Make pentahedrons
- int aID0, k , aJ[3];
+ int aID0, k , aJ[4];
vector<const SMDS_MeshNode*> aN;
//
SMDS_ElemIteratorPtr itf, aItNodes;
aTrsf2d.Transforms( cx, cy );
// set node on face
meshDS->SetNodeOnFace( node, faceID, cx, cy );
- tmpNodes[j-1] = node;
+ tmpNodes.push_back(node);
}
// create faces
- tmpNodes[Points.Length()] = CNodes[i];
+ tmpNodes.push_back( CNodes[i] );
// quad
for(j=0; j<Nodes1.size()-1; j++) {
SMDS_MeshFace* MF;