47 #ifndef TEXTURECONTROLPLUGIN_HH 48 #define TEXTURECONTROLPLUGIN_HH 50 #define OM_FORCE_STATIC_CAST 57 #include <OpenFlipper/BasePlugin/TextureInterface.hh> 65 #ifdef ENABLE_POLYHEDRALMESH_SUPPORT 68 #ifdef ENABLE_HEXAHEDRALMESH_SUPPORT 72 #ifdef ENABLE_BSPLINESURFACE_SUPPORT 77 #include "Dialogs/textureProperties.hh" 79 #include "TextureData.hh" 92 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-TextureControl")
100 void updatedObject(
int _identifier,
const UpdateType& _type);
103 void updateTexture( QString ,
int);
106 void log(
Logtype _type, QString _message);
107 void log(QString _message);
110 void addMenubarAction(QAction* _action, QString _type );
119 void pluginsInitialized();
120 void slotObjectUpdated(
int _identifier,
const UpdateType& _type);
121 void slotDrawModeChanged(
int _viewerId );
124 void slotUpdateAllTextures( );
125 void slotTextureAdded( QString _textureName , QString _filename , uint _dimension ,
int _id ){slotTextureAdded( _textureName , _filename , QImage() , _dimension , _id );}
126 void slotTextureAdded( QString _textureName , QImage _image , uint _dimension ,
int _id ){slotTextureAdded( _textureName , QString() , _image , _dimension , _id );}
127 void slotTextureAdded( QString _textureName , QString _filename , uint _dimension ){slotTextureAdded( _textureName , _filename , QImage() , _dimension );}
128 void slotTextureAdded( QString _textureName , QImage _image , uint _dimension ){slotTextureAdded( _textureName , QString() , _image , _dimension );}
129 void slotMultiTextureAdded( QString _textureGroup , QString _name , QString _filename ,
int _id ,
int& _textureId ){slotMultiTextureAdded( _textureGroup , _name , _filename , QImage() , _id , _textureId );}
130 void slotMultiTextureAdded( QString _textureGroup , QString _name , QImage _image ,
int _id ,
int& _textureId ){slotMultiTextureAdded( _textureGroup , _name , QString() , _image , _id , _textureId );}
131 void slotTextureUpdated( QString _textureName ,
int _identifier );
132 void slotSetTextureMode(QString _textureName ,QString _mode,
int _id);
133 void slotSetTextureMode(QString _textureName ,QString _mode);
134 void slotSwitchTexture( QString _textureName,
int _id );
135 void slotSwitchTexture( QString _textureName );
136 void slotUpdateTexture( QString _textureName ,
int _identifier);
137 void slotTextureChangeImage( QString _textureName , QImage& _image ,
int _id );
138 void slotTextureChangeImage( QString _textureName , QImage& _image );
139 void slotTextureGetImage( QString _textureName, QImage& _image,
int _id );
140 void slotTextureGetImage( QString _textureName, QImage& _image );
141 void slotTextureIndex( QString _textureName,
int _id,
int& _index);
142 void slotTextureIndexPropertyName(
int _id, QString& _propertyName);
143 void slotTextureName(
int _id,
int _textureIndex, QString& _textureName);
144 void slotTextureFilename(
int _id, QString _textureName, QString& _textureFilename);
145 void slotGetCurrentTexture(
int _id, QString& _textureName );
146 void slotGetSubTextures(
int _id, QString _multiTextureName, QStringList& _subTextures );
149 void fileOpened(
int _id );
150 void addedEmptyObject(
int _id );
153 void slotAboutToRestore(
int _objectid );
154 void slotRestored(
int _objectid);
158 void doSwitchTexture( QString _textureName,
int _id );
172 QString
name() {
return (QString(
"TextureControl")); };
173 QString
description( ) {
return (QString(
"Handles Textures which are written to mesh properties")); };
177 void slotTextureAdded( QString _textureName , QString _fileName , QImage _image , uint _dimension ,
int _id );
178 void slotTextureAdded( QString _textureName , QString _fileName , QImage _image , uint _dimension );
179 void slotMultiTextureAdded( QString _textureGroup , QString _name , QString _fileName , QImage _image ,
int _id ,
int& _textureId );
181 bool StringToBool(QString _value);
191 void applyDialogSettings(
TextureData* _texData, QString _textureName,
int _id);
194 void getCoordinates1D(QString _textureName,
int _id, std::vector< double >& _x );
199 template<
typename MeshT >
202 #if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT) 203 template<
typename VolumeMeshT,
typename VolumeMeshObjectT >
205 void doUpdateTextureOVM (
Texture& _texture , VolumeMeshT& _mesh, VolumeMeshObjectT& meshObj);
208 template<
typename MeshT >
209 void getOriginalHistogram(std::vector< double>& _x, std::vector< double>& _y,
210 int _textureid, MeshT& _mesh,
214 template<
typename MeshT >
217 #if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT) 218 template<
typename VolumeMeshObjectT >
220 void handleFileOpenTexturesOVM( VolumeMeshObjectT* _obj,
int _id );
235 template<
typename MeshT >
239 template<
typename MeshT >
242 #if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT) 243 template<
typename VolumeMeshT,
typename VolumeMeshObjectT >
257 template<
typename MeshT >
260 template<
typename MeshT >
263 #if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT) 264 template<
typename VolumeMeshT,
typename VolumeMeshObjectT >
281 QActionGroup* actionGroup_;
284 std::vector<QAction*> textureActions_;
317 QString version() {
return QString(
"1.0"); };
321 #if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_1D_TEXTURE_HANDLING_C) 322 #define TEXTURECONTROL_1D_TEXTURE_HANDLING_TEMPLATES 323 #include "TextureControl1DTextureHandlingT_impl.hh" 326 #if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_2D_TEXTURE_HANDLING_C) 327 #define TEXTURECONTROL_2D_TEXTURE_HANDLING_TEMPLATES 328 #include "TextureControl2DTextureHandlingT_impl.hh" 331 #if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT) 332 #if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_1D_TEXTURE_HANDLING_OVM_C) 333 #define TEXTURECONTROL_1D_TEXTURE_HANDLING_OVM_TEMPLATES 334 #include "TextureControl1DTextureHandlingOVMT_impl.hh" 337 #if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_2D_TEXTURE_HANDLING_OVM_C) 338 #define TEXTURECONTROL_2D_TEXTURE_HANDLING_OVM_TEMPLATES 339 #include "TextureControl2DTextureHandlingOVMT_impl.hh" 343 #if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_HISTOGRAMS_C) 344 #define TEXTURECONTROL_HISTOGRAMS_TEMPLATES 345 #include "TextureControlHistogramsT_impl.hh" 349 #endif //TEXTURECONTROLPLUGIN_HH
Interface class for creating custom context menus.
Logtype
Log types for Message Window.
QString description()
Return a description of what the plugin is doing.
void slotUpdateContextMenu(int _objectId)
Slot from the context menu interface.
Interface for all plugins which want to Load or Save files and create Objects.
Provide texture support for a plugin.
bool parseMode(QString _mode, Texture &_texture)
parse texture mode settings Parses the string _mode and changes the settings in _texture according to...
Interface for all Plugins which do logging to the logging window of the framework.
void doUpdateTexture(Texture &_texture, MeshT &_mesh)
Calls the correct copyTexture() function to copy the texture property into the displayed OM property...
void handleFileOpenTextures(MeshT *&_mesh, int _objectId)
Handles data stored in new opened files ( e.g. Texture Information )
~TextureControlPlugin()
Destructor.
Interface class from which all plugins have to be created.
QMenu * contextMenu_
Stores the per object context menu.
void slotSetTextureProperties()
Slot for showing the TextureProperties Dialog.
Interface for all plugins which provide entries to the main menubar.
QString name()
Return a name for the plugin.
void copyTexture(Texture &_texture, MeshT &_mesh, OpenMesh::VPropHandleT< double > _texProp)
Copy the supplied 1D vertex property to both coordinates of the 2D vertex OM texture property...
void switchDrawMode(TextureType _type, int _id)
Checks for a correct drawmode and changes if necessary.
void slotTextureMenu(QAction *_action)
Called when an action in the TextureMenu is triggered.
Interface class for backup handling.
TextureControlPlugin()
Constructor.
void slotTextureContextMenu(QAction *_action)
Called when the context menu has been triggered.