Skip to content
Snippets Groups Projects
Commit a44c87e3 authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

OCC regions added

parent cb6ecc80
No related branches found
No related tags found
No related merge requests found
// $Id: OCCRegion.cpp,v 1.1 2006-11-15 14:36:39 remacle Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <OCC@geuz.org>.
#ifdef _HAVE_OCC_
#include "GModel.h"
#include "OCCVertex.h"
#include "OCCEdge.h"
#include "OCCFace.h"
#include "OCCRegion.h"
#include "Message.h"
OCCRegion::OCCRegion(GModel *m, TopoDS_Solid _s, int num, TopTools_IndexedMapOfShape &fmap)
: GRegion(m, num), s(_s)
{
TopExp_Explorer exp0, exp01, exp1, exp2, exp3;
for (exp2.Init (s, TopAbs_SHELL); exp2.More(); exp2.Next())
{
TopoDS_Shape shell = exp2.Current();
Msg(INFO,"OCC Region %d - New Shell",num);
for (exp3.Init (shell, TopAbs_FACE); exp3.More(); exp3.Next())
{
TopoDS_Face face = TopoDS::Face (exp3.Current());
int index = fmap.FindIndex(face);
GFace *f = m->faceByTag(index);
if(!f) throw;
l_faces.push_back(f);
f->addRegion(this);
}
}
Msg(INFO,"OCC Region %d with %d edges",num,l_faces.size());
}
GEntity::GeomType OCCRegion::geomType() const
{
return Unknown;
}
#endif
#ifndef _OCC_REGION_H_
#define _OCC_REGION_H_
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#include "Mesh.h"
#include "GRegion.h"
class OCCRegion : public GRegion {
protected:
TopoDS_Solid s;
public:
OCCRegion(GModel *m, TopoDS_Solid s , int num, TopTools_IndexedMapOfShape &fmap);
virtual ~OCCRegion() {}
virtual GeomType geomType() const;
ModelType getNativeType() const { return OpenCascadeModel; }
void * getNativePtr() const { return (void*)&s; }
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment