.. oe:namespace:: OESystem



.. meta::
   :keywords: OESkewGrid, SkewGrid


.. _OESystem_OESkewGrid:

.. oe:class:: OESkewGrid

   .. oe:api::


      class OESkewGrid : public OEGridAbstractBase

   This class represents `OESkewGrid`.

   The following methods are publicly inherited from :ref:`OEGridAbstractBase <OESystem_OEGridAbstractBase>`:

   ================================================================== ================================================================== ===================================================================
   :oe:meth:`Clear<OESystem::OEGridAbstractBase::Clear>`              :oe:meth:`GetTitle<OESystem::OEGridAbstractBase::GetTitle>`        :oe:meth:`GetZMid<OESystem::OEGridAbstractBase::GetZMid>`          
   :oe:meth:`GetDataType<OESystem::OEGridAbstractBase::GetDataType>`  :oe:meth:`GetXDim<OESystem::OEGridAbstractBase::GetXDim>`          :oe:meth:`IsDataType<OESystem::OEGridAbstractBase::IsDataType>`    
   :oe:meth:`GetDim<OESystem::OEGridAbstractBase::GetDim>`            :oe:meth:`GetXMid<OESystem::OEGridAbstractBase::GetXMid>`          :oe:meth:`IsSpacingSet<OESystem::OEGridAbstractBase::IsSpacingSet>`
   :oe:meth:`GetMid<OESystem::OEGridAbstractBase::GetMid>`            :oe:meth:`GetYDim<OESystem::OEGridAbstractBase::GetYDim>`          :oe:meth:`SetTitle<OESystem::OEGridAbstractBase::SetTitle>`        
   :oe:meth:`GetSize<OESystem::OEGridAbstractBase::GetSize>`          :oe:meth:`GetYMid<OESystem::OEGridAbstractBase::GetYMid>`                                                                             
   :oe:meth:`GetSpacing<OESystem::OEGridAbstractBase::GetSpacing>`    :oe:meth:`GetZDim<OESystem::OEGridAbstractBase::GetZDim>`                                                                             
   ================================================================== ================================================================== ===================================================================

   The following methods are publicly inherited from :ref:`OEBase <OESystem_OEBase>`:

   ======================================================== ========================================================= =========================================================
   :oe:meth:`operator=<OESystem::OEBase::operator=>`        :oe:meth:`GetData<OESystem::OEBase::GetData>`             :oe:meth:`IsDataType<OESystem::OEBase::IsDataType>`      
   :oe:meth:`operator+=<OESystem::OEBase::operator+=>`      :oe:meth:`GetDataIter<OESystem::OEBase::GetDataIter>`     :oe:meth:`SetBaseData<OESystem::OEBase::SetBaseData>`    
   :oe:meth:`AddBaseData<OESystem::OEBase::AddBaseData>`    :oe:meth:`GetDataType<OESystem::OEBase::GetDataType>`     :oe:meth:`SetBoolData<OESystem::OEBase::SetBoolData>`    
   :oe:meth:`AddData<OESystem::OEBase::AddData>`            :oe:meth:`GetDoubleData<OESystem::OEBase::GetDoubleData>` :oe:meth:`SetData<OESystem::OEBase::SetData>`            
   :oe:meth:`Clear<OESystem::OEBase::Clear>`                :oe:meth:`GetFloatData<OESystem::OEBase::GetFloatData>`   :oe:meth:`SetDoubleData<OESystem::OEBase::SetDoubleData>`
   :oe:meth:`CreateCopy<OESystem::OEBase::CreateCopy>`      :oe:meth:`GetIntData<OESystem::OEBase::GetIntData>`       :oe:meth:`SetFloatData<OESystem::OEBase::SetFloatData>`  
   :oe:meth:`DeleteData<OESystem::OEBase::DeleteData>`      :oe:meth:`GetStringData<OESystem::OEBase::GetStringData>` :oe:meth:`SetIntData<OESystem::OEBase::SetIntData>`      
   :oe:meth:`GetBoolData<OESystem::OEBase::GetBoolData>`    :oe:meth:`HasData<OESystem::OEBase::HasData>`             :oe:meth:`SetStringData<OESystem::OEBase::SetStringData>`
   ======================================================== ========================================================= =========================================================

   .. oe:method:: Constructors

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

         .. oe:api::

            OESkewGrid()

      .. oe:language:: python

         .. oe:api:: python

            OESkewGrid() -> OESkewGrid

      Creates a one point :ref:`OESkewGrid <OESystem_OESkewGrid>` grid object.

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

         .. oe:api::

            OESkewGrid(const OEScalarGrid& rhs)
            OESkewGrid(const OESkewGrid& rhs)
            OESkewGrid(const OESkewGridImpl& rhs)
            OESkewGrid(const OEFixedGrid<float>& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OESkewGrid(rhs: OESkewGrid) -> OESkewGrid
            OESkewGrid(f: OESkewGridImpl) -> OESkewGrid
            OESkewGrid(g: OEScalarGrid) -> OESkewGrid
            OESkewGrid(f: OEFixedFloatGrid) -> OESkewGrid

      Creates a :ref:`OESkewGrid <OESystem_OESkewGrid>` object and copies the entire contents of the 'rhs'.

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

      .. oe:api::

         OESkewGrid& operator=(const OESkewGrid& rhs)
         OESkewGrid& operator=(const OEScalarGrid& rhs)
         OESkewGrid& operator=(const OESkewGridImpl& rhs)
         OESkewGrid& operator=(const OEFixedGrid<float>& rhs)

      Copies the contents of 'rhs'.

      Assignment operator.


   .. oe:method:: operator bool

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

         .. oe:api::

            operator bool() const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool

   .. oe:method:: AsRegularGrid

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

         .. oe:api::

            const OEFixedGrid<float>& AsRegularGrid() const

      .. oe:language:: python

         .. oe:api:: python

            AsRegularGrid() -> OEFixedFloatGrid

   .. oe:method:: Clear

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

         .. oe:api::

            void Clear()

      .. oe:language:: python

         .. oe:api:: python

            Clear() -> None

      Reallocates memory for the grid, effectively clearing all the grid values. 
      Calls through to :oe:meth:`OESystem::OEBase::Clear`.

   .. oe:method:: CreateCopy

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

         .. oe:api::

            OESystem::OEBase* CreateCopy() const

      .. oe:language:: python

         .. oe:api:: python

            CreateCopy() -> OESkewGrid

      Makes a copy of the grid instance.

   .. oe:method:: ElementToGridIdx

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

         .. oe:api::

            bool ElementToGridIdx(unsigned int el, unsigned int& ix,
                                  unsigned int& iy, unsigned int& iz) const

      .. oe:language:: python

         .. oe:api:: python

            ElementToGridIdx(el: int) -> Tuple[int, int, int]

      The element 'el' is the one dimensional index into the grid points. 
      This function converts this one dimensional index into the three dimensional 
      indices (ix, iy, iz) for the associated grid point. 
      Returns ``false`` if 'el' is outside the array bounds.

   .. oe:method:: ElementToSpatialCoord

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

         .. oe:api::

            bool ElementToSpatialCoord(unsigned int el, float& x, float& y,
                                       float& z) const

      .. oe:language:: python

         .. oe:api:: python

            ElementToSpatialCoord(el: int) -> Tuple[float, float, float]

      The element 'el' is the one dimensional index into the grid points. 
      This function converts this one dimensional index into the Cartesian coordinates 
      (x,y,z) of the associated grid point. Returns false if 'el' is outside the array bounds.

   .. oe:method:: GetDataType

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

         .. oe:api::

            const void* GetDataType() const

      .. oe:language:: python

         .. oe:api:: python

            GetDataType() -> void

      Returns the data type of the grid.

   .. oe:method:: GetDim

      .. oe:api::

         bool GetDim(unsigned int &xdim, unsigned int &ydim, unsigned int &zdim) const

      Retrieves the grid dimensions (*i.e.* the wideness of the grid for a specific axis) 
      into 'xdim', 'ydim', 'zdim' arguments. 

   .. oe:method:: GetMid

      .. oe:api::

         bool GetMid(float &midx, float &midy, float &midz) const

      Retrieves the grid midpoint (*i.e.* the center of the grid) into 'midx', 'midy' and 
      'midz' arguments. The midpoint defines where the grid is located in Cartesian space. 
      Returns ``false`` if the midpoint is not completely defined 
      (! :oe:meth:`IsXMidSet()<OESystem::OEGridBase::IsXMidSet>` || 
      ! :oe:meth:`IsYMidSet()<OESystem::OEGridBase::IsYMidSet>` || 
      ! :oe:meth:`IsZMidSet()<OESystem::OEGridBase::IsZMidSet>`)

   .. oe:method:: GetReentrant

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

         .. oe:api::

            unsigned int GetReentrant() const

      .. oe:language:: python

         .. oe:api:: python

            GetReentrant() -> int

   .. oe:method:: GetSize

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

         .. oe:api::

            unsigned int GetSize() const

      .. oe:language:: python

         .. oe:api:: python

            GetSize() -> int

      Returns the number of grid points inside this grid.

   .. oe:method:: GetSpaceGroup

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

         .. oe:api::

            unsigned int GetSpaceGroup() const

      .. oe:language:: python

         .. oe:api:: python

            GetSpaceGroup() -> int

   .. oe:method:: GetSpacing

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

         .. oe:api::

            float GetSpacing() const

      .. oe:language:: python

         .. oe:api:: python

            GetSpacing() -> float

      Returns the length between grid points.

   .. oe:method:: GetTitle

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

         .. oe:api::

            std::string GetTitle() const

      .. oe:language:: python

         .. oe:api:: python

            GetTitle() -> str

      Returns the title of this grid. The title defaults to an empty string.

   .. oe:method:: GetType

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

         .. oe:api::

            unsigned int GetType() const

      .. oe:language:: python

         .. oe:api:: python

            GetType() -> int

      Returns the data type tag for the grid.

   .. oe:method:: GetUnitCell

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

         .. oe:api::

            bool GetUnitCell(float& A, float& B, float& C, float& alpha,
                             float& beta, float& gamma) const

      .. oe:language:: python

         .. oe:api:: python

            GetUnitCell(A: float, B: float, C: float, alpha: float,
                        beta: float, gamma: float) -> bool

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

      .. oe:api::

         float *GetValues()
         const float *GetValues() const

   .. oe:method:: GetXDim

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

         .. oe:api::

            unsigned int GetXDim() const

      .. oe:language:: python

         .. oe:api:: python

            GetXDim() -> int

      Returns how many grid points there are for the x-dimension of the grid. 

   .. oe:method:: GetXMid

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

         .. oe:api::

            float GetXMid() const

      .. oe:language:: python

         .. oe:api:: python

            GetXMid() -> float

      Returns the center of this grid along the x-axis.

   .. oe:method:: GetYDim

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

         .. oe:api::

            unsigned int GetYDim() const

      .. oe:language:: python

         .. oe:api:: python

            GetYDim() -> int

      Returns how many grid points there are for the y-dimension of the grid. 

   .. oe:method:: GetYMid

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

         .. oe:api::

            float GetYMid() const

      .. oe:language:: python

         .. oe:api:: python

            GetYMid() -> float

      Returns the center of this grid along the y-axis.

   .. oe:method:: GetZDim

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

         .. oe:api::

            unsigned int GetZDim() const

      .. oe:language:: python

         .. oe:api:: python

            GetZDim() -> int

      Returns how many grid points there are for the z-dimension of the grid. 

   .. oe:method:: GetZMid

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

         .. oe:api::

            float GetZMid() const

      .. oe:language:: python

         .. oe:api:: python

            GetZMid() -> float

      Returns the center of this grid along the z-axis.

   .. oe:method:: HasSpaceGroup

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

         .. oe:api::

            bool HasSpaceGroup() const

      .. oe:language:: python

         .. oe:api:: python

            HasSpaceGroup() -> bool

   .. oe:method:: HasUnitCell

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

         .. oe:api::

            bool HasUnitCell() const

      .. oe:language:: python

         .. oe:api:: python

            HasUnitCell() -> bool

   .. oe:method:: IsDataType

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

         .. oe:api::

            bool IsDataType(const void* type) const

      .. oe:language:: python

         .. oe:api:: python

            IsDataType(type: void) -> bool

      Returns whether type is the same as the instance this method is called on
      (*i.e.* :ref:`OESkewGrid <OESystem_OESkewGrid>`).

   .. oe:method:: IsRegular

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

         .. oe:api::

            bool IsRegular() const

      .. oe:language:: python

         .. oe:api:: python

            IsRegular() -> bool

   .. oe:method:: IsSpacingSet

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

         .. oe:api::

            bool IsSpacingSet() const

      .. oe:language:: python

         .. oe:api:: python

            IsSpacingSet() -> bool

      Returns whether the spacing for this grid has been specified.

   .. oe:method:: IsTitleSet

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

         .. oe:api::

            bool IsTitleSet() const

      .. oe:language:: python

         .. oe:api:: python

            IsTitleSet() -> bool

      Returns whether there is a title associated with this grid.

   .. oe:method:: SetDim

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

         .. oe:api::

            bool SetDim(unsigned int xdim, unsigned int ydim, unsigned int zdim)

      .. oe:language:: python

         .. oe:api:: python

            SetDim(xdim: int, ydim: int, zdim: int) -> bool

      Sets the number of grid points for each dimension.

   .. oe:method:: SetMid

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

         .. oe:api::

            bool SetMid(float midx, float midy, float midz)

      .. oe:language:: python

         .. oe:api:: python

            SetMid(midx: float, midy: float, midz: float) -> bool

      Sets the mid-point (center) of the grid.

   .. oe:method:: SetReentrant

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

         .. oe:api::

            void SetReentrant(bool state = true)

      .. oe:language:: python

         .. oe:api:: python

            SetReentrant(state: bool = True) -> None

   .. oe:method:: SetSpaceGroup

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

         .. oe:api::

            bool SetSpaceGroup(unsigned int group)

      .. oe:language:: python

         .. oe:api:: python

            SetSpaceGroup(group: int) -> bool

   .. oe:method:: SetSpacing

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

         .. oe:api::

            bool SetSpacing(float spacing)

      .. oe:language:: python

         .. oe:api:: python

            SetSpacing(spacing: float) -> bool

      Sets the length between grid points.

   .. oe:method:: SetTitle

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

         .. oe:api::

            bool SetTitle(const std::string& title)

      .. oe:language:: python

         .. oe:api:: python

            SetTitle(title: str) -> bool

      Sets the title associated with this grid.

   .. oe:method:: SetType

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

         .. oe:api::

            void SetType(unsigned int type)

      .. oe:language:: python

         .. oe:api:: python

            SetType(type: int) -> None

      Sets the tag associated with this grid.

   .. oe:method:: SetUnitCell

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

         .. oe:api::

            bool SetUnitCell(float A, float B, float C, float alpha,
                             float beta, float gamma, unsigned int nx,
                             unsigned int ny, unsigned int nz)

      .. oe:language:: python

         .. oe:api:: python

            SetUnitCell(A: float, B: float, C: float, alpha: float,
                        beta: float, gamma: float, nx: int, ny: int, nz: int) -> bool

   .. oe:method:: SetValues

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

         .. oe:api::

            bool SetValues(const float* values, unsigned int length)

      .. oe:language:: python

         .. oe:api:: python

            SetValues(values: OEFloatArray, length: int) -> bool

