Public Types | Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
imath::TFulcrumGrid< Position, Fulcrums > Class Template Reference

Representation of fulcrums in multi-dimesional regular grid. More...

#include <TFulcrumGrid.h>

Inheritance diagram for imath::TFulcrumGrid< Position, Fulcrums >:
iser::ISerializable istd::IChangeable istd::IPolymorphic

Public Types

enum  ChangeFlags { CF_SORT_LAYERS = 0x8352707 }
 Data model change notification flags. More...
 
typedef Fulcrums::ElementType FulcrumType
 
typedef Fulcrums::IndexType FulcrumIndex
 
typedef Fulcrums::SizesType FulcrumSizes
 
typedef Position PositionType
 
- Public Types inherited from istd::IChangeable
enum  ChangeFlags {
  CF_ACF_INTERNAL = 0, CF_ALL_DATA, CF_ANY, CF_DESTROYING,
  CF_DELEGATED, CF_NO_UNDO
}
 Data model change notification flags. More...
 
enum  SupportedOperations {
  SO_NONE = 0, SO_OBSERVE = 1 << 0, SO_COPY = 1 << 1, SO_CLONE = 1 << 2,
  SO_COMPARE = 1 << 3, SO_RESET = 1 << 4
}
 Flags for supported operations. More...
 
enum  CompatibilityMode { CM_STRICT, CM_WITHOUT_REFS, CM_WITH_REFS, CM_CONVERT }
 Control how relationship betweeen objects are interpreted. More...
 

Public Member Functions

 TFulcrumGrid ()
 
void Reset ()
 Removes all fulcrum points. More...
 
FulcrumSizes GetGridSize () const
 Return complete grid size. More...
 
int GetDimensionsCount () const
 Get number of dimensions. More...
 
virtual bool SetDimensionsCount (int count)
 Set number of dimensions. More...
 
int GetLayersCount (int dimension) const
 Get number of fulcrum points used in this function. More...
 
virtual void SetLayersCount (int dimension, int count)
 Set number of fulcrum layers at specified dimension. More...
 
double GetLayerPosition (int dimension, int layerIndex) const
 Get position of specified layer of fulcrums. More...
 
virtual void SetLayerPosition (int dimension, int layerIndex, double position)
 Set position of specified layer of fulcrums. More...
 
void GetFulcrumPosition (const FulcrumIndex &index, PositionType &result) const
 Get position of node at specified grid index. More...
 
const FulcrumTypeGetFulcrumAtIndex (const FulcrumIndex &index) const
 Get value at specified index. More...
 
virtual void SetFulcrumAtIndex (const FulcrumIndex &index, const FulcrumType &value)
 Set single fulcrum point. More...
 
int InsertLayer (int dimension, double position)
 Inserts single fulcrum layer. More...
 
virtual void RemoveLayer (int dimension, int layerIndex)
 Remove fulcrums at spacified layer. More...
 
virtual bool Serialize (iser::IArchive &archive)
 Load or store state of this object as a archive stream. More...
 
bool operator== (const TFulcrumGrid< Position, Fulcrums > &value) const
 
bool operator!= (const TFulcrumGrid< Position, Fulcrums > &value) const
 
- Public Member Functions inherited from iser::ISerializable
virtual quint32 GetMinimalVersion (int versionId) const
 Get minimal needed version to correct storing of this data. More...
 
- Public Member Functions inherited from istd::IChangeable
virtual int GetSupportedOperations () const
 Get set of flags for supported operations. More...
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one. More...
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object. More...
 
virtual IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object. More...
 
virtual bool ResetData (CompatibilityMode mode=CM_WITHOUT_REFS)
 Reset data to its default state. More...
 
virtual void BeginChanges (const ChangeSet &changeSet)
 Starts the change transaction. More...
 
virtual void EndChanges (const ChangeSet &changeSet)
 Ends the change transaction. More...
 
virtual void BeginChangeGroup (const ChangeSet &changeSet)
 Starts group of changes. More...
 
virtual void EndChangeGroup (const ChangeSet &changeSet)
 Ends group of changes. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Member Functions

virtual void SortFulcrums ()
 Sort fulcrums in this collection. More...
 
