PLaSK library
Loading...
Searching...
No Matches
plask::MeshD< dimension > Struct Template Referenceabstract

Base class for all meshes defined for specified number of dimensions. More...

#include <plask/mesh/mesh.hpp>

Inheritance diagram for plask::MeshD< dimension >:
[legend]
Collaboration diagram for plask::MeshD< dimension >:
[legend]

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 >, LocalCoordsconst_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 ()
 
MeshDoperator= (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.
 

Detailed Description

template<int dimension>
struct plask::MeshD< dimension >

Base class for all meshes defined for specified number of dimensions.

Definition at line 239 of file mesh.hpp.

Member Typedef Documentation

◆ const_iterator

template<int dimension>
typedef IndexedIterator< const MeshD<dimension>, LocalCoords > plask::MeshD< dimension >::const_iterator

Random access iterator type which allow iterate over all points in this mesh, in order appointed by operator[].

This iterator type is indexed, which means that it have (read-write) index field equal to 0 for begin() and growing up to size() for end().

Definition at line 265 of file mesh.hpp.

◆ iterator

template<int dimension>
typedef const_iterator plask::MeshD< dimension >::iterator

Definition at line 266 of file mesh.hpp.

◆ Iterator

template<int dimension>
typedef const_iterator plask::MeshD< dimension >::Iterator

Definition at line 267 of file mesh.hpp.

◆ LocalCoords

template<int dimension>
typedef Primitive<DIM>::DVec plask::MeshD< dimension >::LocalCoords

Type of vector representing coordinates in local space.

Definition at line 245 of file mesh.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<int dimension>
anonymous enum

Number of dimensions.

Enumerator
DIM 

Definition at line 242 of file mesh.hpp.

Constructor & Destructor Documentation

◆ MeshD() [1/2]

template<int dimension>
plask::MeshD< dimension >::MeshD ( const MeshD< dimension > &  PLASK_UNUSEDto_copy)
inline

Initialize this to be the same as to_copy but don't copy any changes observer.

Parameters
to_copyobject to copy

Definition at line 279 of file mesh.hpp.

◆ MeshD() [2/2]

template<int dimension>
plask::MeshD< dimension >::MeshD ( )
inline

Definition at line 281 of file mesh.hpp.

Member Function Documentation

◆ at()

◆ begin()

template<int dimension>
const_iterator plask::MeshD< dimension >::begin ( ) const
inline
Returns
iterator referring to the first point in this mesh

Definition at line 270 of file mesh.hpp.

◆ end()

template<int dimension>
const_iterator plask::MeshD< dimension >::end ( ) const
inline
Returns
iterator referring to the past-the-end point in this mesh

Definition at line 273 of file mesh.hpp.

◆ hasSameNodes()

template<int dimension>
bool plask::MeshD< dimension >::hasSameNodes ( const MeshD< dimension > &  to_compare) const
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.

Parameters
to_comparemesh to compare
Returns
to_compare represent the same sequence of points as this

Definition at line 61 of file mesh.cpp.

◆ operator!=()

template<int dimension>
bool plask::MeshD< dimension >::operator!= ( const MeshD< dimension > &  to_compare) const
inline

Check if this mesh and to_compare represent different sequences of points.

Parameters
to_comparemesh to compare
Returns
true only if this mesh and to_compare represent different sequences of points

Definition at line 304 of file mesh.hpp.

◆ operator=()

template<int dimension>
MeshD & plask::MeshD< dimension >::operator= ( const MeshD< dimension > &  PLASK_UNUSEDto_copy)
inline

Set this to be the same as to_copy but doesn't changed changes observer.

Parameters
to_copyobject to copy

Definition at line 287 of file mesh.hpp.

◆ operator==()

template<int dimension>
bool plask::MeshD< dimension >::operator== ( const MeshD< dimension > &  to_compare) const
inline

Check if this mesh and to_compare represent the same sequence of points (have exactly the same points in the same order).

Parameters
to_comparemesh to compare
Returns
to_compare represent the same sequence of points as this

Definition at line 294 of file mesh.hpp.

◆ operator[]()

template<int dimension>
LocalCoords plask::MeshD< dimension >::operator[] ( std::size_t  index) const
inline

Get point with given mesh index.

Parameters
indexindex of point, from 0 to size()-1
Returns
point with given index

Definition at line 259 of file mesh.hpp.

◆ print()

template<int dimension>
void plask::MeshD< dimension >::print ( std::ostream &  out) const
overridevirtual

Print this to stream out.

Parameters
outprint destination, output stream

Implements plask::Printable.

Definition at line 56 of file mesh.cpp.


The documentation for this struct was generated from the following files: