[Gmsh] build a model directly from the c++ code

sébastien janas sjanas at ulg.ac.be
Thu Feb 24 15:34:39 CET 2011


Hi Ashish,

It whas the trick, thanks !

One problem remains, discreteVertex don't accept the setPosition()
function (the virtual function isn't defined in the discreteVertex.h),
and I don't see how to define the Vertex position, do you know how ?

Other question, when you use OCC model, which header file do you
include ?

Thanks a lot for your help

Sébastien



Le mercredi 23 février 2011 à 19:30 +0530, Negi, Ashish a écrit :
> Hi Sébastien,
> 
> I think, you can use discreteVertex, discreteEdge, discreteFace etc. because these are concrete classes derived from the ones you were trying to use. I have been using GMsh with Opencascade and use OCCVertex, OCCEdge, OCCFace etc.
> 
> Ashish
> 
> -----Original Message-----
> From: gmsh-bounces at ace20.montefiore.ulg.ac.be [mailto:gmsh-bounces at ace20.montefiore.ulg.ac.be] On Behalf Of sébastien janas
> Sent: Wednesday, February 23, 2011 1:16 AM
> To: gmsh at geuz.org.
> Subject: [Gmsh] build a model directly from the c++ code
> 
> Hi,
> 
> I want to build a gmsh model directly from my c++ code with the API.
> 
> I want to do a simple line with :
> 
> - a left node with tag 10
> - a right node with tag 20
> - a line between with tag 30
> 
> My idea is to simply do something like that
> 
> GModel *m = new GModel();
> GPoint a(0.,0.,0.);
> GPoint b(1.,0.,0.);
> 
> GVertex left(m,10);
> left.setPosition(a);
> 
> GVertex right(m,20);
> right.setPosition(b);
> 
> GEdge line(m,30,left,right);
> 
> and then mesh my model and do computations.
> 
> The problem is that this procedure is impossible because there are some
> pure virtual functions in the definitions of the GPoint,GVertex and
> GEdge classes. 
> 
> I understand that I have to call some inherited classes, but I don't see
> which and how to do.
> 
> Somebody can help me with this ?
> 
> Best regards,
> 
> Sébastien
> 
> 
> 
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh