MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
mve::View Class Reference

File system representation of a MVE view. More...

#include <view.h>

Collaboration diagram for mve::View:
Collaboration graph
[legend]

Classes

struct  BlobProxy
 Proxy for BLOBs (Binary Large OBjects). More...
 
struct  ImageProxy
 Proxy for images. More...
 
struct  MetaData
 View meta information that stores key/value pairs and the camera. More...
 

Public Types

typedef std::vector< BlobProxyBlobProxies
 
typedef std::shared_ptr< View const > ConstPtr
 
typedef std::vector< ImageProxyImageProxies
 
typedef std::shared_ptr< ViewPtr
 

Public Member Functions

 View (const View &)=delete
 
int cache_cleanup (void)
 Cleans unused data that is not dirty.
 
void clear (void)
 Clears everything, discards potentially unsaved data.
 
void debug_print (void)
 Prints a formatted list of internal data.
 
void delete_value (std::string const &key)
 Deletes the key/value pair from the meta information.
 
ByteImage::Ptr get_blob (std::string const &name)
 Initializes the proxy, loads and returns the blob.
 
BlobProxy const * get_blob_proxy (std::string const &name)
 Returns an initialized blob proxy by name.
 
BlobProxies const & get_blobs (void) const
 Returns a list of all BLOB proxies (blobs may not be initialized).
 
ByteImage::Ptr get_byte_image (std::string const &name)
 Returns an image of type IMAGE_TYPE_UINT8.
 
std::size_t get_byte_size (void) const
 Returns the memory consumption in bytes.
 
CameraInfo const & get_camera (void) const
 Returns the camera information of the view (section "camera").
 
std::string const & get_directory (void) const
 Returns the directory name the view is connected with.
 
FloatImage::Ptr get_float_image (std::string const &name)
 Returns an image of type IMAGE_TYPE_FLOAT.
 
int get_id (void) const
 Returns the ID of the view (key "view.id").
 
ImageBase::Ptr get_image (std::string const &name, ImageType type=IMAGE_TYPE_UNKNOWN)
 Initializes the proxy, loads and returns the image.
 
ImageProxy const * get_image_proxy (std::string const &name, ImageType type=IMAGE_TYPE_UNKNOWN)
 Returns an initialized image proxy by name.
 
ImageProxies const & get_images (void) const
 Returns a list of all image proxies (images may not be initialized).
 
MetaData const & get_meta_data (void) const
 Returns the view meta data.
 
std::string get_name (void) const
 Returns the name of the view (key "view.name").
 
std::string get_value (std::string const &key) const
 Returns a value from the meta information.
 
bool has_blob (std::string const &name)
 Returns true if a BLOB by that name exist.
 
bool has_image (std::string const &name, ImageType type=IMAGE_TYPE_UNKNOWN)
 Returns true if an image by that name exist.
 
bool is_camera_valid (void) const
 Returns true if the camera is valid.
 
bool is_dirty (void) const
 Returns true if meta data, images or blobs are dirty.
 
void load_view (std::string const &path)
 Initializes the view from a directory.
 
void load_view_from_mve_file (std::string const &filename)
 Initializes the view from a deprecated .mve file.
 
View operator= (const View &)=delete
 
void reload_view (void)
 Reloads the view.
 
bool remove_blob (std::string const &name)
 Returns true if a blob by that name has been removed.
 
bool remove_image (std::string const &name)
 Returns true if an image by that name has been removed.
 
int save_view (void)
 Saves dirty meta data, images and blobs, returns the amount saved.
 
void save_view_as (std::string const &path)
 Writes the view to an MVE directory.
 
void set_blob (ByteImage::Ptr blob, std::string const &name)
 Sets a BLOB to the view and marks it dirty.
 
void set_camera (CameraInfo const &camera)
 Sets camera information of the view (section "camera").
 
void set_id (int view_id)
 Sets the view ID (key "view.id").
 
void set_image (ImageBase::Ptr image, std::string const &name)
 Sets an image to the view and marks it dirty.
 
void set_image_ref (std::string const &filename, std::string name)
 Sets an image reference.
 
void set_name (std::string const &name)
 Sets the name of the view (key "view.name").
 
void set_value (std::string const &key, std::string const &value)
 Adds a key/value pair to the meta information.
 

Static Public Member Functions

static View::Ptr create (std::string const &path)
 
static View::Ptr create (void)
 

Protected Types

typedef std::vector< std::string > FilenameList
 

Protected Member Functions

 View (std::string const &path)
 Creates a view and initializes from a directory.
 
 View (void)
 Creates an uninitialized view.
 

