Skip to content
Snippets Groups Projects
Commit 4354c388 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

canevas for edge constrain

parent 199b821f
No related branches found
No related tags found
No related merge requests found
// $Id: GModelIO_OCC.cpp,v 1.35 2008-06-30 17:42:49 geuzaine Exp $ // $Id: GModelIO_OCC.cpp,v 1.36 2008-07-01 12:46:08 geuzaine Exp $
// //
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
// //
...@@ -488,6 +488,7 @@ int GModel::importOCCShape(const void *shape, const void *options) ...@@ -488,6 +488,7 @@ int GModel::importOCCShape(const void *shape, const void *options)
_occ_internals->buildGModel(this); _occ_internals->buildGModel(this);
snapVertices(); snapVertices();
SetBoundingBox(); SetBoundingBox();
if(!options) return 1; if(!options) return 1;
#if defined(HAVE_OCC_MESH_CONSTRAINTS) #if defined(HAVE_OCC_MESH_CONSTRAINTS)
...@@ -498,12 +499,26 @@ int GModel::importOCCShape(const void *shape, const void *options) ...@@ -498,12 +499,26 @@ int GModel::importOCCShape(const void *shape, const void *options)
// iterate on all the edges of the model and set constraints (if // iterate on all the edges of the model and set constraints (if
// any) // any)
for(eiter it = firstEdge(); it != lastEdge(); ++it){ for(eiter it = firstEdge(); it != lastEdge(); ++it){
TopoDS_Edge *edge = (*it)->getNativePtr(); TopoDS_Shape *shape = (TopoDS_Shape*)(*it)->getNativePtr();
try { if(ecmap.IsBound(*shape)) {
MeshGmsh_EdgeConstrain &ec = ecmap.Find(*edge); Msg::Debug("Got meshing contraints for edge %d", (*it)->tag());
printf("got edge constraints\n"); const MeshGmsh_EdgeConstrain &ec(ecmap.Find(*shape));
} if(ec.IsMeshImposed()){
catch(...){ TColStd_SequenceOfInteger num;
ec.GetNodesNumber(num);
TColStd_SequenceOfReal par;
ec.GetParameters(par);
int n = num.Length();
if(par.Length() != n){
Msg::Error("Wrong number of parameters in edge constraint: %d != %d",
num.Length(), par.Length());
}
else{
for(int i = 0; i < n; i++){
printf("node %d param %g\n", num.Value(i), par.Value(i));
}
}
}
} }
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment