Skip to content
Snippets Groups Projects
Select Git revision
  • 69ac9cd3ef52be8d0f7967abeed43b24376eebb6
  • master default protected
  • relaying
  • overlaps_tags_and_distributed_export
  • patches-4.14
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • alphashapes
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • 3115-issue-fix
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
41 results

OCCAttributes.h

Blame
  • OCCAttributes.h 8.81 KiB
    // Gmsh - Copyright (C) 1997-2019 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
    
    #ifndef OCC_ATTRIBUTES_H
    #define OCC_ATTRIBUTES_H
    
    #include <vector>
    #include <string>
    #include "GmshConfig.h"
    #include "GmshMessage.h"
    #include "OS.h"
    #include "rtree.h"
    
    #if defined(HAVE_OCC)
    
    #include <Bnd_Box.hxx>
    #include <BRepBndLib.hxx>
    #include <TopoDS_Shape.hxx>
    #include <BRepTools.hxx>
    
    class OCCAttributes {
    private:
      int _dim;
      TopoDS_Shape _shape;
      double _meshSize;
      ExtrudeParams *_extrude;
      int _sourceDim;
      TopoDS_Shape _sourceShape;
      std::string _label;
    
    public:
      OCCAttributes() : _dim(-1), _meshSize(MAX_LC), _extrude(0), _sourceDim(-1)
      {
      }
      OCCAttributes(int dim, TopoDS_Shape shape)
        : _dim(dim), _shape(shape), _meshSize(MAX_LC), _extrude(0), _sourceDim(-1)
      {
      }
      OCCAttributes(int dim, TopoDS_Shape shape, double size)
        : _dim(dim), _shape(shape), _meshSize(size), _extrude(0), _sourceDim(-1)
      {
      }
      OCCAttributes(int dim, TopoDS_Shape shape, ExtrudeParams *e,
                        int sourceDim, TopoDS_Shape sourceShape)
        : _dim(dim), _shape(shape), _meshSize(MAX_LC), _extrude(e),
          _sourceDim(sourceDim), _sourceShape(sourceShape)
      {
      }
      OCCAttributes(int dim, TopoDS_Shape shape, const std::string &label)
        : _dim(dim), _shape(shape), _meshSize(MAX_LC), _extrude(0), _sourceDim(-1),
          _label(label)
      {
      }
      ~OCCAttributes() {}
      int getDim() { return _dim; }
      TopoDS_Shape getShape() { return _shape; }
      double getMeshSize() { return _meshSize; }
      ExtrudeParams *getExtrudeParams() { return _extrude; }
      int getSourceDim() { return _sourceDim; }
      TopoDS_Shape getSourceShape() { return _sourceShape; }
      const std::string &getLabel() { return _label; }
    };
    
    // attributes are stored according to the center of their associated shape
    // bounding box; this allows to efficiently search for potential matches, even
    // if the actual underlying shape has been modified (typically through boolean
    // fragments)
    class OCCAttributesRTree {