#include <SMESH_Gen.hxx>
#include <SMESH_Mesh.hxx>
#include <SMESH_ControlsDef.hxx>
-#include <SMESHGUI_Utils.h>
#include <SMESHDS_Mesh.hxx>
#include <SMDS_MeshElement.hxx>
#include <gp_Pnt2d.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <BRepTools.hxx>
+#include <TopTools_DataMapOfShapeInteger.hxx>
+#include <GProp_GProps.hxx>
+#include <BRepGProp.hxx>
#ifndef WNT
#include <fenv.h>
#endif
-#include <GeomSelectionTools.h>
-
#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <gp_XY.hxx>
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
_onlyUnaryInput = false;
_hypothesis = NULL;
+ smeshGen_i = SMESH_Gen_i::GetSMESHGen();
+ CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager");
+ SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
+
+ MESSAGE("studyid = " << _studyId);
+
+ myStudy = NULL;
+ myStudy = aStudyMgr->GetStudyByID(_studyId);
+ MESSAGE("myStudy->StudyId() = " << myStudy->StudyId());
/* Initialize the Python interpreter */
assert(Py_IsInitialized());
PyRun_SimpleString("from math import *");
PyGILState_Release(gstate);
-
+
FaceId2SizeMap.clear();
EdgeId2SizeMap.clear();
VertexId2SizeMap.clear();
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
double _smp_phy_size;
status_t size_on_surface(integer face_id, real *uv, real *size, void *user_data);
-status_t size_on_edge(integer edge_id, real t, real *size, void *user_data);
+status_t size_on_edge(integer edge_id, real t, real *size, void *user_data);
status_t size_on_vertex(integer vertex_id, real *size, void *user_data);
double my_u_min=1e6,my_v_min=1e6,my_u_max=-1e6,my_v_max=-1e6;
throw;
return projector.LowerDistanceParameter();
}
+
+/////////////////////////////////////////////////////////
+TopoDS_Shape BLSURFPlugin_BLSURF::entryToShape(std::string entry)
+{
+ MESSAGE("BLSURFPlugin_BLSURF::entryToShape"<<entry );
+ TopoDS_Shape S = TopoDS_Shape();
+ SALOMEDS::SObject_var aSO = myStudy->FindObjectID(entry.c_str());
+ SALOMEDS::GenericAttribute_var anAttr;
+ if (!aSO->_is_nil()){
+ SALOMEDS::SObject_var aRefSObj;
+ GEOM::GEOM_Object_var aShape;
+ SALOMEDS::AttributeIOR_var myAttribute;
+ CORBA::String_var myAttrValue;
+ CORBA::Object_var myCorbaObj;
+ // If selected object is a reference
+ if ( aSO->ReferencedObject( aRefSObj ))
+ aSO = aRefSObj;
+ SALOMEDS::SComponent_var myFatherCpnt = aSO->GetFatherComponent();
+ CORBA::String_var myFatherCpntDataType = myFatherCpnt->ComponentDataType();
+ if ( strcmp(myFatherCpntDataType,"GEOM")==0) {
+ MESSAGE("aSO father component is GEOM");
+ if (!aSO->FindAttribute(anAttr, "AttributeIOR")) return S;
+ myAttribute=SALOMEDS::AttributeIOR::_narrow(anAttr);
+ myAttrValue=myAttribute->Value();
+ MESSAGE("aSO IOR: "<< myAttrValue);
+ myCorbaObj=smeshGen_i->GetORB()->string_to_object(myAttrValue);
+ aShape = GEOM::GEOM_Object::_narrow(myCorbaObj);
+ }
+ if ( !aShape->_is_nil() )
+ S=smeshGen_i->GeomObjectToShape( aShape.in() );
+ }
+ return S;
+}
/////////////////////////////////////////////////////////
void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls)
bool _quadAllowed = BLSURFPlugin_Hypothesis::GetDefaultQuadAllowed();
bool _decimesh = BLSURFPlugin_Hypothesis::GetDefaultDecimesh();
int _verb = BLSURFPlugin_Hypothesis::GetDefaultVerbosity();
-
+
if (hyp) {
MESSAGE("BLSURFPlugin_BLSURF::SetParameters");
_topology = (int) hyp->GetTopology();
blsurf_set_param(bls, "hphy_flag", to_string(_physicalMesh).c_str());
// blsurf_set_param(bls, "hphy_flag", "2");
if ((to_string(_physicalMesh))=="2"){
- GeomSelectionTools* GeomST = new GeomSelectionTools::GeomSelectionTools( SMESH::GetActiveStudyDocument());
TopoDS_Shape GeomShape;
TopAbs_ShapeEnum GeomType;
MESSAGE("Setting a Size Map");
const BLSURFPlugin_Hypothesis::TSizeMap & sizeMaps = hyp->GetSizeMapEntries();
BLSURFPlugin_Hypothesis::TSizeMap::const_iterator smIt;
- int i=0;
for ( smIt = sizeMaps.begin(); smIt != sizeMaps.end(); ++smIt ) {
if ( !smIt->second.empty() ) {
MESSAGE("blsurf_set_sizeMap(): " << smIt->first << " = " << smIt->second);
- GeomShape = GeomST->entryToShape(smIt->first);
+ GeomShape = entryToShape(smIt->first);
GeomType = GeomShape.ShapeType();
if (GeomType == TopAbs_FACE){
HasSizeMapOnFace = true;
for ( atIt = attractors.begin(); atIt != attractors.end(); ++atIt ) {
if ( !atIt->second.empty() ) {
MESSAGE("blsurf_set_attractor(): " << atIt->first << " = " << atIt->second);
- GeomShape = GeomST->entryToShape(atIt->first);
+ GeomShape = entryToShape(atIt->first);
GeomType = GeomShape.ShapeType();
if (GeomType == TopAbs_FACE){
pos1 = pos2;
pos2 = atIt->second.find(")");
b = atof(atIt->second.substr(pos1+1, pos2-pos1-1).c_str());
-
+
// Get the (u,v) values of the attractor on the face
gp_XY uvPoint = getUV(TopoDS::Face(GeomShape),gp_XYZ(xa,ya,za));
Standard_Real u0 = uvPoint.X();
ostringstream attractorFunction;
attractorFunction << "def f(u,v): return ";
attractorFunction << _smp_phy_size << "-(" << _smp_phy_size <<"-" << a << ")";
- attractorFunction << "*exp(-((u-("<<u0<<"))*(u-("<<u0<<"))+(v-("<<v0<<"))*(v-("<<v0<<")))/(" << b << "*" << b <<"))";
+ attractorFunction << "*exp(-((u-("<<u0<<"))*(u-("<<u0<<"))+(v-("<<v0<<"))*(v-("<<v0<<")))/(" << b << "*" << b <<"))";
MESSAGE("Python function for attractor:" << std::endl << attractorFunction.str());
}
*/
}
- }
+ }
// if (HasSizeMapOnFace){
context_set_message_callback(ctx, message_callback, &_comment);
cad_t *c = cad_new(ctx);
-
+
blsurf_session_t *bls = blsurf_session_new(ctx);
-
+
SetParameters(_hypothesis, bls);
Standard_Real v_max;
*/
int iface = 0;
- string bad_end = "return";
+ string bad_end = "return";
for (TopExp_Explorer face_iter(aShape,TopAbs_FACE);face_iter.More();face_iter.Next()) {
TopoDS_Face f=TopoDS::Face(face_iter.Current());
if (fmap.FindIndex(f) > 0)
continue;
-
+
fmap.Add(f);
iface++;
surfaces.push_back(BRep_Tool::Surface(f));
// Get bound values of uv surface
//BRep_Tool::Surface(f)->Bounds(u_min,u_max,v_min,v_max);
//MESSAGE("BRep_Tool::Surface(f)->Bounds(u_min,u_max,v_min,v_max): " << u_min << ", " << u_max << ", " << v_min << ", " << v_max);
-
+
if ((HasSizeMapOnFace) && FaceId2SizeMap.find(f.HashCode(471662))!=FaceId2SizeMap.end()){
MESSAGE("FaceId2SizeMap[f.HashCode(471662)].find(bad_end): " << FaceId2SizeMap[f.HashCode(471662)].find(bad_end));
MESSAGE("FaceId2SizeMap[f.HashCode(471662)].size(): " << FaceId2SizeMap[f.HashCode(471662)].size());
FaceId2PythonSmp[iface]=func;
FaceId2SizeMap.erase(f.HashCode(471662));
}
- cad_face_t *fce = cad_face_new(c, iface, surf_fun, surfaces.back());
+ cad_face_t *fce = cad_face_new(c, iface, surf_fun, surfaces.back());
cad_face_set_tag(fce, iface);
if(f.Orientation() != TopAbs_FORWARD){
cad_face_set_orientation(fce, CAD_ORIENTATION_REVERSED);
} else {
cad_face_set_orientation(fce, CAD_ORIENTATION_FORWARD);
}
-
+
for (TopExp_Explorer edge_iter(f,TopAbs_EDGE);edge_iter.More();edge_iter.Next()) {
TopoDS_Edge e = TopoDS::Edge(edge_iter.Current());
int ic = emap.FindIndex(e);
if (ic <= 0)
ic = emap.Add(e);
-
+
double tmin,tmax;
curves.push_back(BRep_Tool::CurveOnSurface(e, f, tmin, tmax));
if ((HasSizeMapOnEdge) && EdgeId2SizeMap.find(e.HashCode(471662))!=EdgeId2SizeMap.end()){
}
}
if (npts != 2) {
- // should not happen
+ // should not happen
MESSAGE("An edge does not have 2 extremities.");
} else {
if (d1 < d2)
blsurf_session_delete(bls);
cad_delete(c);
context_delete(ctx);
-
+
return error(_comment);
//return false;
}
-
+
integer nv, ne, nt, nq, vtx[4], tag;
real xyz[3];
mesh_get_triangle_count(msh, &nt);
mesh_get_quadrangle_count(msh, &nq);
-
+
SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
SMDS_MeshNode** nodes = new SMDS_MeshNode*[nv+1];
bool* tags = new bool[nv+1];
for(int iv=1;iv<=nv;iv++) {
mesh_get_vertex_coordinates(msh, iv, xyz);
- mesh_get_vertex_tag(msh, iv, &tag);
+ mesh_get_vertex_tag(msh, iv, &tag);
nodes[iv] = meshDS->AddNode(xyz[0], xyz[1], xyz[2]);
// internal point are tagged to zero
if(tag){
for(int it=1;it<=ne;it++) {
mesh_get_edge_vertices(msh, it, vtx);
SMDS_MeshEdge* edg = meshDS->AddEdge(nodes[vtx[0]], nodes[vtx[1]]);
- mesh_get_edge_tag(msh, it, &tag);
+ mesh_get_edge_tag(msh, it, &tag);
if (tags[vtx[0]]) {
meshDS->SetNodeOnEdge(nodes[vtx[0]], TopoDS::Edge(emap(tag)));
tags[vtx[1]] = false;
};
meshDS->SetMeshElementOnShape(edg, TopoDS::Edge(emap(tag)));
-
+
}
for(int it=1;it<=nt;it++) {
mesh_get_triangle_vertices(msh, it, vtx);
SMDS_MeshFace* tri = meshDS->AddFace(nodes[vtx[0]], nodes[vtx[1]], nodes[vtx[2]]);
- mesh_get_triangle_tag(msh, it, &tag);
+ mesh_get_triangle_tag(msh, it, &tag);
meshDS->SetMeshElementOnShape(tri, TopoDS::Face(fmap(tag)));
if (tags[vtx[0]]) {
meshDS->SetNodeOnFace(nodes[vtx[0]], TopoDS::Face(fmap(tag)));
for(int it=1;it<=nq;it++) {
mesh_get_quadrangle_vertices(msh, it, vtx);
SMDS_MeshFace* quad = meshDS->AddFace(nodes[vtx[0]], nodes[vtx[1]], nodes[vtx[2]], nodes[vtx[3]]);
- mesh_get_quadrangle_tag(msh, it, &tag);
+ mesh_get_quadrangle_tag(msh, it, &tag);
meshDS->SetMeshElementOnShape(quad, TopoDS::Face(fmap(tag)));
if (tags[vtx[0]]) {
meshDS->SetNodeOnFace(nodes[vtx[0]], TopoDS::Face(fmap(tag)));
// Issue 0019864. On DebianSarge, FE signals do not obey to OSD::SetSignal(false)
#ifndef WNT
- if ( oldFEFlags > 0 )
+ if ( oldFEFlags > 0 )
feenableexcept( oldFEFlags );
feclearexcept( FE_ALL_EXCEPT );
#endif
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
if(du && dv){
gp_Pnt P;
gp_Vec D1U,D1V;
-
+
geometry->D1(uv[0],uv[1],P,D1U,D1V);
du[0]=D1U.X(); du[1]=D1U.Y(); du[2]=D1U.Z();
dv[0]=D1V.X(); dv[1]=D1V.Y(); dv[2]=D1V.Z();
gp_Pnt P;
gp_Vec D1U,D1V;
gp_Vec D2U,D2V,D2UV;
-
+
geometry->D2(uv[0],uv[1],P,D1U,D1V,D2U,D2V,D2UV);
duu[0]=D2U.X(); duu[1]=D2U.Y(); duu[2]=D2U.Z();
duv[0]=D2UV.X(); duv[1]=D2UV.Y(); duv[2]=D2UV.Z();
- dvv[0]=D2V.X(); dvv[1]=D2V.Y(); dvv[2]=D2V.Z();
+ dvv[0]=D2V.X(); dvv[1]=D2V.Y(); dvv[2]=D2V.Z();
}
return 0;
}
return STATUS_OK;
}
+
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+bool BLSURFPlugin_BLSURF::Evaluate(SMESH_Mesh& aMesh,
+ const TopoDS_Shape& aShape,
+ MapShapeNbElems& aResMap)
+{
+ int _physicalMesh = BLSURFPlugin_Hypothesis::GetDefaultPhysicalMesh();
+ double _phySize = BLSURFPlugin_Hypothesis::GetDefaultPhySize();
+ //int _geometricMesh = BLSURFPlugin_Hypothesis::GetDefaultGeometricMesh();
+ //double _angleMeshS = BLSURFPlugin_Hypothesis::GetDefaultAngleMeshS();
+ double _angleMeshC = BLSURFPlugin_Hypothesis::GetDefaultAngleMeshC();
+ if(_hypothesis) {
+ _physicalMesh = (int) _hypothesis->GetPhysicalMesh();
+ _phySize = _hypothesis->GetPhySize();
+ //_geometricMesh = (int) hyp->GetGeometricMesh();
+ //_angleMeshS = hyp->GetAngleMeshS();
+ _angleMeshC = _hypothesis->GetAngleMeshC();
+ }
+
+ bool IsQuadratic = false;
+
+ // ----------------
+ // evaluate 1D
+ // ----------------
+ TopTools_DataMapOfShapeInteger EdgesMap;
+ double fullLen = 0.0;
+ double fullNbSeg = 0;
+ for (TopExp_Explorer exp(aShape, TopAbs_EDGE); exp.More(); exp.Next()) {
+ TopoDS_Edge E = TopoDS::Edge( exp.Current() );
+ if( EdgesMap.IsBound(E) )
+ continue;
+ SMESH_subMesh *sm = aMesh.GetSubMesh(E);
+ double aLen = SMESH_Algo::EdgeLength(E);
+ fullLen += aLen;
+ int nb1d = 0;
+ if(_physicalMesh==1) {
+ nb1d = (int)( aLen/_phySize + 1 );
+ }
+ else {
+ // use geometry
+ double f,l;
+ Handle(Geom_Curve) C = BRep_Tool::Curve(E,f,l);
+ double fullAng = 0.0;
+ double dp = (l-f)/200;
+ gp_Pnt P1,P2,P3;
+ C->D0(f,P1);
+ C->D0(f+dp,P2);
+ gp_Vec V1(P1,P2);
+ for(int j=2; j<=200; j++) {
+ C->D0(f+dp*j,P3);
+ gp_Vec V2(P2,P3);
+ fullAng += fabs(V1.Angle(V2));
+ V1 = V2;
+ P2 = P3;
+ }
+ nb1d = (int)( fullAng/_angleMeshC + 1 );
+ }
+ fullNbSeg += nb1d;
+ std::vector<int> aVec(17);
+ for(int i=0; i<17; i++) aVec[i]=0;
+ if( IsQuadratic > 0 ) {
+ aVec[0] = 2*nb1d - 1;
+ aVec[2] = nb1d;
+ }
+ else {
+ aVec[0] = nb1d - 1;
+ aVec[1] = nb1d;
+ }
+ aResMap.insert(std::make_pair(sm,aVec));
+ EdgesMap.Bind(E,nb1d);
+ }
+ double ELen = fullLen/fullNbSeg;
+ // ----------------
+ // evaluate 2D
+ // ----------------
+ // try to evaluate as in MEFISTO
+ for (TopExp_Explorer exp(aShape, TopAbs_FACE); exp.More(); exp.Next()) {
+ TopoDS_Face F = TopoDS::Face( exp.Current() );
+ SMESH_subMesh *sm = aMesh.GetSubMesh(F);
+ GProp_GProps G;
+ BRepGProp::SurfaceProperties(F,G);
+ double anArea = G.Mass();
+ int nb1d = 0;
+ for (TopExp_Explorer exp1(F,TopAbs_EDGE); exp1.More(); exp1.Next()) {
+ nb1d += EdgesMap.Find(exp1.Current());
+ }
+ int nbFaces = (int) ( anArea/( ELen*ELen*sqrt(3.) / 4 ) );
+ int nbNodes = (int) ( ( nbFaces*3 - (nb1d-1)*2 ) / 6 + 1 );
+ std::vector<int> aVec(17);
+ for(int i=0; i<17; i++) aVec[i]=0;
+ if( IsQuadratic ) {
+ int nb1d_in = (nbFaces*3 - nb1d) / 2;
+ aVec[0] = nbNodes + nb1d_in;
+ aVec[4] = nbFaces;
+ }
+ else {
+ aVec[0] = nbNodes;
+ aVec[3] = nbFaces;
+ }
+ aResMap.insert(std::make_pair(sm,aVec));
+ }
+
+ // ----------------
+ // evaluate 3D
+ // ----------------
+ GProp_GProps G;
+ BRepGProp::VolumeProperties(aShape,G);
+ double aVolume = G.Mass();
+ double tetrVol = 0.1179*ELen*ELen*ELen;
+ int nbVols = (int)aVolume/tetrVol;
+ int nb1d_in = (int) ( ( nbVols*6 - fullNbSeg ) / 6 );
+ std::vector<int> aVec(17);
+ for(int i=0; i<17; i++) aVec[i]=0;
+ if( IsQuadratic ) {
+ aVec[0] = nb1d_in/3 + 1 + nb1d_in;
+ aVec[9] = nbVols;
+ }
+ else {
+ aVec[0] = nb1d_in/3 + 1;
+ aVec[8] = nbVols;
+ }
+ SMESH_subMesh *sm = aMesh.GetSubMesh(aShape);
+ aResMap.insert(std::make_pair(sm,aVec));
+
+ return true;
+}
#include <Python.h>
#include "SMESH_2D_Algo.hxx"
#include "SMESH_Mesh.hxx"
+#include <SMESH_Gen_i.hxx>
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SALOMEDS)
+#include CORBA_CLIENT_HEADER(GEOM_Gen)
#include "Utils_SALOME_Exception.hxx"
extern "C"{
#include "distene/api.h"
}
class BLSURFPlugin_Hypothesis;
+class TopoDS_Shape;
class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
public:
BLSURFPlugin_BLSURF(int hypId, int studyId, SMESH_Gen* gen);
+ TopoDS_Shape entryToShape(std::string entry);
+
virtual ~BLSURFPlugin_BLSURF();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
+ virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
+ MapShapeNbElems& aResMap);
+
ostream & SaveTo(ostream & save);
istream & LoadFrom(istream & load);
friend ostream & operator << (ostream & save, BLSURFPlugin_BLSURF & hyp);
friend istream & operator >> (istream & load, BLSURFPlugin_BLSURF & hyp);
-
+
protected:
const BLSURFPlugin_Hypothesis* _hypothesis;
private:
PyObject * main_mod;
PyObject * main_dict;
-
+ SALOMEDS::Study_var myStudy;
+ SMESH_Gen_i* smeshGen_i;
};
#endif
//=============================================================================
BLSURFPlugin_BLSURF_i::BLSURFPlugin_BLSURF_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
{
MESSAGE( "BLSURFPlugin_BLSURF_i::BLSURFPlugin_BLSURF_i" );
myBaseImpl = new ::BLSURFPlugin_BLSURF( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
public:
// Constructor
BLSURFPlugin_BLSURF_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~BLSURFPlugin_BLSURF_i();
// Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
// ---
//
-#include <BLSURFPlugin_Hypothesis.hxx>
+#include "BLSURFPlugin_Hypothesis.hxx"
#include <utilities.h>
#include <cstring>
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-# header files
+# header files
salomeinclude_HEADERS = \
BLSURFPlugin_BLSURF.hxx \
BLSURFPlugin_BLSURF_i.hxx \
$(CORBA_CXXFLAGS) \
$(CORBA_INCLUDES) \
$(BOOST_CPPFLAGS) \
- -I$(srcdir)/../PluginUtils \
-I$(top_builddir)/idl \
- -I$(top_builddir)/salome_adm/unix
+ -I$(top_builddir)/salome_adm/unix
#Qt uniquement necessaire pour le getActiveStudyDocument de SMeshGuiUtils.h
libBLSURFEngine_la_LDFLAGS = \
../../idl/libSalomeIDLBLSURFPLUGIN.la \
- ../PluginUtils/libGeomSelectionTools.la \
$(BLSURF_LIBS) \
$(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine \
$(KERNEL_LDFLAGS) -lSalomeGenericObj
#include <QRadioButton>
#include <LightApp_SelectionMgr.h>
-#include <SalomeApp_Application.h>
+#include <SalomeApp_Application.h>
#include <SALOME_ListIO.hxx>
#include <SALOME_ListIteratorOfListIO.hxx>
#include <GEOM_Client.hxx>
#include <TopoDS_Shape.hxx>
#include <SMESH_Gen_i.hxx>
-#include <boost/shared_ptr.hpp>
+#include <boost/shared_ptr.hpp>
#include <structmember.h>
// #include <GeomSelectionTools.h>
};
/**************************************************
- Begin initialization Python structures and objects
+ Begin initialization Python structures and objects
***************************************************/
typedef struct {
}
/*************************************************
-End initialization Python structures and objects
+End initialization Python structures and objects
**************************************************/
/**
* \brief {BLSURFPluginGUI_HypothesisCreator constructor}
* @param theHypType Name of the hypothesis type (here BLSURF_Parameters)
- *
+ *
* */
BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator( const QString& theHypType )
: SMESHGUI_GenericHypothesisCreator( theHypType )
{
- MESSAGE("BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator");
+ MESSAGE("BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator");
this->mySMPMap.clear();
GeomToolSelected = NULL;
throw ("Error: Python interpreter is not initialized");
PyGILState_STATE gstate;
gstate = PyGILState_Ensure();
-
+
main_mod = NULL;
main_mod = PyImport_AddModule("__main__");
-
+
main_dict = NULL;
main_dict = PyModule_GetDict(main_mod);
-
+
PyRun_SimpleString("from math import *");
PyGILState_Release(gstate);
* */
GeomSelectionTools* BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool()
{
- MESSAGE("BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool");
+ MESSAGE("BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool");
BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+ MESSAGE("aStudy->StudyId(): " << aStudy->StudyId());
if (that->GeomToolSelected == NULL or that->GeomToolSelected->getMyStudy() != aStudy) {
MESSAGE("GeomToolSelected is created");
that->GeomToolSelected = new GeomSelectionTools(aStudy);
}
else
MESSAGE("GeomToolSelected already exists");
+ MESSAGE("that->GeomToolSelected->getMyStudy()->StudyId(): " << that->GeomToolSelected->getMyStudy()->StudyId());
return that->GeomToolSelected;
}
bool BLSURFPluginGUI_HypothesisCreator::checkParams() const
{
- MESSAGE("BLSURFPluginGUI_HypothesisCreator::checkParams");
+ MESSAGE("BLSURFPluginGUI_HypothesisCreator::checkParams");
bool ok = true;
if ( !isDouble( myPhySize->text(), false )) {
if ( myPhySize->text().isEmpty() )
myAngleMeshS->setMinimum( 0 );
myAngleMeshS->setMaximum( 16 );
myAngleMeshS->setSingleStep( 0.5 );
-
+
aStdLayout->addWidget( new QLabel( tr( "BLSURF_ANGLE_MESH_C" ), myStdGroup ), row, 0, 1, 1 );
myAngleMeshC = new QtxDoubleSpinBox( myStdGroup );
aStdLayout->addWidget( myAngleMeshC, row++, 1, 1, 1 );
myAngleMeshC->setMinimum( 0 );
myAngleMeshC->setMaximum( 16 );
myAngleMeshC->setSingleStep( 0.5 );
-
+
aStdLayout->addWidget( new QLabel( tr( "BLSURF_GRADATION" ), myStdGroup ), row, 0, 1, 1 );
myGradation = new QtxDoubleSpinBox( myStdGroup );
aStdLayout->addWidget( myGradation, row++, 1, 1, 1 );
myDecimesh = new QCheckBox( tr( "BLSURF_DECIMESH" ), myStdGroup );
aStdLayout->addWidget( myDecimesh, row++, 0, 1, 2 );
-
+
// advanced parameters
myAdvGroup = new QWidget();
QGridLayout* anAdvLayout = new QGridLayout( myAdvGroup );
anAdvLayout->setColumnStretch( 1, 5 );
// Size Maps parameters
-
+
mySmpGroup = new QWidget();
QGridLayout* anSmpLayout = new QGridLayout(mySmpGroup);
mySizeMapTable = new QTableWidget( 0, SMP_NB_COLUMNS, mySmpGroup );
anSmpLayout->addWidget(mySizeMapTable, 1, 0, 8, 1);
QStringList sizeMapHeaders;
- sizeMapHeaders << tr( "SMP_ENTRY_COLUMN" )<< tr( "SMP_NAME_COLUMN" ) << tr( "SMP_SIZEMAP_COLUMN" );
+ sizeMapHeaders << tr( "SMP_ENTRY_COLUMN" )<< tr( "SMP_NAME_COLUMN" ) << tr( "SMP_SIZEMAP_COLUMN" );
mySizeMapTable->setHorizontalHeaderLabels(sizeMapHeaders);
mySizeMapTable->horizontalHeader()->hideSection( SMP_ENTRY_COLUMN );
mySizeMapTable->resizeColumnToContents(SMP_NAME_COLUMN);
removeButton = new QPushButton(tr("BLSURF_SM_REMOVE"),mySmpGroup);
anSmpLayout->addWidget(removeButton, SMP_REMOVE_BTN, 1, 1, 1);
-
+
// ---
tab->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) );
connect( addBtn->menu(), SIGNAL( aboutToShow() ), this, SLOT( onAddOption() ) );
connect( addBtn->menu(), SIGNAL( triggered( QAction* ) ), this, SLOT( onOptionChosenInPopup( QAction* ) ) );
connect( rmBtn, SIGNAL( clicked()), this, SLOT( onDeleteOption() ) );
-
+
connect(addSurfaceButton, SIGNAL(clicked()), this, SLOT(onAddMapOnSurface()));
connect(addEdgeButton, SIGNAL(clicked()), this, SLOT(onAddMapOnEdge()));
connect(addPointButton, SIGNAL(clicked()), this, SLOT(onAddMapOnPoint()));
myAllowQuadrangles->setChecked( data.myAllowQuadrangles );
myDecimesh->setChecked( data.myDecimesh );
myVerbosity->setValue( data.myVerbosity );
-
+
if ( myOptions.operator->() ) {
printf("retrieveParams():myOptions->length()=%d\n",myOptions->length());
for ( int i = 0, nb = myOptions->length(); i < nb; ++i ) {
myOptionTable->setItem( row, OPTION_NAME_COLUMN, new QTableWidgetItem( name_value[0] ) );
myOptionTable->item( row, OPTION_NAME_COLUMN )->setFlags( 0 );
myOptionTable->setItem( row, OPTION_VALUE_COLUMN, new QTableWidgetItem( name_value[1] ) );
- myOptionTable->item( row, OPTION_VALUE_COLUMN )->setFlags( Qt::ItemIsSelectable |
- Qt::ItemIsEditable |
+ myOptionTable->item( row, OPTION_VALUE_COLUMN )->setFlags( Qt::ItemIsSelectable |
+ Qt::ItemIsEditable |
Qt::ItemIsEnabled );
}
- }
+ }
}
myOptionTable->resizeColumnToContents( OPTION_NAME_COLUMN );
Qt::ItemIsEditable |
Qt::ItemIsEnabled );
}
-
+
mySizeMapTable->resizeColumnToContents( SMP_NAME_COLUMN );
mySizeMapTable->resizeColumnToContents(SMP_SIZEMAP_COLUMN);
guiHyp += name + " = " + value + "; ";
}
}
-
+
// SizeMap
row = 0, nbRows = mySizeMapTable->rowCount();
for ( ; row < nbRows; ++row )
if ( that->mySMPMap.contains(entry) )
guiHyp += entry + " = " + that->mySMPMap[entry] + "; ";
}
-
+
MESSAGE("guiHyp : " << guiHyp.toLatin1().data());
return guiHyp;
{
myOptionTable->setFocus();
QMenu* menu = (QMenu*)( a->parent() );
-
+
int idx = menu->actions().indexOf( a );
QString idStr = QString("%1").arg( idx );
QString option = myOptions[idx].in();
myOptionTable->setItem( row, OPTION_NAME_COLUMN, new QTableWidgetItem( optionName ) );
myOptionTable->item( row, OPTION_NAME_COLUMN )->setFlags( 0 );
myOptionTable->setItem( row, OPTION_VALUE_COLUMN, new QTableWidgetItem( "" ) );
- myOptionTable->item( row, OPTION_VALUE_COLUMN )->setFlags( Qt::ItemIsSelectable |
- Qt::ItemIsEditable |
+ myOptionTable->item( row, OPTION_VALUE_COLUMN )->setFlags( Qt::ItemIsSelectable |
+ Qt::ItemIsEditable |
Qt::ItemIsEnabled );
myOptionTable->resizeColumnToContents( OPTION_NAME_COLUMN );
}
myOptionTable->setCurrentCell( row, OPTION_VALUE_COLUMN );
//myOptionTable->openPersistentEditor( myOptionTable->item( row, OPTION_VALUE_COLUMN ) );
}
-
+
void BLSURFPluginGUI_HypothesisCreator::onDeleteOption()
{
// clear option values and remember selected row
QList<int> selectedRows;
- QList<QTableWidgetItem*> selected = myOptionTable->selectedItems();
+ QList<QTableWidgetItem*> selected = myOptionTable->selectedItems();
QTableWidgetItem* item;
foreach( item, selected ) {
int row = item->row();
int row;
foreach( item, selected ) {
row = item->row();
- if ( !selectedRows.contains( row ) )
+ if ( !selectedRows.contains( row ) )
selectedRows.append( row );
}
TopoDS_Shape S;
string entry, shapeName;
-// LightApp_SelectionMgr* aSel = GeomToolSelected->selectionMgr();
+ GeomSelectionTools* myGeomToolSelected = that->getGeomSelectionTool();
+
+ LightApp_SelectionMgr* mySel = myGeomToolSelected->selectionMgr();
SALOME_ListIO ListSelectedObjects;
- aSel->selectedObjects(ListSelectedObjects, NULL, false );
+ mySel->selectedObjects(ListSelectedObjects, NULL, false );
if (!ListSelectedObjects.IsEmpty())
{
SALOME_ListIteratorOfListIO Object_It(ListSelectedObjects);
- GeomSelectionTools* myGeomToolSelected = getGeomSelectionTool();
- for (; Object_It.More(); Object_It.Next())
+ for (; Object_It.More(); Object_It.Next())
{
Handle(SALOME_InteractiveObject) anObject = Object_It.Value();
entry = myGeomToolSelected->getEntryOfObject(anObject);
shapeName = anObject->getName();
S = myGeomToolSelected->entryToShape(entry);
- if ((! S.IsNull()) && (S.ShapeType() == typeShapeAsked))
- {
+ if ((! S.IsNull()) && (S.ShapeType() == typeShapeAsked))
+ {
mySizeMapTable->setFocus();
QString shapeEntry;
shapeEntry = QString::fromStdString(entry);
}
}
that->mySMPMap[shapeEntry] = sizeMap;
- that->mySMPShapeTypeMap[shapeEntry] = typeShapeAsked;
+ that->mySMPShapeTypeMap[shapeEntry] = typeShapeAsked;
int row = mySizeMapTable->rowCount() ;
mySizeMapTable->setRowCount( row+1 );
mySizeMapTable->setItem( row, SMP_ENTRY_COLUMN, new QTableWidgetItem( shapeEntry ) );
QString myEntry = mySizeMapTable->item( myRow, SMP_ENTRY_COLUMN )->text();
bool res = sizeMapValidationFromEntry(myEntry,displayError);
mySizeMapTable->setFocus();
- return res;
+ return res;
}
bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry(QString myEntry, bool displayError)
MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry()");
BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
-
+
if (not that->mySMPMap.contains(myEntry)) {
MESSAGE("Geometry with entry "<<myEntry.toStdString()<<" was not found.");
return false;
else if (that->mySMPMap[myEntry].startsWith("ATTRACTOR")) {
MESSAGE("Attractor" );
// if ((that->mySMPMap[myEntry].count(QRegExp("ATTRACTOR([0-9])")) != 1))
- if ((that->mySMPMap[myEntry].count('(') != 1) or
+ if ((that->mySMPMap[myEntry].count('(') != 1) or
(that->mySMPMap[myEntry].count(')') != 1) or
(that->mySMPMap[myEntry].count(';') != 4) or
(that->mySMPMap[myEntry].size() == 15)){
throw ("Erreur: Python interpreter is not initialized");
PyGILState_STATE gstate;
gstate = PyGILState_Ensure();
-
- PyObject * obj = NULL;
- PyObject* new_stderr = NULL;
+
+ PyObject * obj = NULL;
+ PyObject* new_stderr = NULL;
string err_description="";
obj= PyRun_String(expr.c_str(), Py_file_input, main_dict, NULL);
if (obj == NULL){
return false;
}
Py_DECREF(obj);
-
+
PyObject * func = NULL;
func = PyObject_GetAttrString(main_mod, "f");
if ( func == NULL){
- fflush(stderr);
- err_description="";
- new_stderr=newPyStdOut(err_description);
- PySys_SetObject("stderr", new_stderr);
- PyErr_Print();
- PySys_SetObject("stderr", PySys_GetObject("__stderr__"));
+ fflush(stderr);
+ err_description="";
+ new_stderr=newPyStdOut(err_description);
+ PySys_SetObject("stderr", new_stderr);
+ PyErr_Print();
+ PySys_SetObject("stderr", PySys_GetObject("__stderr__"));
Py_DECREF(new_stderr);
if (displayError)
SUIT_MessageBox::warning( dlg(),"Python Error" ,err_description.c_str() );
void BLSURFPluginGUI_HypothesisCreator::OnEditMapFunction(QModelIndex* index) {
int myRow = index->row();
int myColumn = index->column();
-
+
if (myColumn == 2){
if (!myEditor) {
myEditor = new BLSURFPluginGUI_MapFunctionEditor(sizeMapModel->item(myRow,0)->text());
// myEditor->show();
// myEditor->raise();
// myEditor->activateWindow();
-
+
// BLSURFPluginGUI_MapFunctionEditor* myEditor = new BLSURFPluginGUI_MapFunctionEditor(sizeMapModel->item(myRow,0)->text());
// myEditor->exec();
QString myFunction = myEditor->GetFunctionText();
// FIN RECUPERATION FONCTION
-
+
if (! myFunction.isEmpty()) {
-
+
// MAJ DE LA MAP
-
- BLSURFPlugin::BLSURFPlugin_Hypothesis_var h =
+
+ BLSURFPlugin::BLSURFPlugin_Hypothesis_var h =
BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( initParamsHypothesis());
// h->SetSizeMapEntry(sizeMapModel->item(myRow,1)->text().toLatin1().constData(),
}
}
}*/
-
+
QString BLSURFPluginGUI_HypothesisCreator::caption() const
{
return tr( "BLSURF_TITLE" );
else
return 0;
}
+
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-SUBDIRS = PluginUtils BLSURFPlugin
+SUBDIRS = BLSURFPlugin
if BLSURFPLUGIN_ENABLE_GUI
- SUBDIRS += GUI
+ SUBDIRS += PluginUtils GUI
endif
DIST_SUBDIRS = PluginUtils BLSURFPlugin GUI
#include "GeomSelectionTools.h"
-#include <sstream>
-#include <LightApp_SelectionMgr.h>
-#include <SalomeApp_Application.h>
-#include <SUIT_Session.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SUIT_Session.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
#include <GEOM_Client.hxx>
-#include <SMESH_Gen_i.hxx>
#include <SMESHGUI_Utils.h>
-#include <boost/shared_ptr.hpp>
+#include <boost/shared_ptr.hpp>
#include <TopoDS.hxx>
#include <BRep_Tool.hxx>
#include <Handle_Geom_Surface.hxx>
#include <BRepAdaptor_Surface.hxx>
+#include "utilities.h"
+
+#include "SALOME_LifeCycleCORBA.hxx"
+#include <sstream>
/*!
- * Constructor
+ * Constructor
* @param aStudy pointer to the Study
*
*/
}
/*!
- * Allows to get the selection manager from LightApp
+ * Allows to get the Salome Application
* @return A LightApp_SelectionMgr Pointer or 0 if it can't get it.
*/
-LightApp_SelectionMgr* GeomSelectionTools::selectionMgr()
+SalomeApp_Application* GeomSelectionTools::GetSalomeApplication()
{
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
if (anApp)
- return dynamic_cast<LightApp_SelectionMgr*>( anApp->selectionMgr() );
- else
+ return anApp;
+ else
return 0;
}
+/*!
+ * Allows to get the selection manager from LightApp
+ * @return A LightApp_SelectionMgr Pointer or 0 if it can't get it.
+ */
+LightApp_SelectionMgr* GeomSelectionTools::selectionMgr()
+{
+ SalomeApp_Application* anApp = GetSalomeApplication();
+ if (anApp)
+ return dynamic_cast<LightApp_SelectionMgr*>( anApp->selectionMgr() );
+ else
+ return 0;
+}
+
/*!
* Return the list of the selected Salome Interactive Object (SALOME_ListIO*)
* @return the list of the selected Salome Interactive Object
SALOME_ListIO selected;
LightApp_SelectionMgr* aSel = selectionMgr();
aSel->selectedObjects( selected, NULL, false );
- if (!selected.IsEmpty()){
+ if (!selected.IsEmpty()){
SALOME_ListIteratorOfListIO anIt(selected);
Handle(SALOME_InteractiveObject) anIO;
anIO = anIt.Value();
/*!
* Return the entry of the first selected Object
* @return the entry of the first selected Object
- */
+ */
std::string GeomSelectionTools::getFirstSelectedEntry()
{
Handle(SALOME_InteractiveObject) anIO;
std::string GeomSelectionTools::getEntryOfObject(Handle(SALOME_InteractiveObject) anIO){
std::string entry="";
_PTR(SObject) aSO = myStudy->FindObjectID(anIO->getEntry());
- if (aSO){
+ if (aSO){
_PTR(SObject) aRefSObj;
// If selected object is a reference
if ( aSO->ReferencedObject( aRefSObj ))
}
return entry;
}
-
+
/*!
* Retrieve the name from the entry of the object
* @param entry the entry of the object
Handle(SALOME_InteractiveObject) anIO;
std::string DataType="";
anIO=GeomSelectionTools::getFirstSelectedSalomeObject();
- _PTR(SObject) aSO = myStudy->FindObjectID(anIO->getEntry());
+ _PTR(SObject) aSO = myStudy->FindObjectID(anIO->getEntry());
if (aSO){
_PTR(SObject) aRefSObj;
- // If selected object is a reference
+ // If selected object is a reference
if ( aSO->ReferencedObject( aRefSObj ))
DataType= aRefSObj->GetFatherComponent()->ComponentDataType();
- // If selected object is a reference is not a reference
- else
+ // If selected object is a reference is not a reference
+ else
DataType=anIO->getComponentDataType();
}
return DataType;
* @return the TopoDS shape from the entry, empty TopoDS Shape if the entry does not define a shape.
*/
TopoDS_Shape GeomSelectionTools::entryToShape(std::string entry){
+ MESSAGE("GeomSelectionTools::entryToShape"<<entry );
TopoDS_Shape S = TopoDS_Shape();
_PTR(SObject) aSO = myStudy->FindObjectID(entry);
- if (aSO){
+ if (aSO){
_PTR(SObject) aRefSObj;
GEOM::GEOM_Object_var aShape;
- // If selected object is a reference
- if ( aSO->ReferencedObject( aRefSObj )){
- if (aRefSObj->GetFatherComponent()->ComponentDataType() == "GEOM")
- aShape=SMESH::SObjectToInterface<GEOM::GEOM_Object>(aRefSObj);
- }
- // If selected object is a reference is not a reference
- else {
- if ( aSO->GetFatherComponent()->ComponentDataType() == "GEOM")
- aShape = SMESH::SObjectToInterface<GEOM::GEOM_Object>(aSO);
+ MESSAGE("Got a SO");
+ // If selected object is a reference
+ if ( aSO->ReferencedObject( aRefSObj ))
+ aSO = aRefSObj;
+ MESSAGE("aSO->GetFatherComponent()->ComponentDataType(): " << aSO->GetFatherComponent()->ComponentDataType());
+ if ( strcmp(aSO->GetFatherComponent()->ComponentDataType().c_str(),"GEOM") == 0)
+ aShape = SMESH::SObjectToInterface<GEOM::GEOM_Object>(aSO);
+ if ( !aShape->_is_nil() ){
+ MESSAGE("Got a Shape as Geom Object ");
+
+ SalomeApp_Application* anApp = GetSalomeApplication();
+ if (anApp) {
+ MESSAGE("Got Application");
+ Engines::Component_var component = anApp->lcc()->FindOrLoad_Component( "FactoryServer","GEOM" );
+ GEOM::GEOM_Gen_var _geomEngine = GEOM::GEOM_Gen::_narrow(component);
+ MESSAGE("Got GEOM engine");
+ GEOM_Client* aClient = new GEOM_Client();
+ if ( aClient && !_geomEngine->_is_nil() ) {
+ MESSAGE("GEOM client is OK and GEOM engine is not null");
+ S = aClient->GetShape( _geomEngine, aShape );
+ }
}
- if ( !aShape->_is_nil() ){
- if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen())
- S=gen->GeomObjectToShape( aShape.in() );
}
}
return S;
}
+
/*!
* Gives the ShapeType of the first Selected Object, return TopAbs_SHAPE if the first selected object does not define a shape.
* @return the ShapeType of the first Selected Object, return TopAbs_SHAPE if the first selected object does not define a shape.
* U and V number of poles
* U and V number of knots
* U or V is Rational ?
- *
- */
+ *
+ */
GeomAbs_SurfaceType GeomSelectionTools::getFaceInformation()
{
TopoDS_Shape S=getFirstSelectedTopoDSShape();
TopoDS_Face f=TopoDS::Face(S);
Handle(Geom_Surface) surf = BRep_Tool::Surface(f);
BRepAdaptor_Surface surf_adap=BRepAdaptor_Surface::BRepAdaptor_Surface(f);
-
+
/* Global Information */
- cout << "GLOBAL INFORMATION" << endl;
- cout << "******************" << endl;
- stringstream buffer;
+ std::cout << "GLOBAL INFORMATION" << std::endl;
+ std::cout << "******************" << std::endl;
+ std::stringstream buffer;
buffer << "Degre U : " << surf_adap.UDegree();
//conversion nécessaire pour affichage
- cout << buffer.str() << endl;
- cout << " Degre V : " << surf_adap.VDegree() << endl;
- cout << " Nb Poles U : " << surf_adap.NbUPoles() << endl;
- cout << " Nb Poles V : " << surf_adap.NbVPoles() << endl;
- cout << " Nb Noeuds U : " << surf_adap.NbUKnots() << endl;
- cout << " Nb Noeuds V : " << surf_adap.NbVKnots() << endl;
- cout << " U Rationnel ? " << surf_adap.IsURational() << endl;
- cout << " V Rationnel ? " << surf_adap.IsVRational() << endl;
+ std::cout << buffer.str() << std::endl;
+ std::cout << " Degre V : " << surf_adap.VDegree() << std::endl;
+ std::cout << " Nb Poles U : " << surf_adap.NbUPoles() << std::endl;
+ std::cout << " Nb Poles V : " << surf_adap.NbVPoles() << std::endl;
+ std::cout << " Nb Noeuds U : " << surf_adap.NbUKnots() << std::endl;
+ std::cout << " Nb Noeuds V : " << surf_adap.NbVKnots() << std::endl;
+ std::cout << " U Rationnel ? " << surf_adap.IsURational() << std::endl;
+ std::cout << " V Rationnel ? " << surf_adap.IsVRational() << std::endl;
surf_type=surf_adap.GetType();
}
return surf_type;
}
+
+
+
// File : GeomSelectionTools.h
// Authors : Nicolas GEIMER (OCC)
// ---
-
-
+#ifndef _GEOMSELECTIONTOOLS_H_
+#define _GEOMSELECTIONTOOLS_H_
#include "SALOMEDSClient.hxx"
#include "SALOME_InteractiveObject.hxx"
#include <SALOME_ListIO.hxx>
+#include <SalomeApp_Application.h>
#include <TopoDS_Shape.hxx>
#include <GeomAbs_SurfaceType.hxx>
-class LightApp_SelectionMgr;
+class LightApp_SelectionMgr;
/*!
{
private:
-
- _PTR(Study) myStudy;
+
+ _PTR(Study) myStudy;
public:
- GeomSelectionTools(_PTR(Study));
+ GeomSelectionTools(_PTR(Study));
+ static SalomeApp_Application* GetSalomeApplication();
static LightApp_SelectionMgr* selectionMgr();
SALOME_ListIO* getSelectedSalomeObjects();
Handle(SALOME_InteractiveObject) getFirstSelectedSalomeObject();
};
+#endif // _GEOMSELECTIONTOOLS_H_
GeomSelectionTools.h \
GeomSelectionTools.cxx
-MOC_FILES = \
- BLSURFPluginGUI_HypothesisCreator_moc.cxx
-
-nodist_GeomSelectionTools_la_SOURCES = \
- $(MOC_FILES)
-
# additionnal information to compil and link file
libGeomSelectionTools_la_CPPFLAGS = \
+++ /dev/null
-// Copyright (C) 2007-2008 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
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : PluginUtils.h
-// Author : Nicolas GEIMER (OCC)
-// Module : BLSURFPlugin
-//
-
-
-
+++ /dev/null
-#include <Python.h>