53 #ifndef TEXTURECONTROLPLUGIN_HH
54 #define TEXTURECONTROLPLUGIN_HH
56 #define OM_FORCE_STATIC_CAST
63 #include <OpenFlipper/BasePlugin/TextureInterface.hh>
71 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT
74 #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT
78 #ifdef ENABLE_BSPLINESURFACE_SUPPORT
83 #include "textureProperties.hh"
85 #include "TextureData.hh"
98 #if QT_VERSION >= 0x050000
99 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-TextureControl")
108 void updatedObject(
int _identifier,
const UpdateType& _type);
111 void updateTexture( QString ,
int);
114 void log(
Logtype _type, QString _message);
115 void log(QString _message);
118 void addMenubarAction(QAction* _action, QString _type );
127 void pluginsInitialized();
128 void slotObjectUpdated(
int _identifier,
const UpdateType& _type);
129 void slotDrawModeChanged(
int _viewerId );
132 void slotUpdateAllTextures( );
133 void slotTextureAdded( QString _textureName , QString _filename , uint _dimension ,
int _id );
134 void slotTextureAdded( QString _textureName , QString _filename , uint _dimension );
135 void slotMultiTextureAdded( QString _textureGroup , QString _name , QString _filename ,
int _id ,
int& _textureId );
136 void slotTextureUpdated( QString _textureName ,
int _identifier );
137 void slotSetTextureMode(QString _textureName ,QString _mode,
int _id);
138 void slotSetTextureMode(QString _textureName ,QString _mode);
139 void slotSwitchTexture( QString _textureName,
int _id );
140 void slotSwitchTexture( QString _textureName );
141 void slotUpdateTexture( QString _textureName ,
int _identifier);
142 void slotTextureChangeImage( QString _textureName , QImage& _image ,
int _id );
143 void slotTextureChangeImage( QString _textureName , QImage& _image );
144 void slotTextureGetImage( QString _textureName, QImage& _image,
int _id );
145 void slotTextureGetImage( QString _textureName, QImage& _image );
146 void slotTextureIndex( QString _textureName,
int _id,
int& _index);
147 void slotTextureIndexPropertyName(
int _id, QString& _propertyName);
148 void slotTextureName(
int _id,
int _textureIndex, QString& _textureName);
149 void slotTextureFilename(
int _id, QString _textureName, QString& _textureFilename);
150 void slotGetCurrentTexture(
int _id, QString& _textureName );
151 void slotGetSubTextures(
int _id, QString _multiTextureName, QStringList& _subTextures );
154 void fileOpened(
int _id );
155 void addedEmptyObject(
int _id );
158 void slotAboutToRestore(
int _objectid );
159 void slotRestored(
int _objectid);
163 void doSwitchTexture( QString _textureName,
int _id );
177 QString
name() {
return (QString(
"TextureControl")); };
178 QString
description( ) {
return (QString(
"Handles Textures which are written to mesh properties")); };
182 bool StringToBool(QString _value);
192 void applyDialogSettings(
TextureData* _texData, QString _textureName,
int _id);
195 void getCoordinates1D(QString _textureName,
int _id, std::vector< double >& _x );
200 template<
typename MeshT >
203 #ifdef ENABLE_OPENVOLUMEMESH_SUPPORT
204 template<
typename VolumeMeshT,
typename VolumeMeshObjectT >
206 void doUpdateTextureOVM (
Texture& _texture , VolumeMeshT& _mesh, VolumeMeshObjectT& meshObj);
209 template<
typename MeshT >
210 void getOriginalHistogram(std::vector< double>& _x, std::vector< double>& _y,
211 int _textureid, MeshT& _mesh,
215 template<
typename MeshT >
218 #ifdef ENABLE_OPENVOLUMEMESH_SUPPORT
219 template<
typename VolumeMeshObjectT >
221 void handleFileOpenTexturesOVM( VolumeMeshObjectT* _obj,
int _id );
236 template<
typename MeshT >
240 template<
typename MeshT >
243 #ifdef ENABLE_OPENVOLUMEMESH_SUPPORT
244 template<
typename VolumeMeshT,
typename VolumeMeshObjectT >
258 template<
typename MeshT >
261 template<
typename MeshT >
264 #ifdef ENABLE_OPENVOLUMEMESH_SUPPORT
265 template<
typename VolumeMeshT,
typename VolumeMeshObjectT >
282 QActionGroup* actionGroup_;
285 std::vector<QAction*> textureActions_;
318 QString version() {
return QString(
"1.0"); };
322 #if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_1D_TEXTURE_HANDLING_C)
323 #define TEXTURECONTROL_1D_TEXTURE_HANDLING_TEMPLATES
324 #include "TextureControl1DTextureHandlingT.cc"
327 #if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_2D_TEXTURE_HANDLING_C)
328 #define TEXTURECONTROL_2D_TEXTURE_HANDLING_TEMPLATES
329 #include "TextureControl2DTextureHandlingT.cc"
332 #ifdef ENABLE_OPENVOLUMEMESH_SUPPORT
333 #if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_1D_TEXTURE_HANDLING_OVM_C)
334 #define TEXTURECONTROL_1D_TEXTURE_HANDLING_OVM_TEMPLATES
335 #include "TextureControl1DTextureHandlingOVMT.cc"
338 #if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_2D_TEXTURE_HANDLING_OVM_C)
339 #define TEXTURECONTROL_2D_TEXTURE_HANDLING_OVM_TEMPLATES
340 #include "TextureControl2DTextureHandlingOVMT.cc"
344 #if defined(INCLUDE_TEMPLATES) && !defined(TEXTURECONTROL_HISTOGRAMS_C)
345 #define TEXTURECONTROL_HISTOGRAMS_TEMPLATES
346 #include "TextureControlHistogramsT.cc"
350 #endif //TEXTURECONTROLPLUGIN_HH
QMenu * contextMenu_
Stores the per object context menu.
Interface class from which all plugins have to be created.
void slotSetTextureProperties()
Slot for showing the TextureProperties Dialog.
void handleFileOpenTextures(MeshT *&_mesh, int _objectId)
Handles data stored in new opened files ( e.g. Texture Information )
Logtype
Log types for Message Window.
Interface for all Plugins which do logging to the logging window of the framework.
void slotUpdateContextMenu(int _objectId)
Slot from the context menu interface.
void slotTextureContextMenu(QAction *_action)
Called when the context menu has been triggered.
~TextureControlPlugin()
Destructor.
QString name()
Return a name for the plugin.
Interface for all plugins which want to Load or Save files and create Objects.
TextureControlPlugin()
Constructor.
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 slotTextureMenu(QAction *_action)
Called when an action in the TextureMenu is triggered.
Property classes for the different entity types.
QString description()
Return a description of what the plugin is doing.
Interface class for backup handling.
Interface class for creating custom context menus.
Provide texture support for a plugin.
void switchDrawMode(TextureType _type, int _id)
Checks for a correct drawmode and changes if necessary.
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 provide entries to the main menubar.
void doUpdateTexture(Texture &_texture, MeshT &_mesh)
Calls the correct copyTexture() function to copy the texture property into the displayed OM property...