Protected Attributes

BlobProxies blobs
 
ImageProxies images
 
MetaData meta_data
 
std::string path
 
FilenameList to_delete
 

Detailed Description

File system representation of a MVE view.

An MVE view is represented in a directory. This class manages the file system layout, meta information in form of (key,value) pairs, and dynamically loads images and blob.

Definition at line 65 of file view.h.

Member Typedef Documentation

◆ BlobProxies

typedef std::vector<BlobProxy> mve::View::BlobProxies

Definition at line 136 of file view.h.

◆ ConstPtr

typedef std::shared_ptr<View const> mve::View::ConstPtr

Definition at line 69 of file view.h.

◆ FilenameList

typedef std::vector<std::string> mve::View::FilenameList
protected

Definition at line 304 of file view.h.

◆ ImageProxies

typedef std::vector<ImageProxy> mve::View::ImageProxies

Definition at line 135 of file view.h.

◆ Ptr

typedef std::shared_ptr<View> mve::View::Ptr

Definition at line 68 of file view.h.

Constructor & Destructor Documentation

◆ View() [1/3]

mve::View::View ( const View )
delete

◆ View() [2/3]

mve::View::View ( void  )
inlineprotected

Creates an uninitialized view.

Definition at line 317 of file view.h.

◆ View() [3/3]

mve::View::View ( std::string const &  path)
inlineprotected

Creates a view and initializes from a directory.

Definition at line 322 of file view.h.

Member Function Documentation

◆ cache_cleanup()

int mve::View::cache_cleanup ( void  )

Cleans unused data that is not dirty.

Returns amount cleaned.

Definition at line 305 of file view.cc.

◆ clear()

void mve::View::clear ( void  )

Clears everything, discards potentially unsaved data.

Definition at line 279 of file view.cc.

◆ create() [1/2]

View::Ptr mve::View::create ( std::string const &  path)
inlinestatic

Definition at line 334 of file view.h.

◆ create() [2/2]

View::Ptr mve::View::create ( void  )
inlinestatic

Definition at line 328 of file view.h.

◆ debug_print()

void mve::View::debug_print ( void  )

Prints a formatted list of internal data.

Definition at line 1000 of file view.cc.

◆ delete_value()

void mve::View::delete_value ( std::string const &  key)

Deletes the key/value pair from the meta information.

Definition at line 368 of file view.cc.

◆ get_blob()

ByteImage::Ptr mve::View::get_blob ( std::string const &  name)

Initializes the proxy, loads and returns the blob.

Definition at line 501 of file view.cc.

◆ get_blob_proxy()

View::BlobProxy const * mve::View::get_blob_proxy ( std::string const &  name)

Returns an initialized blob proxy by name.

Definition at line 510 of file view.cc.

◆ get_blobs()

View::BlobProxies const & mve::View::get_blobs ( void  ) const
inline

Returns a list of all BLOB proxies (blobs may not be initialized).

Definition at line 358 of file view.h.

◆ get_byte_image()

ByteImage::Ptr mve::View::get_byte_image ( std::string const &  name)
inline

Returns an image of type IMAGE_TYPE_UINT8.

Definition at line 401 of file view.h.

◆ get_byte_size()

std::size_t mve::View::get_byte_size ( void  ) const

Returns the memory consumption in bytes.

Definition at line 328 of file view.cc.

◆ get_camera()

CameraInfo const & mve::View::get_camera ( void  ) const
inline

Returns the camera information of the view (section "camera").

Definition at line 389 of file view.h.

◆ get_directory()

std::string const & mve::View::get_directory ( void  ) const
inline

Returns the directory name the view is connected with.

Definition at line 340 of file view.h.

◆ get_float_image()

FloatImage::Ptr mve::View::get_float_image ( std::string const &  name)
inline

Returns an image of type IMAGE_TYPE_FLOAT.

Definition at line 408 of file view.h.

◆ get_id()

int mve::View::get_id ( void  ) const
inline

Returns the ID of the view (key "view.id").

Definition at line 376 of file view.h.

◆ get_image()

ImageBase::Ptr mve::View::get_image ( std::string const &  name,
ImageType  type = IMAGE_TYPE_UNKNOWN 
)

Initializes the proxy, loads and returns the image.

Definition at line 397 of file view.cc.

◆ get_image_proxy()

View::ImageProxy const * mve::View::get_image_proxy ( std::string const &  name,
ImageType  type = IMAGE_TYPE_UNKNOWN 
)

Returns an initialized image proxy by name.

