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 );
175 QString
name() {
return (QString(
"TextureControl")); };
176 QString
description( ) {
return (QString(
"Handles Textures which are written to mesh properties")); };
180 void slotTextureAdded( QString _textureName , QString _fileName , QImage _image , uint _dimension ,
int _id );
181 void slotTextureAdded( QString _textureName , QString _fileName , QImage _image , uint _dimension );
182 void slotMultiTextureAdded( QString _textureGroup , QString _name , QString _fileName , QImage _image ,
int _id ,
int& _textureId );
184 bool StringToBool(QString _value);
194 void applyDialogSettings(
TextureData* _texData, QString _textureName,
int _id);
197 void getCoordinates1D(QString _textureName,
int _id, std::vector< double >& _x );
202 template<
typename MeshT >
205#if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT)
207 template<
typename VolumeMeshT,
typename VolumeMeshObjectT >
208 void doUpdateTextureOVM (
Texture& _texture , VolumeMeshT& _mesh, VolumeMeshObjectT& meshObj);
211 template<
typename MeshT >
212 void getOriginalHistogram(std::vector< double>& _x, std::vector< double>& _y,
213 int _textureid,
MeshT& _mesh,
217 template<
typename MeshT >
220#if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT)
222 template<
typename VolumeMeshObjectT >
223 void handleFileOpenTexturesOVM( VolumeMeshObjectT* _obj,
int _id );
238 template<
typename MeshT >
242 template<
typename MeshT >
245#if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT)
247 template<
typename VolumeMeshT,
typename VolumeMeshObjectT >
260 template<
typename MeshT >
263 template<
typename MeshT >
266#if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT)
268 template<
typename VolumeMeshT,
typename VolumeMeshObjectT >
284 QActionGroup* actionGroup_;
287 std::vector<QAction*> textureActions_;
320 QString version() {
return QString(
"1.0"); };
324#if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_1D_TEXTURE_HANDLING_C)
325#define TEXTURECONTROL_1D_TEXTURE_HANDLING_TEMPLATES
326#include "TextureControl1DTextureHandlingT_impl.hh"
329#if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_2D_TEXTURE_HANDLING_C)
330#define TEXTURECONTROL_2D_TEXTURE_HANDLING_TEMPLATES
331#include "TextureControl2DTextureHandlingT_impl.hh"
334#if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT)
335 #if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_1D_TEXTURE_HANDLING_OVM_C)
336 #define TEXTURECONTROL_1D_TEXTURE_HANDLING_OVM_TEMPLATES
337 #include "TextureControl1DTextureHandlingOVMT_impl.hh"
340 #if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_2D_TEXTURE_HANDLING_OVM_C)
341 #define TEXTURECONTROL_2D_TEXTURE_HANDLING_OVM_TEMPLATES
342 #include "TextureControl2DTextureHandlingOVMT_impl.hh"
346#if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_HISTOGRAMS_C)
347#define TEXTURECONTROL_HISTOGRAMS_TEMPLATES
348#include "TextureControlHistogramsT_impl.hh"
Logtype
Log types for Message Window.
Interface class for backup handling.
Interface class from which all plugins have to be created.
Interface for all plugins which want to Load or Save files and create Objects.
Interface for all Plugins which do logging to the logging window of the framework.
void slotSetTextureProperties()
Slot for showing the TextureProperties Dialog.
bool parseMode(QString _mode, Texture &_texture)
parse texture mode settings Parses the string _mode and changes the settings in _texture according to...
TextureControlPlugin()
Constructor.
void slotTextureContextMenu(QAction *_action)
Called when the context menu has been triggered.
void slotTextureMenu(QAction *_action)
Called when an action in the TextureMenu is triggered.
QString description()
Return a description of what the plugin is doing.
QMenu * contextMenu_
Stores the per object context menu.
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.
~TextureControlPlugin()
Destructor.
void slotPrintImagePoolInfo()
Print Pool Info.
void doUpdateTexture(Texture &_texture, MeshT &_mesh)
Calls the correct copyTexture() function to copy the texture property into the displayed OM property.
void slotUpdateContextMenu(int _objectId)
Slot from the context menu interface.
void handleFileOpenTextures(MeshT *&_mesh, int _objectId)
Handles data stored in new opened files ( e.g. Texture Information )
void switchDrawMode(TextureType _type, int _id)
Checks for a correct drawmode and changes if necessary.
QString name()
Return a name for the plugin.
Provide texture support for a plugin.