Developer Documentation
Loading...
Searching...
No Matches
FileOBJPlugin Class Reference
Inheritance diagram for FileOBJPlugin:
PythonInterface TextureInterface RPCInterface StatusbarInterface ScriptInterface LoggingInterface LoadSaveInterface FileInterface BaseInterface

Public Slots

int loadObject (QString _filename)
 Loads Object and converts it to a triangle mesh if possible.
 
int loadObject (QString _filename, DataType _type)
 load object and force type
 
bool saveObject (int _id, QString _filename)
 
QString version ()
 

Signals

void openedFile (int _id)
 
void addEmptyObject (DataType _type, int &_id)
 
void load (QString _filename, DataType _type, int &_id)
 
void save (int _id, QString _filename)
 
void log (Logtype _type, QString _message)
 
void log (QString _message)
 
void updateView ()
 
void updatedObject (int _identifier, const UpdateType &_type)
 
void deleteObject (int _id)
 
void showStatusMessage (QString _message, int _timeout=0)
 
void setStatus (ApplicationStatus::applicationStatus _status)
 
void pluginExists (QString _pluginName, bool &_exists)
 
void setTextureMode (QString _textureName, QString _mode, int _id)
 
void switchTexture (QString _textureName, int _id)
 
void addMultiTexture (QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
 
void textureFilename (int, QString, QString &)
 
void textureIndex (QString _name, int _id, int &_index)
 
void getCurrentTexture (int, QString &)
 
void textureName (int, int, QString &)
 
void getSubTextures (int, QString, QStringList &)
 
void textureIndexPropertyName (int, QString &)
 
- Signals inherited from BaseInterface
virtual void updateView ()
 Update current view in Main Application.
 
virtual void setSlotDescription (QString _slotName, QString _slotDescription, QStringList _parameters, QStringList _descriptions)
 Set a description for a public slot.
 
virtual void setRenderer (unsigned int _viewer, QString _rendererName)
 Set a renderer for the given viewer.
 
- Signals inherited from FileInterface
virtual void openedFile (int _id)
 This signal has to be emitted if an object has been loaded from a file.
 
- Signals inherited from LoadSaveInterface
virtual void save (int _id, QString _filename)
 Save object to a file.
 
virtual void load (QString _filename, DataType _type, int &_id)
 Load object from file with a specific DataType.
 
- Signals inherited from LoggingInterface
virtual void log (Logtype _type, QString _message)=0
 
virtual void log (QString _message)=0
 
- Signals inherited from ScriptInterface
virtual void scriptInfo (QString _functionWithParameters)
 Emit this signal if a scriptable function is executed.
 
virtual void getScriptingEngine (QScriptEngine *&_engine)
 
virtual void executeFileScript (QString _filename)
 
virtual void getAvailableFunctions (QStringList &_functions)
 
- Signals inherited from StatusbarInterface
virtual void showStatusMessage (QString _message, int _timeout=0)
 Show a message in the status bar.
 
- Signals inherited from RPCInterface
virtual void pluginExists (QString _pluginName, bool &_exists)
 
- Signals inherited from TextureInterface
virtual void addTexture (QString _name, QString _filename, uint _dimension, int _id)
 Emit this Signal if a texture has been added (Property Name,filename,Dimension)
 
- Signals inherited from PythonInterface
virtual void executePythonScript (QString _script)
 

Public Member Functions

 FileOBJPlugin ()
 Constructor.
 
QString name ()
 Return a name for the plugin.
 
QString description ()
 Return a description of what the plugin is doing.
 
DataType supportedType ()
 Return your supported object type( e.g. DATA_TRIANGLE_MESH )
 
QString getSaveFilters ()
 
QString getLoadFilters ()
 
QWidget * saveOptionsWidget (QString)
 
QWidget * loadOptionsWidget (QString)
 

Private Slots

void fileOpened (int)
 
- Private Slots inherited from BaseInterface
virtual void exit ()
 
virtual QString version ()
 Return a version string for your plugin.
 
- Private Slots inherited from FileInterface
virtual int loadObject (QString _filename)=0
 Load an object from the given file.
 
virtual int loadObject (QString _filename, DataType _type)
 Load an object from the given file.
 

Private Member Functions

void noguiSupported ()
 
void initializePlugin ()
 Initialize Plugin.
 
void slotLoadDefault ()
 Slot called when user wants to save the given Load options as default.
 
void slotSaveDefault ()
 Slot called when user wants to save the given Save options as default.
 
void slotHandleCheckBoxes (bool _checked)
 
void handleTrimeshDialog ()
 
void checkTypes (QByteArray &_bufferedFile, QString _filename, OBJImporter &_importer, QStringList &_includes)
 Reader functions.
 
bool readMaterial (QString _filename, OBJImporter &_importer)
 
void readOBJFile (QByteArray &_bufferedFile, QString _filename, OBJImporter &_importer)
 
void createAllGroupObjects (OBJImporter &_importer)
 
template<class MeshT >
void backupTextureCoordinates (MeshT &_mesh)
 creates a backup of the original per vertex/face texture coordinates
 
void addTextures (OBJImporter &_importer, int _objectID)
 
void convertToOBJName (QString &_name)
 Convert non-valid filenames (e.g. of groups that end with .jpg) to valid .objs.
 
template<class MeshT >
Material & getMaterial (MeshT &_mesh, const OpenMesh::FaceHandle &_fh, int _objId)
 
template<class MeshT >
bool writeMaterial (QString _filename, MeshT &_mesh, int _objId)
 writer functions
 
template<class MeshT >
bool writeMesh (std::ostream &_out, QString _filename, MeshT &_mesh, int _objId)
 
- Private Member Functions inherited from BaseInterface
virtual ~BaseInterface ()
 Destructor.
 
virtual void blockScenegraphUpdates (bool _block)
 Tell the core to prevent scenegraph updates.
 
virtual void updatedObject (int _objectId)
 An object has been changed or added by this plugin.
 
virtual void updatedObject (int _identifier, const UpdateType &_type)
 An object has been changed or added by this plugin.
 
virtual void nodeVisibilityChanged (int _identifier)
 A scenegraph node has been shown or hidden.
 
virtual void getCurrentRenderer (unsigned int _viewer, QString &_rendererName)
 Get the current renderer for the given viewer.
 
- Private Member Functions inherited from FileInterface
virtual ~FileInterface ()
 Destructor.
 
virtual bool saveObject (int _id, QString _filename)=0
 Save an object from the given file.
 
virtual bool saveObjects (IdList _ids, QString _filename)
 Save multiple objects to one file.
 
- Private Member Functions inherited from LoadSaveInterface
virtual ~LoadSaveInterface ()
 Destructor.
 
virtual void addEmptyObject (DataType _type, int &_id)
 
virtual void copyObject (int _oldId, int &_newId)
 
virtual void emptyObjectAdded (int _id)
 DEPRECATED HERE (Moved to Type Interface)! Emit this signal if an empty object has been created.
 
virtual void deleteObject (int _id)
 Delete an object
This signal can be called from any thread.
.
 
virtual void deleteAllObjects ()
 Delete all Objects.
 
virtual void getAllFileFilters (QStringList &_filters)
 Get all file filters that are registered.
 
- Private Member Functions inherited from LoggingInterface
virtual ~LoggingInterface ()
 Destructor.
 
- Private Member Functions inherited from ScriptInterface
virtual ~ScriptInterface ()
 Destructor.
 
virtual void showScriptInEditor (QString _filename)
 
virtual void executeScript (QString _script)
 
virtual void getDescription (QString _function, QString &_description, QStringList &_parameters, QStringList &_descriptions)
 
- Private Member Functions inherited from StatusbarInterface
virtual ~StatusbarInterface ()
 Destructor.
 
virtual void setStatus (ApplicationStatus::applicationStatus _status)
 Sets the status icon of the StatusBar.
 
virtual void clearStatusMessage ()
 Removes the current message from the statusBar.
 
virtual void addWidgetToStatusbar (QWidget *_widget)
 Add a widget on the right side of the statusBar.
 
- Private Member Functions inherited from RPCInterface
virtual ~RPCInterface ()
 Destructor.
 
virtual void functionExists (QString _pluginName, QString _functionName, bool &_exists)
 
- Private Member Functions inherited from TextureInterface
virtual void addTexture (QString _name, QImage _image, uint _dimension, int _id)
 Emit this Signal if a texture has been added (Property Name,image,Dimension)
 
virtual void addTexture (QString _name, QString _filename, uint _dimension)
 Emit this Signal if a texture has been added (Property Name,filename,Dimension)
 
virtual void addTexture (QString _name, QImage _image, uint _dimension)
 Emit this Signal if a texture has been added (Property Name,image,Dimension)
 
virtual void addMultiTexture (QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
 Emit this Signal if you want to add a texture for a multitexturing mode.
 
virtual void addMultiTexture (QString _textureGroup, QString _name, QImage _image, int _id, int &_textureId)
 Emit this Signal if you want to add a texture for a multitexturing mode.
 
virtual void updateTexture (QString _textureName, int _identifier)
 Tell Plugins to update the given texture for the given identifier This signal can be called from any thread.
.
 
virtual void updateAllTextures ()
 Tell Plugins to update all textures.
 
virtual void updatedTextures (QString, int)
 emit this signal if you updated a texture
 
virtual void switchTexture (QString _textureName, int _id)
 emit this signal if you want to switch the texture of a specific object This signal can be called from any thread.

 
virtual void switchTexture (QString _textureName)
 emit this signal if you want to switch the global texture This signal can be called from any thread.

 
virtual void setTextureMode (QString _textureName, QString _mode)
 emit this signal if you want to set a special mode for this texture (Clamping,...)
 
virtual void setTextureMode (QString _textureName, QString _mode, int _id)
 emit this signal if you want to set a special mode for this texture (Clamping,...)
 
virtual void textureChangeImage (QString _textureName, QImage &_image, int _id)
 Change the texture image of a given texture.
 
virtual void textureChangeImage (QString _textureName, QImage &_image)
 Change the texture image of a given global texture.
 
virtual void textureGetImage (QString _textureName, QImage &_image, int _id)
 get the texture image of a given texture
 
virtual void textureGetImage (QString _textureName, QImage &_image)
 Get the texture image of a given global texture.
 
virtual void textureIndex (QString _textureName, int _id, int &_index)
 Get the texture index of a given texture.
 
virtual void textureIndexPropertyName (int _id, QString &_propertyName)
 Get the name of the texture index property.
 
virtual void textureName (int _id, int _textureIndex, QString &_textureName)
 get the name of the texture with given texture index
 
virtual void textureFilename (int _id, QString _textureName, QString &_textureFilename)
 get the filename of the texture with given texture index
 
virtual void getCurrentTexture (int _id, QString &_textureName)
 get the name of the texture which is currently enabled
 
virtual void getSubTextures (int _id, QString _multiTextureName, QStringList &_subTextures)
 get the names of all sub-textures under the given multiTexture
 
virtual ~TextureInterface ()
 Destructor.
 
- Private Member Functions inherited from PythonInterface
virtual void openPythonScriptInEditor (QString _script)
 
virtual ~PythonInterface ()
 Destructor.
 

Private Attributes

MaterialList materials_
 List that contains the material properties.
 
unsigned int materialErrors_
 number of defect materials encountered during writing
 
QWidget * loadOptions_
 
QWidget * saveOptions_
 
QCheckBox * saveBinary_
 
QCheckBox * saveVertexColor_
 
QCheckBox * saveFaceColor_
 
QCheckBox * saveFaceColorOverride_
 
QCheckBox * saveAlpha_
 
QCheckBox * saveNormals_
 
QCheckBox * saveTexCoords_
 
QCheckBox * saveTextures_
 
QCheckBox * saveCopyTextures_
 
QCheckBox * saveCreateTexFolder_
 
QLabel * savePrecisionLabel_
 
QSpinBox * savePrecision_
 
QPushButton * saveDefaultButton_
 
QComboBox * triMeshHandling_
 
QCheckBox * loadVertexColor_
 
QCheckBox * loadFaceColor_
 
QCheckBox * loadAlpha_
 
QCheckBox * loadNormals_
 
QCheckBox * loadTexCoords_
 
QCheckBox * loadTextures_
 
QPushButton * loadDefaultButton_
 
bool forceTriangleMesh_
 
bool forcePolyMesh_
 
QString textureIndexPropertyName_
 
bool textureIndexPropFetched_
 
std::map< int, QString > texIndexFileMap_
 
OBJImporter::ObjectOptionsE trimeshOptions_
 

Detailed Description

Definition at line 88 of file FileOBJ.hh.

Constructor & Destructor Documentation

◆ FileOBJPlugin()

FileOBJPlugin::FileOBJPlugin ( )

Constructor.

Definition at line 82 of file FileOBJ.cc.

◆ ~FileOBJPlugin()

FileOBJPlugin::~FileOBJPlugin ( )
inline

Definition at line 156 of file FileOBJ.hh.

Member Function Documentation

◆ addTextures()

void FileOBJPlugin::addTextures ( OBJImporter _importer,
int  _objectID 
)
private

Definition at line 468 of file FileOBJ.cc.

◆ backupTextureCoordinates()

template<class MeshT >
void FileOBJPlugin::backupTextureCoordinates ( MeshT _mesh)
private

creates a backup of the original per vertex/face texture coordinates

Definition at line 439 of file FileOBJ.cc.

◆ checkTypes()

void FileOBJPlugin::checkTypes ( QByteArray &  _bufferedFile,
QString  _filename,
OBJImporter _importer,
QStringList &  _includes 
)
private

Reader functions.

check file types and read general info like vertices

Definition at line 1321 of file FileOBJ.cc.

◆ convertToOBJName()

void FileOBJPlugin::convertToOBJName ( QString &  _name)
private

Convert non-valid filenames (e.g. of groups that end with .jpg) to valid .objs.

Definition at line 428 of file FileOBJ.cc.

◆ createAllGroupObjects()

void FileOBJPlugin::createAllGroupObjects ( OBJImporter _importer)
private

Definition at line 332 of file FileOBJ.cc.

◆ description()

QString FileOBJPlugin::description ( )
inlinevirtual

Return a description of what the plugin is doing.

This function has to return a basic description of the plugin

Implements BaseInterface.

Definition at line 159 of file FileOBJ.hh.

◆ fileOpened

void FileOBJPlugin::fileOpened ( int  )
inlineprivateslot

Definition at line 136 of file FileOBJ.hh.

◆ getLoadFilters()

QString FileOBJPlugin::getLoadFilters ( )
virtual

Return the Qt Filters for File dialogs when loading files (e.g. "Off files ( *.off )" )

Implements FileInterface.

Definition at line 121 of file FileOBJ.cc.

◆ getMaterial()

template<class MeshT >
Material & FileOBJPlugin::getMaterial ( MeshT _mesh,
const OpenMesh::FaceHandle _fh,
int  _objId 
)
private

Definition at line 136 of file FileOBJT_impl.hh.

◆ getSaveFilters()

QString FileOBJPlugin::getSaveFilters ( )
virtual

Get the Qt Filters for Filedialogs when saving files (e.g. "Off files ( *.off )" )

Implements FileInterface.

Definition at line 127 of file FileOBJ.cc.

◆ handleTrimeshDialog()

void FileOBJPlugin::handleTrimeshDialog ( )
private

Definition at line 1823 of file FileOBJ.cc.

◆ initializePlugin()

void FileOBJPlugin::initializePlugin ( )
privatevirtual

Initialize Plugin.

This slot is called if the plugin is loaded and has to be initialized. All initialization stuff in this slot has to stay inside the plugin, no external signals are allowed here (and will be ignored). Don't create any objects via PluginFunctions here. Use the pluginsInitialized() slot for external initialization. After execution of this slot your plugin should be fully functional. Only gui elements may be uninitialized and should be created in pluginsInitialized().

Reimplemented from BaseInterface.

Definition at line 116 of file FileOBJ.cc.

◆ loadObject [1/2]

int FileOBJPlugin::loadObject ( QString  _filename)
slot

Loads Object and converts it to a triangle mesh if possible.

Definition at line 1843 of file FileOBJ.cc.

◆ loadObject [2/2]

int FileOBJPlugin::loadObject ( QString  _filename,
DataType  _type 
)
slot

load object and force type

load a obj and force mesh datatype

Definition at line 2121 of file FileOBJ.cc.

◆ loadOptionsWidget()

QWidget * FileOBJPlugin::loadOptionsWidget ( QString  _currentFilter)
virtual

You can provide a special widget showing options for loading your file types depending on the current filter

_currentFilter: one filter from loadFilters

Return 0 when you don't need one

Implements FileInterface.

Definition at line 2330 of file FileOBJ.cc.

◆ name()

QString FileOBJPlugin::name ( )
inlinevirtual

Return a name for the plugin.

This Function has to return the name of the plugin.

Implements BaseInterface.

Definition at line 158 of file FileOBJ.hh.

◆ noguiSupported()

void FileOBJPlugin::noguiSupported ( )
inlineprivatevirtual

Using this function you can inform the core that your plugin can run without creating a widget. If your plugin does not implement this function, it will not be loaded in scripting mode without gui. You don't have to do anything in this function.

Reimplemented from BaseInterface.

Definition at line 138 of file FileOBJ.hh.

◆ readMaterial()

bool FileOBJPlugin::readMaterial ( QString  _filename,
OBJImporter _importer 
)
private

Definition at line 149 of file FileOBJ.cc.

◆ readOBJFile()

void FileOBJPlugin::readOBJFile ( QByteArray &  _bufferedFile,
QString  _filename,
OBJImporter _importer 
)
private

Definition at line 595 of file FileOBJ.cc.

◆ saveObject

bool FileOBJPlugin::saveObject ( int  _id,
QString  _filename 
)
slot

Definition at line 2133 of file FileOBJ.cc.

◆ saveOptionsWidget()

QWidget * FileOBJPlugin::saveOptionsWidget ( QString  _currentFilter)
virtual

You can provide a special widget showing options for saving your file types depending on the current filter

_currentFilter: one filter from saveFilters

Return 0 when you don't need one

Implements FileInterface.

Definition at line 2261 of file FileOBJ.cc.

◆ slotHandleCheckBoxes()

void FileOBJPlugin::slotHandleCheckBoxes ( bool  _checked)
private

Definition at line 2251 of file FileOBJ.cc.

◆ slotLoadDefault()

void FileOBJPlugin::slotLoadDefault ( )
private

Slot called when user wants to save the given Load options as default.

Definition at line 2381 of file FileOBJ.cc.

◆ slotSaveDefault()

void FileOBJPlugin::slotSaveDefault ( )
private

Slot called when user wants to save the given Save options as default.

Definition at line 2392 of file FileOBJ.cc.

◆ supportedType()

DataType FileOBJPlugin::supportedType ( )
virtual

Return your supported object type( e.g. DATA_TRIANGLE_MESH )

If you support multiple DataTypes you can combine them bitwise here. The function is used from the load and save code to check if your plugin can handle an object of a given dataType.

Implements FileInterface.

Definition at line 133 of file FileOBJ.cc.

◆ version

QString FileOBJPlugin::version ( )
inlineslot

Definition at line 179 of file FileOBJ.hh.

◆ writeMaterial()

template<class MeshT >
bool FileOBJPlugin::writeMaterial ( QString  _filename,
MeshT _mesh,
int  _objId 
)
private

writer functions

Definition at line 56 of file FileOBJT_impl.hh.

◆ writeMesh()

template<class MeshT >
bool FileOBJPlugin::writeMesh ( std::ostream &  _out,
QString  _filename,
MeshT _mesh,
int  _objId 
)
private

Definition at line 260 of file FileOBJT_impl.hh.

Member Data Documentation

◆ forcePolyMesh_

bool FileOBJPlugin::forcePolyMesh_
private

Definition at line 255 of file FileOBJ.hh.

◆ forceTriangleMesh_

bool FileOBJPlugin::forceTriangleMesh_
private

Definition at line 254 of file FileOBJ.hh.

◆ loadAlpha_

QCheckBox* FileOBJPlugin::loadAlpha_
private

Definition at line 248 of file FileOBJ.hh.

◆ loadDefaultButton_

QPushButton* FileOBJPlugin::loadDefaultButton_
private

Definition at line 252 of file FileOBJ.hh.

◆ loadFaceColor_

QCheckBox* FileOBJPlugin::loadFaceColor_
private

Definition at line 247 of file FileOBJ.hh.

◆ loadNormals_

QCheckBox* FileOBJPlugin::loadNormals_
private

Definition at line 249 of file FileOBJ.hh.

◆ loadOptions_

QWidget* FileOBJPlugin::loadOptions_
private

Definition at line 227 of file FileOBJ.hh.

◆ loadTexCoords_

QCheckBox* FileOBJPlugin::loadTexCoords_
private

Definition at line 250 of file FileOBJ.hh.

◆ loadTextures_

QCheckBox* FileOBJPlugin::loadTextures_
private

Definition at line 251 of file FileOBJ.hh.

◆ loadVertexColor_

QCheckBox* FileOBJPlugin::loadVertexColor_
private

Definition at line 246 of file FileOBJ.hh.

◆ materialErrors_

unsigned int FileOBJPlugin::materialErrors_
private

number of defect materials encountered during writing

Definition at line 203 of file FileOBJ.hh.

◆ materials_

MaterialList FileOBJPlugin::materials_
private

List that contains the material properties.

Definition at line 200 of file FileOBJ.hh.

◆ saveAlpha_

QCheckBox* FileOBJPlugin::saveAlpha_
private

Definition at line 234 of file FileOBJ.hh.

◆ saveBinary_

QCheckBox* FileOBJPlugin::saveBinary_
private

Definition at line 230 of file FileOBJ.hh.

◆ saveCopyTextures_

QCheckBox* FileOBJPlugin::saveCopyTextures_
private

Definition at line 238 of file FileOBJ.hh.

◆ saveCreateTexFolder_

QCheckBox* FileOBJPlugin::saveCreateTexFolder_
private

Definition at line 239 of file FileOBJ.hh.

◆ saveDefaultButton_

QPushButton* FileOBJPlugin::saveDefaultButton_
private

Definition at line 242 of file FileOBJ.hh.

◆ saveFaceColor_

QCheckBox* FileOBJPlugin::saveFaceColor_
private

Definition at line 232 of file FileOBJ.hh.

◆ saveFaceColorOverride_

QCheckBox* FileOBJPlugin::saveFaceColorOverride_
private

Definition at line 233 of file FileOBJ.hh.

◆ saveNormals_

QCheckBox* FileOBJPlugin::saveNormals_
private

Definition at line 235 of file FileOBJ.hh.

◆ saveOptions_

QWidget* FileOBJPlugin::saveOptions_
private

Definition at line 228 of file FileOBJ.hh.

◆ savePrecision_

QSpinBox* FileOBJPlugin::savePrecision_
private

Definition at line 241 of file FileOBJ.hh.

◆ savePrecisionLabel_

QLabel* FileOBJPlugin::savePrecisionLabel_
private

Definition at line 240 of file FileOBJ.hh.

◆ saveTexCoords_

QCheckBox* FileOBJPlugin::saveTexCoords_
private

Definition at line 236 of file FileOBJ.hh.

◆ saveTextures_

QCheckBox* FileOBJPlugin::saveTextures_
private

Definition at line 237 of file FileOBJ.hh.

◆ saveVertexColor_

QCheckBox* FileOBJPlugin::saveVertexColor_
private

Definition at line 231 of file FileOBJ.hh.

◆ texIndexFileMap_

std::map<int,QString> FileOBJPlugin::texIndexFileMap_
private

Definition at line 259 of file FileOBJ.hh.

◆ textureIndexPropertyName_

QString FileOBJPlugin::textureIndexPropertyName_
private

Definition at line 257 of file FileOBJ.hh.

◆ textureIndexPropFetched_

bool FileOBJPlugin::textureIndexPropFetched_
private

Definition at line 258 of file FileOBJ.hh.

◆ triMeshHandling_

QComboBox* FileOBJPlugin::triMeshHandling_
private

Definition at line 245 of file FileOBJ.hh.

◆ trimeshOptions_

OBJImporter::ObjectOptionsE FileOBJPlugin::trimeshOptions_
private

Definition at line 260 of file FileOBJ.hh.


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