class SalomeSession(object):
def __init__(self, script):
import runSalome
- sys.argv = ["runSalome.py"]
+ run_script = "runSalome.py"
+ if sys.platform == 'win32':
+ module_dir = os.getenv("KERNEL_ROOT_DIR")
+ if module_dir: run_script = os.path.join(module_dir, "bin", "salome", run_script)
+ pass
+ 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):
//cout<<"Angles.Length() = "<<Angles.Length()<<" Points.Length() = "<<Points.Length()<<endl;
//cout<<"Nodes1.size() = "<<Nodes1.size()<<" Pnts2d1.Length() = "<<Pnts2d1.Length()<<endl;
for(; i<Angles.Length(); i++) {
- vector< const SMDS_MeshNode* > tmpNodes(Nodes1.size());
+ vector< const SMDS_MeshNode* > tmpNodes;
gp_Trsf aTrsf;
gp_Ax1 theAxis(P0,gp_Dir(Axis));
aTrsf.SetRotation( theAxis, Angles.Value(i) );
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;