PLaSK library
|
Base class for all meshes defined for specified number of dimensions. More...
#include <plask/mesh/mesh.hpp>
Public Types | |
enum | { DIM = dimension } |
Number of dimensions. More... | |
typedef Primitive< DIM >::DVec | LocalCoords |
Type of vector representing coordinates in local space. | |
typedef IndexedIterator< const MeshD< dimension >, LocalCoords > | const_iterator |
Random access iterator type which allow iterate over all points in this mesh, in order appointed by operator[]. | |
typedef const_iterator | iterator |
typedef const_iterator | Iterator |
Public Member Functions | |
virtual LocalCoords | at (std::size_t index) const =0 |
Get point with given mesh index. | |
LocalCoords | operator[] (std::size_t index) const |
Get point with given mesh index. | |
const_iterator | begin () const |
const_iterator | end () const |
MeshD (const MeshD &PLASK_UNUSED(to_copy)) | |
Initialize this to be the same as to_copy but don't copy any changes observer. | |
MeshD () | |
MeshD & | operator= (const MeshD &PLASK_UNUSED(to_copy)) |
Set this to be the same as to_copy but doesn't changed changes observer. | |
bool | operator== (const MeshD &to_compare) const |
Check if this mesh and to_compare represent the same sequence of points (have exactly the same points in the same order). | |
bool | operator!= (const MeshD &to_compare) const |
Check if this mesh and to_compare represent different sequences of points. | |
void | print (std::ostream &out) const override |
Print this to stream out . | |
Public Member Functions inherited from plask::Mesh | |
template<typename ClassT , typename methodT > | |
boost::signals2::connection | changedConnectMethod (ClassT *obj, methodT method, boost::signals2::connect_position at=boost::signals2::at_back) |
Connect a method to changed signal. | |
template<typename ClassT , typename methodT > | |
void | changedDisconnectMethod (ClassT *obj, methodT method) |
template<typename EventT = Event, typename ... Args> | |
void | fireChanged (Args &&... event_constructor_params_without_source) |
Call changed with this as event source. | |
void | fireResized () |
This method is called when the mesh is resized. | |
virtual std::size_t | size () const =0 |
virtual bool | empty () const |
virtual void | writeXML (XMLElement &object) const |
Write mesh to XML. | |
virtual | ~Mesh () |
Public Member Functions inherited from plask::Printable | |
virtual | ~Printable () |
std::string | str () const |
Get string representation of this using print method. | |
Public Member Functions inherited from plask::MeshBase | |
virtual | ~MeshBase () |
Protected Member Functions | |
virtual bool | hasSameNodes (const MeshD< dimension > &to_compare) const |
Check if this mesh and to_compare represent the same sequence of points (have exactly the same points in the same order). | |
Protected Member Functions inherited from plask::Mesh | |
virtual void | onChange (const Event &evt) |
This method is called when the mesh is changed, just before changed signal. | |
Additional Inherited Members | |
Public Attributes inherited from plask::Mesh | |
boost::signals2::signal< void(Event &)> | changed |
Changed signal, fired when mesh was changed. | |
Base class for all meshes defined for specified number of dimensions.
typedef IndexedIterator< const MeshD<dimension>, LocalCoords > plask::MeshD< dimension >::const_iterator |
typedef const_iterator plask::MeshD< dimension >::iterator |
typedef const_iterator plask::MeshD< dimension >::Iterator |
|
inline |
|
pure virtual |
Get point with given mesh index.
index | index of point, from 0 to size()-1 |
index
Implemented in plask::optical::modal::LevelsAdapterRectangular< dim >::Mesh, plask::optical::modal::LevelsAdapterRectangular< dim >::Mesh, plask::optical::modal::LevelsAdapterGeneric< dim >::Mesh, plask::optical::modal::LevelsAdapterRectangular< dim >::Mesh, plask::MidpointAxis, plask::OnePointMesh< DIM >, plask::TranslatedMesh< DIM >, plask::ExtrudedTriangularMesh3D, plask::ExtrudedTriangularMesh3D::ElementMesh, plask::detail::FlatMesh, plask::LateralMesh3D< MeshT >, plask::MultiLateralMesh3D< MeshT >, plask::OrderedAxis, plask::RectangularMesh2D, plask::RectangularMesh3D, plask::RectangularMaskedMeshBase< DIM >::ElementMeshBase< MaskedMeshType >, plask::RectilinearMesh3D, plask::RegularAxis, plask::ReductionTo2DMesh, plask::CylReductionTo2DMesh, plask::CartesianMesh2DTo3D, plask::CartesianMesh2DTo3DExtend, plask::PointsOnCircleMeshExtend, plask::TriangularMesh2D, plask::TriangularMesh2D::ElementMesh, and plask::OnePointAxis.
|
inline |
|
inline |
|
protectedvirtual |
Check if this mesh and to_compare
represent the same sequence of points (have exactly the same points in the same order).
Default implementation naively compares sequences of points, so its pesimistic complexity is O(size()). However subclasses can use extra optimizations.
to_compare | mesh to compare |
to_compare
represent the same sequence of points as this
|
inline |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Print this to stream out
.
out | print destination, output stream |
Implements plask::Printable.