MorphoGraphX  2.0-1-227
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
mgx::Store Class Reference

#include <Store.hpp>

Public Member Functions

 Store (Stack *stack)
 Create an empty store. More...
 
 Store (const Store &copy)
 Copy the store, and attach it to the same stack. More...
 
 ~Store ()
 Delete the data attached to the store. More...
 
HVecUSdata ()
 Actual 3D data store linearly in a host vector. More...
 
const HVecUSdata () const
 Actual 3D data store linearly in a host vector. More...
 
bool labels () const
 Returns true if the data is to be interpreted as labels rather than intensities. More...
 
void setLabels (bool val)
 Change the interpretation of the volume as labels. More...
 
float opacity () const
 Opacity used to render the volume. More...
 
void setOpacity (float f)
 Changed the opacity of the volume. More...
 
float brightness () const
 Global brightness used to render the volume. More...
 
void setBrightness (float f)
 Change the brightness of the volume. More...
 
TransferFunction transferFct () const
 Retrieve the transfer function used to render the volume. More...
 
void setTransferFct (const TransferFunction &f)
 Change the transfer function used to render the volume. More...
 
bool transferFunctionChanged () const
 Returns true if the transfer function has been changed within this process. More...
 
void changed ()
 A process that changes the 3D data needs to call this method. More...
 
void changed (const BoundingBox3i &bbox)
 A process that changed a range in the 3D data needs to call this method. More...
 
bool wasChanged () const
 Returns true if the 3D data has been changed during this process. More...
 
const BoundingBox3ichangedBBox () const
 Returns the current bounding box for the changes. More...
 
void show ()
 Ask the user interface to show this store. More...
 
void hide ()
 Ask the user interface to hide this store. More...
 
bool isVisible () const
 Is the store currently visible. More...
 
const Stackstack () const
 Returns a constant pointer on the stack holding this store. More...
 
void setStack (Stack *s)
 Change the stack this store is attached to. More...
 
void allocate ()
 Makes sure the memory for the store is allocated. More...
 
void reset ()
 Reset the memory of the store. More...
 
const QString & file () const
 Returns the file corresponding to this store. More...
 
void setFile (const QString &f=QString())
 Set which file corresponds to this store. More...
 
uint size () const
 Returns the size (in number of elements) of the store. More...
 
bool empty () const
 True if the store is of size 0. More...
 
void copyMetaData (const Store *other)
 Copy the metadata from another store. More...
 

Protected Member Functions

void resetModified ()
 

Protected Attributes

HVecUS _data
 
bool _label
 
bool changed_function
 
float _opacity
 
float _brightness
 
BoundingBox3i _changed
 
TransferFunction _fct
 
bool _isVisible
 
QString _filename
 
const Stack_stack
 

Friends

class SetupProcess
 

Detailed Description

The Store class holds the actual 3D data and properties specific to it.

Definition at line 33 of file Store.hpp.

Constructor & Destructor Documentation

◆ Store() [1/2]

mgx::Store::Store ( Stack stack)

Create an empty store.

◆ Store() [2/2]

mgx::Store::Store ( const Store copy)

Copy the store, and attach it to the same stack.

◆ ~Store()

mgx::Store::~Store ( )

Delete the data attached to the store.

Member Function Documentation

◆ allocate()

void mgx::Store::allocate ( )

Makes sure the memory for the store is allocated.

Note
before the process starts, the memory is already allocated. It is useful only if you change the size of the data by hand.

◆ brightness()

float mgx::Store::brightness ( ) const
inline

Global brightness used to render the volume.

Definition at line 98 of file Store.hpp.

◆ changed() [1/2]

void mgx::Store::changed ( )

A process that changes the 3D data needs to call this method.

This indicate the GUI that the data changed and need reloading in the graphics card.

◆ changed() [2/2]

void mgx::Store::changed ( const BoundingBox3i bbox)
inline

A process that changed a range in the 3D data needs to call this method.

This indicate the GUI that the data changed in this range and need reloading. Note that many calls to this will assume the union of the bounding boxes have changed.

Definition at line 147 of file Store.hpp.

◆ changedBBox()

const BoundingBox3i& mgx::Store::changedBBox ( ) const
inline

Returns the current bounding box for the changes.

Definition at line 157 of file Store.hpp.

◆ copyMetaData()

void mgx::Store::copyMetaData ( const Store other)

Copy the metadata from another store.

In the end, the states will be the same (currently only labels and file name)

◆ data() [1/2]

HVecUS& mgx::Store::data ( )
inline

Actual 3D data store linearly in a host vector.