int FindLayerIndex (int dimension, double value) const
 Find layer index of specified value for specified dimension. More...
 
Fulcrums::IndexType FindIndices (const PositionType &argument) const
 Find indices of cuboid containing specified argument value. More...
 
- Protected Member Functions inherited from istd::IChangeable
virtual void OnBeginChanges ()
 Callback function for begin change event. More...
 
virtual void OnEndChanges (const ChangeSet &changeSet)
 Callback function for end change event. More...
 

Static Protected Attributes

static const ChangeSet s_fulcrumPositionChange
 

Additional Inherited Members

- Static Public Member Functions inherited from istd::IChangeable
static const ChangeSetGetNoChanges ()
 Get empty set of changes. More...
 
static const ChangeSetGetAnyChange ()
 Get anonymous change set. More...
 
static const ChangeSetGetAllChanges ()
 Get anonymous change set. More...
 
static const ChangeSetGetDelegatedChanges ()
 Get delegated change set. More...
 

Detailed Description

template<class Position, class Fulcrums>
class imath::TFulcrumGrid< Position, Fulcrums >

Representation of fulcrums in multi-dimesional regular grid.

This grid may be imagined as set of parallel layers for each dimension. Number of this layers and their position can be individually controlled. Plese note, that method SetDimensionsCount must be called manually to initialize number of input dimensions also for fixed-size arguments.

Parameters
Positiontype of fulcrum position.
Resultfunction result type.
Fulcrumsarray type used to stored fulcrums. It muss define following public typedefs
  • ElementType type of element stored in this array,
  • IndexType type of index used to address elements,
  • SizesType type using to represent array size. This type muss define public typedef IndexType.

Definition at line 33 of file TFulcrumGrid.h.

Member Typedef Documentation

template<class Position, class Fulcrums>
typedef Fulcrums::IndexType imath::TFulcrumGrid< Position, Fulcrums >::FulcrumIndex

Definition at line 37 of file TFulcrumGrid.h.

template<class Position, class Fulcrums>
typedef Fulcrums::SizesType imath::TFulcrumGrid< Position, Fulcrums >::FulcrumSizes

Definition at line 38 of file TFulcrumGrid.h.

template<class Position, class Fulcrums>
typedef Fulcrums::ElementType imath::TFulcrumGrid< Position, Fulcrums >::FulcrumType

Definition at line 36 of file TFulcrumGrid.h.

template<class Position, class Fulcrums>
typedef Position imath::TFulcrumGrid< Position, Fulcrums >::PositionType

Definition at line 39 of file TFulcrumGrid.h.

Member Enumeration Documentation

template<class Position, class Fulcrums>
enum imath::TFulcrumGrid::ChangeFlags

Data model change notification flags.

Enumerator
CF_SORT_LAYERS 

Definition at line 44 of file TFulcrumGrid.h.

Constructor & Destructor Documentation

template<class Position , class Fulcrums >
imath::TFulcrumGrid< Position, Fulcrums >::TFulcrumGrid ( )

Definition at line 207 of file TFulcrumGrid.h.

Member Function Documentation

template<class Position , class Fulcrums >
Fulcrums::IndexType imath::TFulcrumGrid< Position, Fulcrums >::FindIndices ( const PositionType argument) const
protected

Find indices of cuboid containing specified argument value.

Definition at line 539 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
int imath::TFulcrumGrid< Position, Fulcrums >::FindLayerIndex ( int  dimension,
double  value 
) const
protected

Find layer index of specified value for specified dimension.

Parameters
dimensionspecifies dimension should be used.
valueargument value.
Returns
biggest layer index, which position is smaller or equal than specified value or -1 if this value is smaller than first layer position.

Definition at line 512 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
int imath::TFulcrumGrid< Position, Fulcrums >::GetDimensionsCount ( ) const
inline

Get number of dimensions.

Definition at line 173 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
const TFulcrumGrid< Position, Fulcrums >::FulcrumType & imath::TFulcrumGrid< Position, Fulcrums >::GetFulcrumAtIndex ( const FulcrumIndex index) const

Get value at specified index.

Definition at line 289 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
void imath::TFulcrumGrid< Position, Fulcrums >::GetFulcrumPosition ( const FulcrumIndex index,
PositionType result 
) const

