Skip to content
Snippets Groups Projects
Select Git revision
  • 44f622c69e1a8386f8dd66b63bb5b07c55b00f9f
  • master default protected
  • patches-4.14
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • alphashapes
  • relaying
  • 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
  • 3023-Fillet2D-Update
  • 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 10.51 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 "Context.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;
      std::vector<double> _color;
    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 dim, TopoDS_Shape shape, double r, double g, double b,
                    double a = 1., int boundary = 0)
        : _dim(dim), _shape(shape), _meshSize(MAX_LC), _extrude(0), _sourceDim(-1)
      {
        _color.resize(boundary ? 5 : 4);
        _color[0] = r;
        _color[1] = g;
        _color[2] = b;
        _color[3] = a;
        if(boundary) _color[4] = boundary;
      }
      ~OCCAttributes() {}
      int getDim() { return _dim; }