Choreonoid  1.8
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
cnoid::ItemFileIO Class Reference

#include <ItemFileIO.h>

Inheritance diagram for cnoid::ItemFileIO:
cnoid::Referenced cnoid::GeneralSceneFileImporterBase cnoid::ItemFileIoBase< ItemType > cnoid::ItemFileIoBase< BodyItem > cnoid::ItemFileIoBase< SceneItem > cnoid::BodyItemFileIoBase cnoid::SceneItemStdSceneFileExporter cnoid::BodyItemBodyFileIO

Public Types

enum  API {
  Load = 1 << 0, Options = 1 << 1, OptionPanelForLoading = 1 << 2, Save = 1 << 3,
  OptionPanelForSaving = 1 << 4
}
 
enum  InterfaceLevel { Standard, Conversion, Internal }
 
enum  InvocationType { Direct, Dialog, DragAndDrop }
 

Public Member Functions

 ~ItemFileIO ()
 
bool isFormat (const std::string &format) const
 
int api () const
 
bool hasApi (int api) const
 
const std::string & caption () const
 
const std::string & fileTypeCaption () const
 
void addFormatAlias (const std::string &format)
 
void addFormatIdAlias (const std::string &format)
 
void setExtensionFunction (std::function< std::string()> func)
 
std::vector< std::string > extensions () const
 
int interfaceLevel () const
 
void setCurrentInvocationType (int type)
 
ItemloadItem (const std::string &filename, Item *parentItem=nullptr, bool doAddition=true, Item *nextItem=nullptr, const Mapping *options=nullptr)
 
bool loadItem (Item *item, const std::string &filename, Item *parentItem=nullptr, bool doAddition=true, Item *nextItem=nullptr, const Mapping *options=nullptr)
 
bool saveItem (Item *item, const std::string &filename, const Mapping *options=nullptr)
 
virtual void resetOptions ()
 
virtual void storeOptions (Mapping *options)
 
virtual bool restoreOptions (const Mapping *options)
 
virtual QWidget * getOptionPanelForLoading ()
 
virtual void fetchOptionPanelForLoading ()
 
virtual QWidget * getOptionPanelForSaving (Item *item)
 
virtual void fetchOptionPanelForSaving ()
 
ItemparentItem ()
 
int currentInvocationType () const
 
bool isRegisteredForSingletonItem () const
 
ItemfindSingletonItemInstance () const
 
void setItemClassInfo (Referenced *info)
 
const ReferenceditemClassInfo () const
 
- Public Member Functions inherited from cnoid::Referenced
virtual ~Referenced ()
 

Static Public Member Functions

static std::vector< std::string > separateExtensions (const std::string &multiExtString)
 

Protected Member Functions

 ItemFileIO (const std::string &format, int api)
 
 ItemFileIO (const ItemFileIO &org)
 
 ItemFileIO ()
 
void copyFrom (const ItemFileIO &org)
 
void setApi (int apiSet)
 
void setCaption (const std::string &caption)
 
void setFileTypeCaption (const std::string &caption)
 
void setExtension (const std::string &extension)
 
void setExtensions (const std::vector< std::string > &extensions)
 
void setInterfaceLevel (InterfaceLevel level)
 
virtual bool load (Item *item, const std::string &filename)
 
virtual ItemcreateItem ()
 
virtual bool save (Item *item, const std::string &filename)
 
std::ostream & os ()
 
void putWarning (const std::string &message)
 
void putError (const std::string &message)
 
void setActuallyLoadedItem (Item *item)
 
- Protected Member Functions inherited from cnoid::Referenced
 Referenced ()
 
 Referenced (const Referenced &)
 
int refCount () const
 

Friends

class ItemManager
 
class ItemFileDialog
 

Member Enumeration Documentation

◆ API

Enumerator
Load 
Options 
OptionPanelForLoading 
Save 
OptionPanelForSaving 

◆ InterfaceLevel

Enumerator
Standard 
Conversion 
Internal 

◆ InvocationType

Enumerator
Direct 
Dialog 
DragAndDrop 

Constructor & Destructor Documentation

◆ ~ItemFileIO()

ItemFileIO::~ItemFileIO ( )

◆ ItemFileIO() [1/3]

ItemFileIO::ItemFileIO ( const std::string &  format,
int  api 
)
protected

◆ ItemFileIO() [2/3]

ItemFileIO::ItemFileIO ( const ItemFileIO org)
protected

◆ ItemFileIO() [3/3]

ItemFileIO::ItemFileIO ( )
protected

Member Function Documentation

◆ addFormatAlias()

void ItemFileIO::addFormatAlias ( const std::string &  format)

◆ addFormatIdAlias()