Get position of node at specified grid index.

Definition at line 269 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
TFulcrumGrid< Position, Fulcrums >::FulcrumSizes imath::TFulcrumGrid< Position, Fulcrums >::GetGridSize ( ) const
inline

Return complete grid size.

Definition at line 166 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
double imath::TFulcrumGrid< Position, Fulcrums >::GetLayerPosition ( int  dimension,
int  layerIndex 
) const
inline

Get position of specified layer of fulcrums.

Definition at line 190 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
int imath::TFulcrumGrid< Position, Fulcrums >::GetLayersCount ( int  dimension) const
inline

Get number of fulcrum points used in this function.

Definition at line 180 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
int imath::TFulcrumGrid< Position, Fulcrums >::InsertLayer ( int  dimension,
double  position 
)

Inserts single fulcrum layer.

Returns
index of added layer.

Definition at line 305 of file TFulcrumGrid.h.

References I_BIG_EPSILON, and I_EPSILON.

template<class Position, class Fulcrums>
bool imath::TFulcrumGrid< Position, Fulcrums >::operator!= ( const TFulcrumGrid< Position, Fulcrums > &  value) const

Definition at line 492 of file TFulcrumGrid.h.

template<class Position, class Fulcrums>
bool imath::TFulcrumGrid< Position, Fulcrums >::operator== ( const TFulcrumGrid< Position, Fulcrums > &  value) const

Definition at line 485 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
void imath::TFulcrumGrid< Position, Fulcrums >::RemoveLayer ( int  dimension,
int  layerIndex 
)
virtual

Remove fulcrums at spacified layer.

Definition at line 376 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
void imath::TFulcrumGrid< Position, Fulcrums >::Reset ( )

Removes all fulcrum points.

Definition at line 214 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
bool imath::TFulcrumGrid< Position, Fulcrums >::Serialize ( iser::IArchive archive)
virtual

Load or store state of this object as a archive stream.

Type of operation is depending on archive type.

See Also
iser::IArchive

Implements iser::ISerializable.

Definition at line 407 of file TFulcrumGrid.h.

References iser::IArchive::BeginMultiTag(), iser::IArchive::BeginTag(), iser::IArchive::EndTag(), iser::IArchive::IsStoring(), NULL, iser::IArchive::Process(), iser::CArchiveTag::TT_GROUP, iser::CArchiveTag::TT_LEAF, and iser::CArchiveTag::TT_MULTIPLE.

template<class Position , class Fulcrums >
bool imath::TFulcrumGrid< Position, Fulcrums >::SetDimensionsCount ( int  count)
virtual

Set number of dimensions.

Please note, that depending on used array type for grid representation not all values must be supported.

Returns
true, if number of dimension was set or false otherwise.

Definition at line 227 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
void imath::TFulcrumGrid< Position, Fulcrums >::SetFulcrumAtIndex ( const FulcrumIndex index,
const FulcrumType value 
)
virtual

Set single fulcrum point.

Definition at line 296 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
void imath::TFulcrumGrid< Position, Fulcrums >::SetLayerPosition ( int  dimension,
int  layerIndex,
double  position 
)
virtual

Set position of specified layer of fulcrums.

Please note, that layer are sorted by its position during update. If you want to block update mechanism, use istd::TUpdateNotifier.

Definition at line 251 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
void imath::TFulcrumGrid< Position, Fulcrums >::SetLayersCount ( int  dimension,
int  count 
)
virtual

Set number of fulcrum layers at specified dimension.

Please note, that this fulcrum velues will be not valid after this operation.

Definition at line 240 of file TFulcrumGrid.h.

template<class Position , class Fulcrums >
void imath::TFulcrumGrid< Position, Fulcrums >::SortFulcrums ( )
protectedvirtual

Sort fulcrums in this collection.

Definition at line 501 of file TFulcrumGrid.h.

Member Data Documentation

template<class Position, class Fulcrums>
const istd::IChangeable::ChangeSet imath::TFulcrumGrid< Position, Fulcrums >::s_fulcrumPositionChange
staticprotected

Definition at line 149 of file TFulcrumGrid.h.


The documentation for this class was generated from the following file:

© 2007-2017 Witold Gantzke and Kirill Lepskiy