Definition at line 412 of file view.cc.

◆ get_images()

View::ImageProxies const & mve::View::get_images ( void  ) const
inline

Returns a list of all image proxies (images may not be initialized).

Definition at line 352 of file view.h.

◆ get_meta_data()

View::MetaData const & mve::View::get_meta_data ( void  ) const
inline

Returns the view meta data.

Definition at line 346 of file view.h.

◆ get_name()

std::string mve::View::get_name ( void  ) const
inline

Returns the name of the view (key "view.name").

Definition at line 383 of file view.h.

◆ get_value()

std::string mve::View::get_value ( std::string const &  key) const

Returns a value from the meta information.

Definition at line 343 of file view.cc.

◆ has_blob()

bool mve::View::has_blob ( std::string const &  name)

Returns true if a BLOB by that name exist.

Definition at line 519 of file view.cc.

◆ has_image()

bool mve::View::has_image ( std::string const &  name,
ImageType  type = IMAGE_TYPE_UNKNOWN 
)

Returns true if an image by that name exist.

Definition at line 425 of file view.cc.

◆ is_camera_valid()

bool mve::View::is_camera_valid ( void  ) const
inline

Returns true if the camera is valid.

Definition at line 395 of file view.h.

◆ is_dirty()

bool mve::View::is_dirty ( void  ) const

Returns true if meta data, images or blobs are dirty.

Definition at line 289 of file view.cc.

◆ load_view()

void mve::View::load_view ( std::string const &  path)

Initializes the view from a directory.

Definition at line 33 of file view.cc.

◆ load_view_from_mve_file()

void mve::View::load_view_from_mve_file ( std::string const &  filename)

Initializes the view from a deprecated .mve file.

Definition at line 56 of file view.cc.

◆ operator=()

View mve::View::operator= ( const View )
delete

◆ reload_view()

void mve::View::reload_view ( void  )

Reloads the view.

This will discard all unsaved changes.

Definition at line 182 of file view.cc.

◆ remove_blob()

bool mve::View::remove_blob ( std::string const &  name)

Returns true if a blob by that name has been removed.

Definition at line 547 of file view.cc.

◆ remove_image()

bool mve::View::remove_image ( std::string const &  name)

Returns true if an image by that name has been removed.

Definition at line 483 of file view.cc.

◆ save_view()

int mve::View::save_view ( void  )

Saves dirty meta data, images and blobs, returns the amount saved.

Definition at line 225 of file view.cc.

◆ save_view_as()

void mve::View::save_view_as ( std::string const &  path)

Writes the view to an MVE directory.

Definition at line 190 of file view.cc.

◆ set_blob()

void mve::View::set_blob ( ByteImage::Ptr  blob,
std::string const &  name 
)

Sets a BLOB to the view and marks it dirty.

If an embedding by that name already exists, it is overwritten.

Definition at line 525 of file view.cc.

◆ set_camera()

void mve::View::set_camera ( CameraInfo const &  camera)

Sets camera information of the view (section "camera").

Definition at line 374 of file view.cc.

◆ set_id()

void mve::View::set_id ( int  view_id)
inline

Sets the view ID (key "view.id").

Definition at line 364 of file view.h.

◆ set_image()

void mve::View::set_image ( ImageBase::Ptr  image,
std::string const &  name 
)

Sets an image to the view and marks it dirty.

If an image by that name already exists, it is overwritten.

Definition at line 437 of file view.cc.

◆ set_image_ref()

void mve::View::set_image_ref ( std::string const &  filename,
std::string  name 
)

Sets an image reference.

The image will be loaded on first access. When saving a view, the reference will be copied into the view and not converted to a lossless format.

Definition at line 462 of file view.cc.

◆ set_name()

void mve::View::set_name ( std::string const &  name)
inline

Sets the name of the view (key "view.name").

Definition at line 370 of file view.h.

◆ set_value()

void mve::View::set_value ( std::string const &  key,
std::string const &  value 
)

Adds a key/value pair to the meta information.

Definition at line 357 of file view.cc.

Member Data Documentation

◆ blobs

BlobProxies mve::View::blobs
protected

Definition at line 310 of file view.h.

◆ images

ImageProxies mve::View::images
protected

Definition at line 309 of file view.h.

◆ meta_data

MetaData mve::View::meta_data
protected

Definition at line 308 of file view.h.

◆ path

std::string mve::View::path
protected

Definition at line 307 of file view.h.

◆ to_delete

FilenameList mve::View::to_delete
protected

Definition at line 311 of file view.h.


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