.. oe:namespace:: OEMath



.. meta::
   :keywords: OEBox


.. _OEMath_OEBox:

.. oe:class:: OEBox

   .. oe:api::

      class OEBox

   :ref:`OEBox <OEMath_OEBox>` class represents a box aligned to the x, y and z coordinate axis.


   .. oe:method:: Constructors

      .. oe:language:: c++ java csharp

         .. oe:api::

            OEBox()
            OEBox(const OEBox&)

      .. oe:language:: python

         .. oe:api:: python

            OEBox() -> OEBox
            OEBox(arg2: OEBox) -> OEBox

      Default and copy constructors

   .. oe:method:: operator=
      :language: c++
  
      .. oe:api::

         OEBox& operator=(const OEBox& rhs)

      Assignment operator

      Assignment operator.


   .. oe:method:: Extend
        
      .. oe:language:: c++ java csharp

         .. oe:api::

            bool Extend(const float x, const float y, const float z)
            bool Extend(const float value)

      .. oe:language:: python

         .. oe:api:: python

            Extend(x: float, y: float, z: float) -> bool
            Extend(value: float) -> bool

      Extend the box in all dimensions with the specified values.  The box is extended simultaneously
      in both maximum and minimum coordinate directions

   .. oe:method:: GetArea
        
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetArea() const

      .. oe:language:: python

         .. oe:api:: python

            GetArea() -> float

      Returns the surface area of the box

   .. oe:method:: GetVolume
        
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetVolume() const

      .. oe:language:: python

         .. oe:api:: python

            GetVolume() -> float

      Returns the volume of the box

   .. oe:method:: GetXDim
        
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetXDim() const

      .. oe:language:: python

         .. oe:api:: python

            GetXDim() -> float

      Returns the X dimension value of the box

   .. oe:method:: GetYDim
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetYDim() const

      .. oe:language:: python

         .. oe:api:: python

            GetYDim() -> float

      Returns the Y dimension value of the box

   .. oe:method:: GetZDim
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetZDim() const

      .. oe:language:: python

         .. oe:api:: python

            GetZDim() -> float

      Returns the Z dimension value of the box

   .. oe:method:: GetXMax
        
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetXMax() const

      .. oe:language:: python

         .. oe:api:: python

            GetXMax() -> float

      Returns the maximum X value of the box

   .. oe:method:: GetYMax
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetYMax() const

      .. oe:language:: python

         .. oe:api:: python

            GetYMax() -> float

      Returns the maximum Y value of the box

   .. oe:method:: GetZMax
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetZMax() const

      .. oe:language:: python

         .. oe:api:: python

            GetZMax() -> float

      Returns the maximum Z value of the box

   .. oe:method:: GetXMid
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetXMid() const

      .. oe:language:: python

         .. oe:api:: python

            GetXMid() -> float

      Returns the midpoint of X dimension of the box

   .. oe:method:: GetYMid
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetYMid() const

      .. oe:language:: python

         .. oe:api:: python

            GetYMid() -> float

      Returns the midpoint of Y dimension of the box

   .. oe:method:: GetZMid
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetZMid() const

      .. oe:language:: python

         .. oe:api:: python

            GetZMid() -> float

      Returns the midpoint of Z dimension of the box

   .. oe:method:: GetXMin
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetXMin() const

      .. oe:language:: python

         .. oe:api:: python

            GetXMin() -> float

      Returns the minimum X value of the box

   .. oe:method:: GetYMin
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetYMin() const

      .. oe:language:: python

         .. oe:api:: python

            GetYMin() -> float

      Returns the minimum Y value of the box

   .. oe:method:: GetZMin
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetZMin() const

      .. oe:language:: python

         .. oe:api:: python

            GetZMin() -> float

      Returns the minimum Z value of the box

   .. oe:method:: IsInside
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            bool IsInside(const float x, const float y, const float z) const

      .. oe:language:: python

         .. oe:api:: python

            IsInside(x: float, y: float, z: float) -> bool

      Returns if the specified point is inside the box

   .. oe:method:: Setup
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            bool Setup(const float x1, const float y1, const float z1,
                       const float x2, const float y2, const float z2)
            bool Setup(const float* xyz, const unsigned numPoints,
                       const bool addbox = 0.0f)
            bool Setup(const float* center, const float* extents)

      .. oe:language:: python

         .. oe:api:: python

            Setup(x1: float, y1: float, z1: float, x2: float, y2: float,
                  z2: float) -> bool
            Setup(xyz: OEFloatArray, numPoints: int, addbox: float = 0.0) -> bool
            Setup(center: OEFloatArray, extents: OEFloatArray) -> bool

      Sets up the box.  

      The first overload expects the maximum and minimum values in all directions.
      The max and min X values are the max and min of *x1*, *x2* respectively.  Minimum 
      and maximum values of Y and Z are selected in an analogous fashion.

      The second overload creates a box that encapsulates all the specified data points.
      The number of values in ``xyz`` must be three times that specified in ``numPoints``.
      The value in ``addbox`` extends the box in all three dimensions with the specified value.
      The box is extended simultaneously in both maximum and minimum coordinate directions,
      when specified.

      The third overload creates a box with the specified center and extent.