void cnoid::ItemFileIO::addFormatIdAlias ( const std::string &  format)
inline

◆ api()

int ItemFileIO::api ( ) const

◆ caption()

const std::string & ItemFileIO::caption ( ) const

◆ copyFrom()

void ItemFileIO::copyFrom ( const ItemFileIO org)
protected

◆ createItem()

Item * ItemFileIO::createItem ( )
protectedvirtual

◆ currentInvocationType()

int ItemFileIO::currentInvocationType ( ) const

◆ extensions()

std::vector< std::string > ItemFileIO::extensions ( ) const

◆ fetchOptionPanelForLoading()

void ItemFileIO::fetchOptionPanelForLoading ( )
virtual

◆ fetchOptionPanelForSaving()

void ItemFileIO::fetchOptionPanelForSaving ( )
virtual

Reimplemented in cnoid::BodyItemBodyFileIO.

◆ fileTypeCaption()

const std::string & ItemFileIO::fileTypeCaption ( ) const

◆ findSingletonItemInstance()

Item * ItemFileIO::findSingletonItemInstance ( ) const

◆ getOptionPanelForLoading()

QWidget * ItemFileIO::getOptionPanelForLoading ( )
virtual

◆ getOptionPanelForSaving()

QWidget * ItemFileIO::getOptionPanelForSaving ( Item item)
virtual

◆ hasApi()

bool ItemFileIO::hasApi ( int  api) const

◆ interfaceLevel()

int ItemFileIO::interfaceLevel ( ) const

◆ isFormat()

bool ItemFileIO::isFormat ( const std::string &  format) const

◆ isRegisteredForSingletonItem()

bool ItemFileIO::isRegisteredForSingletonItem ( ) const

◆ itemClassInfo()

const Referenced * ItemFileIO::itemClassInfo ( ) const

◆ load()

bool ItemFileIO::load ( Item item,
const std::string &  filename 
)
protectedvirtual

◆ loadItem() [1/2]

Item * ItemFileIO::loadItem ( const std::string &  filename,
Item parentItem = nullptr,
bool  doAddition = true,
Item nextItem = nullptr,
const Mapping options = nullptr 
)

◆ loadItem() [2/2]

bool ItemFileIO::loadItem ( Item item,
const std::string &  filename,
Item parentItem = nullptr,
bool  doAddition = true,
Item nextItem = nullptr,
const Mapping options = nullptr 
)

◆ os()

std::ostream & ItemFileIO::os ( )
protected

◆ parentItem()

Item * ItemFileIO::parentItem ( )

◆ putError()

void ItemFileIO::putError ( const std::string &  message)
protected

◆ putWarning()

void ItemFileIO::putWarning ( const std::string &  message)
protected

◆ resetOptions()

void ItemFileIO::resetOptions ( )
virtual

◆ restoreOptions()

bool ItemFileIO::restoreOptions ( const Mapping options)
virtual

◆ save()

bool ItemFileIO::save ( Item item,
const std::string &  filename 
)
protectedvirtual

◆ saveItem()

bool ItemFileIO::saveItem ( Item item,
const std::string &  filename,
const Mapping options = nullptr 
)

◆ separateExtensions()

std::vector< std::string > ItemFileIO::separateExtensions ( const std::string &  multiExtString)
static

◆ setActuallyLoadedItem()

void ItemFileIO::setActuallyLoadedItem ( Item item)
protected

When the file is loaded as a composite item tree and the item that actually loads the file is different from the top item, the following function must be called with the corresponding item.

◆ setApi()

void ItemFileIO::setApi ( int  apiSet)
protected

◆ setCaption()

void ItemFileIO::setCaption ( const std::string &  caption)
protected

◆ setCurrentInvocationType()

void ItemFileIO::setCurrentInvocationType ( int  type)

◆ setExtension()

void ItemFileIO::setExtension ( const std::string &  extension)
protected

◆ setExtensionFunction()

void ItemFileIO::setExtensionFunction ( std::function< std::string()>  func)

◆ setExtensions()

void ItemFileIO::setExtensions ( const std::vector< std::string > &  extensions)
protected

◆ setFileTypeCaption()

void ItemFileIO::setFileTypeCaption ( const std::string &  caption)
protected

◆ setInterfaceLevel()

void ItemFileIO::setInterfaceLevel ( InterfaceLevel  level)
protected

◆ setItemClassInfo()

void ItemFileIO::setItemClassInfo ( Referenced info)

◆ storeOptions()

void ItemFileIO::storeOptions ( Mapping options)
virtual

Friends And Related Function Documentation

◆ ItemFileDialog

friend class ItemFileDialog
friend

◆ ItemManager

friend class ItemManager
friend

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