The data is always store as an unsigned 16 bits integer in a host vector (i.e. from the thrust library)

Definition at line 58 of file Store.hpp.

◆ data() [2/2]

const HVecUS& mgx::Store::data ( ) const
inline

Actual 3D data store linearly in a host vector.

The data is always store as an unsigned 16 bits integer in a host vector (i.e. from the thrust library)

Definition at line 65 of file Store.hpp.

◆ empty()

bool mgx::Store::empty ( ) const
inline

True if the store is of size 0.

Definition at line 217 of file Store.hpp.

◆ file()

const QString& mgx::Store::file ( ) const
inline

Returns the file corresponding to this store.

Definition at line 202 of file Store.hpp.

◆ hide()

void mgx::Store::hide ( )
inline

Ask the user interface to hide this store.

Definition at line 167 of file Store.hpp.

◆ isVisible()

bool mgx::Store::isVisible ( ) const
inline

Is the store currently visible.

Definition at line 172 of file Store.hpp.

◆ labels()

bool mgx::Store::labels ( ) const
inline

Returns true if the data is to be interpreted as labels rather than intensities.

Definition at line 70 of file Store.hpp.

◆ opacity()

float mgx::Store::opacity ( ) const
inline

Opacity used to render the volume.

Definition at line 80 of file Store.hpp.

◆ reset()

void mgx::Store::reset ( )

Reset the memory of the store.

In the end, the store has the correct size and is filled with zeros.

◆ resetModified()

void mgx::Store::resetModified ( )
protected

◆ setBrightness()

void mgx::Store::setBrightness ( float  f)
inline

Change the brightness of the volume.

Definition at line 103 of file Store.hpp.

◆ setFile()

void mgx::Store::setFile ( const QString &  f = QString())

Set which file corresponds to this store.

◆ setLabels()

void mgx::Store::setLabels ( bool  val)
inline

Change the interpretation of the volume as labels.

Definition at line 75 of file Store.hpp.

◆ setOpacity()

void mgx::Store::setOpacity ( float  f)
inline

Changed the opacity of the volume.

Definition at line 85 of file Store.hpp.

◆ setStack()

void mgx::Store::setStack ( Stack s)

Change the stack this store is attached to.

◆ setTransferFct()

void mgx::Store::setTransferFct ( const TransferFunction f)
inline

Change the transfer function used to render the volume.

Definition at line 121 of file Store.hpp.

◆ show()

void mgx::Store::show ( )
inline

Ask the user interface to show this store.

Definition at line 162 of file Store.hpp.

◆ size()

uint mgx::Store::size ( ) const
inline

Returns the size (in number of elements) of the store.

Definition at line 212 of file Store.hpp.

◆ stack()

const Stack* mgx::Store::stack ( ) const
inline

Returns a constant pointer on the stack holding this store.

Definition at line 177 of file Store.hpp.

◆ transferFct()

TransferFunction mgx::Store::transferFct ( ) const
inline

Retrieve the transfer function used to render the volume.

Definition at line 116 of file Store.hpp.

◆ transferFunctionChanged()

bool mgx::Store::transferFunctionChanged ( ) const
inline

Returns true if the transfer function has been changed within this process.

Definition at line 132 of file Store.hpp.

◆ wasChanged()

bool mgx::Store::wasChanged ( ) const
inline

Returns true if the 3D data has been changed during this process.

Definition at line 152 of file Store.hpp.

Friends And Related Function Documentation

◆ SetupProcess

friend class SetupProcess
friend

Definition at line 35 of file Store.hpp.

Member Data Documentation

◆ _brightness

float mgx::Store::_brightness
protected

Definition at line 233 of file Store.hpp.

◆ _changed

BoundingBox3i mgx::Store::_changed
protected

Definition at line 234 of file Store.hpp.

◆ _data

HVecUS mgx::Store::_data
protected

Definition at line 229 of file Store.hpp.

◆ _fct

TransferFunction mgx::Store::_fct
protected

Definition at line 235 of file Store.hpp.

◆ _filename

QString mgx::Store::_filename
protected

Definition at line 237 of file Store.hpp.

◆ _isVisible

bool mgx::Store::_isVisible
protected

Definition at line 236 of file Store.hpp.

◆ _label

bool mgx::Store::_label
protected

Definition at line 230 of file Store.hpp.

◆ _opacity

float mgx::Store::_opacity
protected

Definition at line 232 of file Store.hpp.

◆ _stack

const Stack* mgx::Store::_stack
protected

Definition at line 238 of file Store.hpp.

◆ changed_function

bool mgx::Store::changed_function
protected

Definition at line 231 of file Store.hpp.


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