Skip to content
Snippets Groups Projects
Select Git revision
  • a3221785cab590b387209068b407cbd5e61faf80
  • master default protected
  • dof-renumbering
  • gdemesy-master-patch-30528
  • eval-space-time
  • oscillating_multiharm
  • MH_movement
  • axisqu
  • write_vtu_and_ensight_formats
  • movingband
  • CP_1972_add_vtu_file_writing
  • mortar
  • fast_freq_sweep_Resolution
  • applyresolvent_again
  • marteaua-master-patch-54323
  • patch-1
  • binde-master-patch-08072
  • binde-master-patch-52461
  • BCGSL
  • resolvent
  • TreeElementsOf
  • getdp_3_5_0
  • getdp_3_4_0
  • getdp_3_3_0
  • getdp_3_2_0
  • getdp_3_1_0
  • getdp_3_0_4
  • getdp_3_0_3
  • getdp_3_0_2
  • getdp_3_0_1
  • getdp_3_0_0
  • onelab_mobile_2.1.0
  • getdp_2_11_3 protected
  • getdp_2_11_2 protected
  • getdp_2_11_1 protected
  • getdp_2_11_0 protected
  • getdp_2_10_0 protected
  • getdp_2_9_2 protected
  • getdp_2_9_1 protected
  • getdp_2_9_0 protected
  • getdp_2_8_0 protected
41 results

F_Raytracing.cpp

Blame
  • SOrientedBoundingBox.cpp 18.39 KiB
    // Gmsh - Copyright (C) 1997-2012 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to <gmsh@geuz.org>.
    //
    // Contributor(s):
    //   Bastien Gorissen
    //
    
    #include <math.h>
    #include <time.h>
    #include <stdlib.h>
    #include "SOrientedBoundingBox.h"
    #include "fullMatrix.h"
    #include "DivideAndConquer.h"
    #include "SBoundingBox3d.h"
    
    double SOrientedBoundingRectangle::area()
    {
      double b = size->at(0);
      double B = size->at(1);
      return (b*B);
    }
    
    SOrientedBoundingRectangle::SOrientedBoundingRectangle()
    {
      center = new std::vector<double>(2,0);
      size = new std::vector<double>(2,0);
      axisX = new std::vector<double>(2,0);
      axisY = new std::vector<double>(2,0);
    }
    
    SOrientedBoundingRectangle::~SOrientedBoundingRectangle()
    {
      delete center;
      delete size;
      delete axisX;
      delete axisY;
    }
    
    SOrientedBoundingBox::SOrientedBoundingBox()
    {
      center = SVector3();
      size = SVector3();
      axisX = SVector3();
      axisY = SVector3();
      axisZ = SVector3();
    }
    
    SOrientedBoundingBox::SOrientedBoundingBox(SVector3 &center_,
                                               double sizeX,
                                               double sizeY,
                                               double sizeZ,
                                               const SVector3 &axisX_,
                                               const SVector3 &axisY_,
                                               const SVector3 &axisZ_)
    {
      center = center_;
      size = SVector3(sizeX, sizeY, sizeZ);
      axisX = axisX_;
      axisX.normalize();
      axisY = axisY_;
      axisY.normalize();
      axisZ = axisZ_;
      axisZ.normalize();
    
      double dx = 0.5 * size[0];
      double dy = 0.5 * size[1];
      double dz = 0.5 * size[2];